All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Ricardo Rivera-Matos" <rriveram@opensource.cirrus.com>
Cc: linux-sound@vger.kernel.org, devicetree@vger.kernel.org,
	robh@kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH 2/4] ASoC: cs35l45: Adds support for ABPE feature
Date: Mon, 09 Nov 2026 18:11:09 +0000	[thread overview]
Message-ID: <sashiko-outbox-205377@kernel.org> (raw)
In-Reply-To: <20261109-cs35l45-bpe-v1-2-9d7bc95a90a4@opensource.cirrus.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] ASoC: cs35l45: wrong constant NUM_BPE_MODE used for BPE level
  calculation
--

commit 7442e06bcd39f5fc281e35f2b0834bedc508545e
Author: Ricardo Rivera-Matos <rriveram@opensource.cirrus.com>

ASoC: cs35l45: Adds support for ABPE feature

This commit adds boot-time configuration support for the amplifier brownout
prevention engine (ABPE) via device properties.

> diff --git a/sound/soc/codecs/cs35l45.c b/sound/soc/codecs/cs35l45.c
> index 064ee612f05ef..72f4ab1b89bed 100644
> --- a/sound/soc/codecs/cs35l45.c
> +++ b/sound/soc/codecs/cs35l45.c
> @@ -1148,6 +1148,225 @@ static void cs35l45_apply_sync_property_config(struct cs35l45_private *cs35l45)
[ ... ]
> +static int cs35l45_bpe_set_rls_rate(struct cs35l45_private *cs35l45)
> +{
> +	u32 values[CS35L45_BPE_NUM_LEVELS];
> +	u32 packed = 0;
> +	int i, ret;
> +
> +	ret = cs35l45_bpe_read_array(cs35l45, "cirrus,amplifier-bpe-release-rates", values,
> +				     ARRAY_SIZE(values));
> +	if (ret)
> +		return ret;
> +
> +	for (i = 0; i < CS35L45_BPE_NUM_LEVELS; i++) {
> +		if (values[i] > CS35L45_BPE_INST_RLS_RATE_MAX) {
> +			dev_err(cs35l45->dev, "invalid ABPE release rate at level %d\n",
> +				NUM_BPE_MODE - i);
> +			return -EINVAL;
> +		}

[Severity: Low]
Should this use CS35L45_BPE_NUM_LEVELS - 1 - i instead of NUM_BPE_MODE - i?
NUM_BPE_MODE is the sentinel for enum bpe_modes (the number of BPE response
modes) and only happens to equal 3.  The same applies to the error messages
in cs35l45_bpe_set_atk_rate() and cs35l45_bpe_set_thld().

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261109-cs35l45-bpe-v1-0-9d7bc95a90a4@opensource.cirrus.com?part=2

  reply	other threads:[~2026-11-09 18:11 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-09 17:57 [PATCH 0/4] ASoC: cs35l45: Adds support for brownout prevention engines Ricardo Rivera-Matos
2026-11-09 17:57 ` Ricardo Rivera-Matos via B4 Relay
2026-11-09 17:57 ` [PATCH 1/4] ASoC: dt-bindings: cs35l45: Adds ABPE properties Ricardo Rivera-Matos
2026-11-09 17:57   ` Ricardo Rivera-Matos via B4 Relay
2026-11-09 17:57 ` [PATCH 2/4] ASoC: cs35l45: Adds support for ABPE feature Ricardo Rivera-Matos
2026-11-09 17:57   ` Ricardo Rivera-Matos via B4 Relay
2026-11-09 18:11   ` sashiko-bot [this message]
2026-11-09 17:57 ` [PATCH 3/4] ASoC: dt-bindings: cs35l45: Adds Boost BPE properties Ricardo Rivera-Matos
2026-11-09 17:57   ` Ricardo Rivera-Matos via B4 Relay
2026-11-09 17:57 ` [PATCH 4/4] ASoC: cs35l45: Adds Boost BPE configuration Ricardo Rivera-Matos via B4 Relay
2026-11-09 17:57   ` Ricardo Rivera-Matos
2026-11-11 16:14 ` [PATCH 0/4] ASoC: cs35l45: Adds support for brownout prevention engines Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=sashiko-outbox-205377@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=rriveram@opensource.cirrus.com \
    --cc=sashiko-reviews@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.