Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Neo Chang" <YLCHANG2@nuvoton.com>
Cc: devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH 2/2] ASoC: codecs: nau8360: Add default PEQ band number for DSP init
Date: Fri, 04 Sep 2026 02:51:28 +0000	[thread overview]
Message-ID: <20260904025128.CC4001F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260904024456.193528-3-YLCHANG2@nuvoton.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Missing bit shift for NAU8360_PEQ_BAND_8 causes the PEQ band field to be incorrectly cleared to 0 instead of being set to 8.
--

commit dcc017a933844c3bdb0f174e1e0108fe17fff20e
Author: Neo Chang <YLCHANG2@nuvoton.com>

ASoC: codecs: nau8360: Add default PEQ band number for DSP init

This commit sets a default PEQ band number during DSP initialization in the
nau8360 codec. The goal is to prevent invalid states or uninitialized
parameters before user configuration is applied.

> diff --git a/sound/soc/codecs/nau8360.c b/sound/soc/codecs/nau8360.c
> index b3cf207eea86d..5a94e9a3072a5 100644
> --- a/sound/soc/codecs/nau8360.c
> +++ b/sound/soc/codecs/nau8360.c
> @@ -1602,6 +1602,8 @@ static void nau8360_coeff_set_def(struct nau8360 *nau8360)
>  			i * NAU8360_TOT_BAND_COE_RANGE, 0x20);
>  	}
>  	nau8360_peq_mem_enable(regmap, false);
> +	regmap_update_bits(regmap, NAU8360_R9D_PEQ_CTL, NAU8360_PEQ_BAND_MASK,
> +		NAU8360_PEQ_BAND_8);

[Severity: High]
Does this code clear the band field to 0 instead of setting it to 8?

In sound/soc/codecs/nau8360.h, NAU8360_PEQ_BAND_MASK is shifted:

#define NAU8360_PEQ_BAND_MASK (0xf << NAU8360_PEQ_BAND_SFT)

But NAU8360_PEQ_BAND_8 evaluates to 8 unshifted. Because it is passed
without the shift here, the value applied against the shifted mask becomes
zero.

Other uses of this field in the driver explicitly shift the value,
such as:

regmap_update_bits(regmap, NAU8360_R9D_PEQ_CTL, NAU8360_PEQ_BAND_MASK,
	value << NAU8360_PEQ_BAND_SFT);

Could this regression in the bit shift cause incorrect DSP initialization?

>  	mutex_unlock(&nau8360->lock);
>  }

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260904024456.193528-1-YLCHANG2@nuvoton.com?part=2

      reply	other threads:[~2026-09-04  2:51 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-04  2:44 [PATCH 0/2] ASoC: codecs: nau8360: Add DSP fallback and PEQ band initialization Neo Chang
2026-09-04  2:44 ` [PATCH 1/2] ASoC: codecs: nau8360: Set DAC path to bypass mode when DSP firmware load fails Neo Chang
2026-09-04  2:55   ` sashiko-bot
2026-09-04  2:44 ` [PATCH 2/2] ASoC: codecs: nau8360: Add default PEQ band number for DSP init Neo Chang
2026-09-04  2:51   ` sashiko-bot [this message]

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=20260904025128.CC4001F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=YLCHANG2@nuvoton.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=robh@kernel.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox