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 v3 2/2] ASoC: codecs: nau8310: Add support for NAU83G10 amplifier
Date: Fri, 27 Nov 2026 13:23:25 +0800 [thread overview]
Message-ID: <9814e94e-539b-4729-9cbf-4642ea15e64d@gmail.com> (raw)
In-Reply-To: <179518986191.6016.16828944387493140658.b4-review@b4>
On 11/20/26 23:51, Mark Brown wrote:
>> Add support for the Nuvoton NAU83G10/20 audio amplifier.
>> The NAU83G10 is a mono boost Class-D audio amplifier with
>> integrated DSP and I/V-sense support.
>> +static int nau8310_hw_params(struct snd_pcm_substream *substream,
>> + struct snd_pcm_hw_params *params, struct snd_soc_dai *dai)
>> +{
>> + struct snd_soc_component *cp = dai->component;
>> + struct nau8310 *nau8310 = snd_soc_component_get_drvdata(cp);
>> + unsigned int val_len = 0;
>> + int fs, ret;
>> +
>> + fs = params_rate(params);
>> + if (nau8310_dsp_active(cp) && fs != NAU8310_DEFAULT_FS) {
>> + dev_err(nau8310->dev,
>> + "For ROM Code revision 00, DSP only run at 48kHz.");
>> + return -EINVAL;
>> + }
>> + ret = nau8310_clock_config(nau8310, fs, nau8310->mclk);
>> + if (ret)
>> + return -EINVAL;
> As previously noted this hosld return ret, not overwrite the value.
Got it, I will fix this in the next version.
>
>> +static int __maybe_unused nau8310_resume(struct snd_soc_component *cp)
>> +{
>> + struct nau8310 *nau8310 = snd_soc_component_get_drvdata(cp);
>> + struct regmap *regmap = nau8310->regmap;
>> + int ret = 0;
>> +
>> + regcache_cache_only(regmap, false);
>> + ret = regcache_sync(regmap);
>> + if (ret)
>> + return ret;
>> +
>> + ret = nau8310_dsp_fw_load(nau8310);
> This will set the clock back to the internal clock and if we had an
> active stream nothing restores it so the audio will be broken.
I will save fs in nau8310_hw_params() and restore the previous clock
settings in nau8310_clock_event() (PRE_PMU) when a stream is active:
case SND_SOC_DAPM_PRE_PMU:
flush_work(&nau8310->load_fw_work);
mutex_lock(&nau8310->lock);
if (snd_soc_component_active(cp) && nau8310->fs && nau8310->mclk) {
ret = nau8310_clock_config(nau8310, nau8310->fs,
nau8310->mclk);
if (ret) {
mutex_unlock(&nau8310->lock);
return ret;
}
}
/* Switch the clock source of DSP to MCLK. */
regmap_update_bits(nau8310->regmap, NAU8310_R04_ENA_CTRL,
NAU8310_DSP_SEL_OSC, 0);
mutex_unlock(&nau8310->lock);
break;
>
>> +static const struct regmap_config nau8310_regmap_config = {
>> + .reg_bits = NAU8310_REG_ADDR_LEN,
>> + .val_bits = NAU8310_REG_DATA_LEN,
>> +
>> + .max_register = NAU8310_REG_MAX,
>> + .readable_reg = nau8310_readable_reg,
>> + .writeable_reg = nau8310_writeable_reg,
>> + .volatile_reg = nau8310_volatile_reg,
> Does NAU8310_RF000_DSP_COMM not need to be marked as previous?
Do you mean marking it as precious using .precious_reg?
>
next prev parent reply other threads:[~2026-11-27 5:25 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-18 8:42 [PATCH v3 0/2] ASoC: codecs: nau8310: Add NAU83G10 amplifier Neo Chang
2026-11-18 8:42 ` [PATCH v3 1/2] ASoC: dt-bindings: nuvoton,nau8310: Add NAU83G10 Neo Chang
2026-11-18 8:42 ` [PATCH v3 2/2] ASoC: codecs: nau8310: Add support for NAU83G10 amplifier Neo Chang
2026-11-18 9:31 ` sashiko-bot
2026-11-20 15:51 ` Mark Brown
2026-11-27 5:23 ` YLCHANG2 [this message]
2026-11-20 15:51 ` [PATCH v3 0/2] ASoC: codecs: nau8310: Add " Mark Brown
2026-11-20 15:53 ` 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=9814e94e-539b-4729-9cbf-4642ea15e64d@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