* [PATCH] ALSA: hda: cs35l56: Volume/Posture controls don't need to wait for dsp_work
@ 2026-12-01 11:16 Richard Fitzgerald
0 siblings, 0 replies; only message in thread
From: Richard Fitzgerald @ 2026-12-01 11:16 UTC (permalink / raw)
To: tiwai; +Cc: linux-sound, linux-kernel, patches
Delete the calls to cs35l56_hda_wait_dsp_ready() in the get/put handlers
for the Volume and Posture controls. This wait isn't necessary now.
The original reason for the wait in the get/put handlers was that the
downloaded firmware can patch the registers to non-default values. To
avoid the regmap cache getting out-of-sync with the actual register
value, the ASoC driver fixed up the regmap content at the end of
firmware download. This meant that control get/put had to wait for
firmware download to complete. The HDA driver never had this fixup code
so never needed the wait.
Commit df4167d658d4 ("ASoC: cs35l56: Patch soft registers to defaults")
already removed this fix-up code in the ASoC driver, and instead used
the regmap patch to set volume and posture registers to a default of zero.
When HDA driver firmware download was moved to a workqueue in
commit 634f3b4e7dde ("ALSA: hda: cs35l56: Perform firmware download in the
background") the wait was added to the get/put handlers, copying the
behaviour of the ASoC driver. But this was unnecessary and the equivalent
wait has been removed from the ASoC driver.
When the amp is rebooted after a firmware download, cs35l56_system_reset()
puts the regmap in cache-only and this is only released after the amp has
rebooted. The regcache_sync() near the end of cs35l56_hda_fw_load() will
overwrite the volume and posture registers with the values from the regmap
patch and then write out any non-default cached values.
That means it is safe for the Volume and Posture controls to read/write
regmap any time.
Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
---
sound/hda/codecs/side-codecs/cs35l56_hda.c | 8 --------
1 file changed, 8 deletions(-)
diff --git a/sound/hda/codecs/side-codecs/cs35l56_hda.c b/sound/hda/codecs/side-codecs/cs35l56_hda.c
index 5982eebae152..ba0872ec7c65 100644
--- a/sound/hda/codecs/side-codecs/cs35l56_hda.c
+++ b/sound/hda/codecs/side-codecs/cs35l56_hda.c
@@ -242,8 +242,6 @@ static int cs35l56_hda_posture_get(struct snd_kcontrol *kcontrol,
unsigned int pos;
int ret;
- cs35l56_hda_wait_dsp_ready(cs35l56);
-
ret = regmap_read(cs35l56->base.regmap,
cs35l56->base.fw_reg->posture_number, &pos);
if (ret)
@@ -266,8 +264,6 @@ static int cs35l56_hda_posture_put(struct snd_kcontrol *kcontrol,
(pos > CS35L56_MAIN_POSTURE_MAX))
return -EINVAL;
- cs35l56_hda_wait_dsp_ready(cs35l56);
-
ret = regmap_update_bits_check(cs35l56->base.regmap, cs35l56->base.fw_reg->posture_number,
CS35L56_MAIN_POSTURE_MASK, pos, &changed);
if (ret)
@@ -309,8 +305,6 @@ static int cs35l56_hda_vol_get(struct snd_kcontrol *kcontrol,
int vol;
int ret;
- cs35l56_hda_wait_dsp_ready(cs35l56);
-
ret = regmap_read(cs35l56->base.regmap, cs35l56->base.fw_reg->user_volume, &raw_vol);
if (ret)
@@ -343,8 +337,6 @@ static int cs35l56_hda_vol_put(struct snd_kcontrol *kcontrol,
raw_vol = (vol + CS35L56_MAIN_RENDER_USER_VOLUME_MIN) <<
CS35L56_MAIN_RENDER_USER_VOLUME_SHIFT;
- cs35l56_hda_wait_dsp_ready(cs35l56);
-
ret = regmap_update_bits_check(cs35l56->base.regmap, cs35l56->base.fw_reg->user_volume,
CS35L56_MAIN_RENDER_USER_VOLUME_MASK, raw_vol, &changed);
if (ret)
--
2.47.3
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-12-01 11:16 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-01 11:16 [PATCH] ALSA: hda: cs35l56: Volume/Posture controls don't need to wait for dsp_work Richard Fitzgerald
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox