]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
ASoC: cs35l41: Hibernate wm_adsp on runtime suspend
authorStefan Binding <sbinding@opensource.cirrus.com>
Tue, 24 Feb 2026 16:18:07 +0000 (16:18 +0000)
committerMark Brown <broonie@kernel.org>
Sun, 1 Mar 2026 23:48:39 +0000 (23:48 +0000)
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>
sound/soc/codecs/cs35l41.c

index ee56dfceedeb0abcf00bc8cedc4c81cf086a3a85..b2a076706c796e302aa9cf4c6016d7ad53bde3c2 100644 (file)
@@ -1404,6 +1404,7 @@ static int cs35l41_runtime_suspend(struct device *dev)
        if (!cs35l41->dsp.preloaded || !cs35l41->dsp.cs_dsp.running)
                return 0;
 
+       wm_adsp_hibernate(&cs35l41->dsp, true);
        cs35l41_enter_hibernate(dev, cs35l41->regmap, cs35l41->hw_cfg.bst_type);
 
        regcache_cache_only(cs35l41->regmap, true);
@@ -1432,10 +1433,14 @@ static int cs35l41_runtime_resume(struct device *dev)
        cs35l41_test_key_unlock(cs35l41->dev, cs35l41->regmap);
        ret = regcache_sync(cs35l41->regmap);
        cs35l41_test_key_lock(cs35l41->dev, cs35l41->regmap);
+
+       wm_adsp_hibernate(&cs35l41->dsp, false);
+
        if (ret) {
                dev_err(cs35l41->dev, "Failed to restore register cache: %d\n", ret);
                return ret;
        }
+
        cs35l41_init_boost(cs35l41->dev, cs35l41->regmap, &cs35l41->hw_cfg);
 
        return 0;