* [PATCH v2] ASoC: codecs: lpass-wsa-macro: rewrite the interpolator volume after enabling clocks
@ 2026-09-29 11:57 Liviu Nicoara
2026-09-29 12:25 ` Johan Hovold
2026-09-29 13:09 ` Mark Brown
0 siblings, 2 replies; 3+ messages in thread
From: Liviu Nicoara @ 2026-09-29 11:57 UTC (permalink / raw)
To: Srinivas Kandagatla, Mark Brown, Liam Girdwood
Cc: Jaroslav Kysela, Takashi Iwai, Jonathan Marek, Johan Hovold,
linux-sound, linux-arm-msm, linux-kernel, Liviu Nicoara, stable
Commit 902f497a1ff5 ("ASoC: codecs: lpass-wsa-macro: remove useless
gain read/write sequence") removed the read and write of the digital
volume register in wsa_macro_enable_interpolator(), on the grounds that
writing back the value just read does nothing. The comment above it,
"apply gain after int clk is enabled", was left in place.
On the Dell XPS 13 9345 (X1E80100, four WSA8845 amplifiers on two WSA
macros) the write does something: a volume change made while the path
is idle does not take effect when playback starts. Lowering the digital
volume from 81 to 63 with nothing playing, then playing a test tone,
gave about the same level as before the change. With the rewrite
restored, lowering it from 81 to 69 while idle played audibly quieter,
and restoring 81 while idle brought the level back. Changes made during
playback take effect with or without the rewrite.
The register already holds the new value when this happens. Without the
rewrite, after an idle change from 69 to 81, playback stayed at the old
level while the register, read from the hardware through /dev/mem, held
the new one (0xfd). Writing that same value back through /dev/mem
brought the level up at once.
This is the behaviour described in commit 46188db080bd ("ASoC: codecs:
lpass-wsa-macro: fix compander volume hack"): "the volume registers
still need to be written after enabling clocks in order for any prior
updates to take effect." The value read comes from the register cache,
so the write pushes the last requested volume to the hardware once its
clock runs.
Restore the rewrite in the interpolator's POST_PMU event only. The mix
path event removed later in the same series is not brought back.
Fixes: 902f497a1ff5 ("ASoC: codecs: lpass-wsa-macro: remove useless gain read/write sequence")
Cc: stable@vger.kernel.org
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Liviu Nicoara <lnicoara@thinkoid.org>
---
Notes:
Changes in v2:
- Cc stable (Johan Hovold).
- Add the /dev/mem read and rewrite from the v1 review.
- Link to v1: https://lore.kernel.org/all/20260924125940.22665-1-lnicoara@thinkoid.org/
Tested on v7.2.6 on the machine above, by listening. This function is
unchanged between v7.2 and for-next; the driver's clocks moved to the
PM clock framework in cd054a6e272c after v7.2, which was not tested
here. Build-tested on broonie/for-next (arm64 defconfig).
sound/soc/codecs/lpass-wsa-macro.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/sound/soc/codecs/lpass-wsa-macro.c b/sound/soc/codecs/lpass-wsa-macro.c
index 4242366601a5..899c8bee4645 100644
--- a/sound/soc/codecs/lpass-wsa-macro.c
+++ b/sound/soc/codecs/lpass-wsa-macro.c
@@ -1849,6 +1849,7 @@ static int wsa_macro_enable_interpolator(struct snd_soc_dapm_widget *w,
int event)
{
struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm);
+ unsigned int gain;
u16 gain_reg;
u16 reg;
struct wsa_macro *wsa = snd_soc_component_get_drvdata(component);
@@ -1890,6 +1891,8 @@ static int wsa_macro_enable_interpolator(struct snd_soc_dapm_widget *w,
CDC_WSA_RX_PGA_HALF_DB_MASK,
CDC_WSA_RX_PGA_HALF_DB_ENABLE);
}
+ gain = snd_soc_component_read(component, gain_reg);
+ snd_soc_component_write(component, gain_reg, gain);
wsa_macro_config_ear_spkr_gain(component, wsa,
event, gain_reg);
break;
base-commit: 1f9b1774f65c6670a37000390e6c43309248a345
--
2.55.0
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2] ASoC: codecs: lpass-wsa-macro: rewrite the interpolator volume after enabling clocks
2026-09-29 11:57 [PATCH v2] ASoC: codecs: lpass-wsa-macro: rewrite the interpolator volume after enabling clocks Liviu Nicoara
@ 2026-09-29 12:25 ` Johan Hovold
2026-09-29 13:09 ` Mark Brown
1 sibling, 0 replies; 3+ messages in thread
From: Johan Hovold @ 2026-09-29 12:25 UTC (permalink / raw)
To: Liviu Nicoara
Cc: Srinivas Kandagatla, Mark Brown, Liam Girdwood, Jaroslav Kysela,
Takashi Iwai, Jonathan Marek, linux-sound, linux-arm-msm,
linux-kernel, stable
On Tue, Sep 29, 2026 at 07:57:55AM -0400, Liviu Nicoara wrote:
> Commit 902f497a1ff5 ("ASoC: codecs: lpass-wsa-macro: remove useless
> gain read/write sequence") removed the read and write of the digital
> volume register in wsa_macro_enable_interpolator(), on the grounds that
> writing back the value just read does nothing. The comment above it,
> "apply gain after int clk is enabled", was left in place.
>
> On the Dell XPS 13 9345 (X1E80100, four WSA8845 amplifiers on two WSA
> macros) the write does something: a volume change made while the path
> is idle does not take effect when playback starts. Lowering the digital
> volume from 81 to 63 with nothing playing, then playing a test tone,
> gave about the same level as before the change. With the rewrite
> restored, lowering it from 81 to 69 while idle played audibly quieter,
> and restoring 81 while idle brought the level back. Changes made during
> playback take effect with or without the rewrite.
>
> The register already holds the new value when this happens. Without the
> rewrite, after an idle change from 69 to 81, playback stayed at the old
> level while the register, read from the hardware through /dev/mem, held
> the new one (0xfd). Writing that same value back through /dev/mem
> brought the level up at once.
>
> This is the behaviour described in commit 46188db080bd ("ASoC: codecs:
> lpass-wsa-macro: fix compander volume hack"): "the volume registers
> still need to be written after enabling clocks in order for any prior
> updates to take effect." The value read comes from the register cache,
> so the write pushes the last requested volume to the hardware once its
> clock runs.
>
> Restore the rewrite in the interpolator's POST_PMU event only. The mix
> path event removed later in the same series is not brought back.
>
> Fixes: 902f497a1ff5 ("ASoC: codecs: lpass-wsa-macro: remove useless gain read/write sequence")
> Cc: stable@vger.kernel.org
> Assisted-by: Claude:claude-opus-5-5
> Signed-off-by: Liviu Nicoara <lnicoara@thinkoid.org>
> ---
>
> Notes:
> Changes in v2:
> - Cc stable (Johan Hovold).
> - Add the /dev/mem read and rewrite from the v1 review.
> - Link to v1: https://lore.kernel.org/all/20260924125940.22665-1-lnicoara@thinkoid.org/
>
> Tested on v7.2.6 on the machine above, by listening. This function is
> unchanged between v7.2 and for-next; the driver's clocks moved to the
> PM clock framework in cd054a6e272c after v7.2, which was not tested
> here. Build-tested on broonie/for-next (arm64 defconfig).
Thanks for the v2.
Reviewed-by: Johan Hovold <johan@kernel.org>
Johan
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2] ASoC: codecs: lpass-wsa-macro: rewrite the interpolator volume after enabling clocks
2026-09-29 11:57 [PATCH v2] ASoC: codecs: lpass-wsa-macro: rewrite the interpolator volume after enabling clocks Liviu Nicoara
2026-09-29 12:25 ` Johan Hovold
@ 2026-09-29 13:09 ` Mark Brown
1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2026-09-29 13:09 UTC (permalink / raw)
To: Srinivas Kandagatla, Liam Girdwood, Liviu Nicoara
Cc: Jaroslav Kysela, Takashi Iwai, Jonathan Marek, Johan Hovold,
linux-sound, linux-arm-msm, linux-kernel, stable
On Tue, 29 Sep 2026 07:57:55 -0400, Liviu Nicoara wrote:
> ASoC: codecs: lpass-wsa-macro: rewrite the interpolator volume after enabling clocks
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-7.3
Thanks!
[1/1] ASoC: codecs: lpass-wsa-macro: rewrite the interpolator volume after enabling clocks
https://git.kernel.org/broonie/sound/c/b2047b8cadad
All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying
to this mail.
Thanks,
Mark
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-09-29 13:53 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-29 11:57 [PATCH v2] ASoC: codecs: lpass-wsa-macro: rewrite the interpolator volume after enabling clocks Liviu Nicoara
2026-09-29 12:25 ` Johan Hovold
2026-09-29 13:09 ` Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®