Re: [PATCH] ASoC: codecs: lpass-wsa-macro: rewrite the interpolator volume after enabling clocks

From: Liviu Nicoara

Date: Thu Sep 24 2026 - 16:00:45 EST


On Thu, Sep 24, 2026 at 3:02 PM Jonathan Marek <jonathan@xxxxxxxx> wrote:
>
> this is just papering over the real problem, which would be the regmap
> cache being out of sync with the HW registers. there's no requirement
> that the volume register be written after the int/path clock enable
>
> (fwiw, this problem doesn't reproduce on my setup, where this driver
> does not autosuspend and the regmap doesn't go into cache-only mode)
>
>

Thanks for looking. I checked whether the cache and the hardware
disagree on this machine (v7.2.6, where the macro runtime-suspends after
3 s). With the macro suspended, I changed the digital volume from 81 to
69, which updates only the cache. I then forced a runtime resume, which
runs regcache_sync(), and read the volume register straight from the
hardware with the regmap debugfs cache_bypass: it held the new value
(0xf1).

However, on my unpatched driver an idle volume change did not take place
when playback starts (changed it from 69 to 81 and it played at 69). A
change done during playback though, takes effect at once. I don't think
anything writes the register in between.

The register holds the new value, but the path does not use it until it
is written with the interpolator clock running. The read/write-back that
902f497a1ff5 removed did exactly that; Johan kept it deliberately in
46188db080bd ("Note that the volume registers still need to be written
after enabling clocks in order for any prior updates to take
effect"). Unless I am reading it wrong.

On your setup, does a volume change made with no stream running take
effect when the next stream starts? If your changes land while the path
is active, that could explain why it does not reproduce there.

Thanks again.