Skip to content

Commit 17c6bf4

Browse files
rriveramcrusbroonie
authored andcommitted
ASoC: cs35l45: Hibernate wm_adsp on runtime suspend
When the CS35L45 driver suspends, it is put into hibernation, and the regmap goes into cache_only, but the firmware is still running, and wm_adsp is not stopped. If userspace attempts to read a firmware control, it will perform a regmap_raw_read() and this will produce an error in the kernel log. To prevent spurious errors, put the DSP into hibernation which prevents access to the hardware for the ALSA controls. Signed-off-by: Ricardo Rivera-Matos <rriveram@opensource.cirrus.com> Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com> Link: https://patch.msgid.link/20260224161821.93365-5-sbinding@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 4d80c0d commit 17c6bf4

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

sound/soc/codecs/cs35l45.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -984,6 +984,7 @@ static int cs35l45_runtime_suspend(struct device *dev)
984984
if (!cs35l45->dsp.preloaded || !cs35l45->dsp.cs_dsp.running)
985985
return 0;
986986

987+
wm_adsp_hibernate(&cs35l45->dsp, true);
987988
cs35l45_enter_hibernate(cs35l45);
988989

989990
regcache_cache_only(cs35l45->regmap, true);
@@ -1014,6 +1015,8 @@ static int cs35l45_runtime_resume(struct device *dev)
10141015
if (ret != 0)
10151016
dev_warn(cs35l45->dev, "regcache_sync failed: %d\n", ret);
10161017

1018+
wm_adsp_hibernate(&cs35l45->dsp, false);
1019+
10171020
/* Clear global error status */
10181021
regmap_clear_bits(cs35l45->regmap, CS35L45_ERROR_RELEASE, CS35L45_GLOBAL_ERR_RLS_MASK);
10191022
regmap_set_bits(cs35l45->regmap, CS35L45_ERROR_RELEASE, CS35L45_GLOBAL_ERR_RLS_MASK);

0 commit comments

Comments
 (0)