Devicetree
 help / color / mirror / Atom feed
From: YLCHANG2 <neo.chang70@gmail.com>
To: Mark Brown <broonie@kernel.org>, Neo Chang <YLCHANG2@nuvoton.com>
Cc: lgirdwood@gmail.com, perex@perex.cz, robh@kernel.org,
	krzk+dt@kernel.org, linux-sound@vger.kernel.org,
	devicetree@vger.kernel.org, alsa-devel@alsa-project.org,
	kchsu0@nuvoton.com, sjlin0@nuvoton.com
Subject: Re: [PATCH v9 2/2] ASoC: codecs: nau8360: Add support for NAU83G60 amplifier
Date: Mon, 24 Aug 2026 16:26:21 +0800	[thread overview]
Message-ID: <ad5e618f-eff6-4b28-8c9c-456531e6632b@gmail.com> (raw)
In-Reply-To: <7e7b8329-23d3-495d-ad48-9ea70189c46c@sirena.org.uk>


On 8/21/26 23:24, Mark Brown wrote:
> On Thu, Aug 20, 2026 at 10:29:25AM +0800, Neo Chang wrote:
>> Add support for the Nuvoton NAU83G60 audio codec. The NAU83G60 is a
>> stereo 30W+30W smart amplifier with an integrated low-latency
>> Advanced Audio DSP.
> A couple of issues here, mostly this looks fine.
Hi Mark, Thanks for the review.
>
>> +static int nau8360_peq_coeff_put(struct snd_kcontrol *kcontrol,
>> +	struct snd_ctl_elem_value *ucontrol)
>> +{
>> +	struct snd_soc_component *cp = snd_kcontrol_chip(kcontrol);
>> +	struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(cp);
>> +	struct nau8360 *nau8360 = snd_soc_component_get_drvdata(cp);
>> +	struct soc_bytes_ext *params = (void *)kcontrol->private_value;
>> +	int i, reg, ret = 0;
>> +	__be16 *data = NULL;
>> +	bool changed = false;
>> +
>> +	/* Use the DAPM lock to prevent race conditions during DAPM power-up
>> +	 * state transitions, and check component active status to prohibit
>> +	 * PEQ access during active audio streams (playback and capture).
>> +	 */
>> +	snd_soc_dapm_mutex_lock(dapm);
>> +	if (snd_soc_component_active(cp)) {
>> +		dev_dbg(nau8360->dev,
>> +			"PEQ coefficient access is ignored during audio is active");
>> +		goto unlock_dapm;
> This should probably be -EBUSY or something, though that will upset
> mixer-test.  As things stand since the values change when a stream
> starts and stops there should be an event when that happens, and since
> we report success some value ought to be filled in for the read.
I will change the return value to -EBUSY in v10
>
>> +static void nau8360_dsp_fw_load(struct nau8360 *nau8360)
>> +{
>> +	nau8360->load_fw_done = false;
>> +	schedule_work(&nau8360->load_fw_work);
>> +}
>> +static int __maybe_unused nau8360_resume(struct snd_soc_component *component)
>> +{
>> +	struct nau8360 *nau8360 = snd_soc_component_get_drvdata(component);
>> +	struct regmap *regmap = nau8360->regmap;
>> +	nau8360_dsp_fw_load(nau8360);
> This only kicks off the firmware load, it doesn't wait for it to
> complete.  That means that if a stream restarts quickly after resume we
> will run into issues - I see that the normal playback path just errors
> if we try to start without the firmware.  We should wait, either here or
> in the startup path.
I will add flush_work() in startup() to ensure the firmware loading is 
complete before the stream starts.
>
>> +	if (NAU8360_IS_DSP_REG(reg))
>> +		*value = nau8360->i2c_read_buf[0] |
>> +			(nau8360->i2c_read_buf[1] << 8) |
>> +			(nau8360->i2c_read_buf[2] << 16) |
>> +			(nau8360->i2c_read_buf[3] << 24);
> get_unaligned_le32()?
I will replace the manual bit shifts with the unaligned function in v10.

      reply	other threads:[~2026-08-24  8:26 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-20  2:29 [PATCH v9 0/2] ASoC: codecs: Add Nuvoton NAU83G60 audio codec driver Neo Chang
2026-08-20  2:29 ` [PATCH v9 1/2] ASoC: dt-bindings: nuvoton,nau8360: Add NAU83G60 Neo Chang
2026-08-20  2:29 ` [PATCH v9 2/2] ASoC: codecs: nau8360: Add support for NAU83G60 amplifier Neo Chang
2026-08-20  2:43   ` sashiko-bot
2026-08-21 15:24   ` Mark Brown
2026-08-24  8:26     ` YLCHANG2 [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=ad5e618f-eff6-4b28-8c9c-456531e6632b@gmail.com \
    --to=neo.chang70@gmail.com \
    --cc=YLCHANG2@nuvoton.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=kchsu0@nuvoton.com \
    --cc=krzk+dt@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-sound@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=robh@kernel.org \
    --cc=sjlin0@nuvoton.com \
    /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