Skip to content

Commit 4d80c0d

Browse files
Stefan Bindingbroonie
authored andcommitted
ASoC: cs35l41: Hibernate wm_adsp on runtime suspend
When the CS35L41 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: Stefan Binding <sbinding@opensource.cirrus.com> Link: https://patch.msgid.link/20260224161821.93365-4-sbinding@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 6394a52 commit 4d80c0d

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

sound/soc/codecs/cs35l41.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1404,6 +1404,7 @@ static int cs35l41_runtime_suspend(struct device *dev)
14041404
if (!cs35l41->dsp.preloaded || !cs35l41->dsp.cs_dsp.running)
14051405
return 0;
14061406

1407+
wm_adsp_hibernate(&cs35l41->dsp, true);
14071408
cs35l41_enter_hibernate(dev, cs35l41->regmap, cs35l41->hw_cfg.bst_type);
14081409

14091410
regcache_cache_only(cs35l41->regmap, true);
@@ -1432,10 +1433,14 @@ static int cs35l41_runtime_resume(struct device *dev)
14321433
cs35l41_test_key_unlock(cs35l41->dev, cs35l41->regmap);
14331434
ret = regcache_sync(cs35l41->regmap);
14341435
cs35l41_test_key_lock(cs35l41->dev, cs35l41->regmap);
1436+
1437+
wm_adsp_hibernate(&cs35l41->dsp, false);
1438+
14351439
if (ret) {
14361440
dev_err(cs35l41->dev, "Failed to restore register cache: %d\n", ret);
14371441
return ret;
14381442
}
1443+
14391444
cs35l41_init_boost(cs35l41->dev, cs35l41->regmap, &cs35l41->hw_cfg);
14401445

14411446
return 0;

0 commit comments

Comments
 (0)