summaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/cs35l41.c
diff options
context:
space:
mode:
authorCharles Keepax <ckeepax@opensource.cirrus.com>2022-01-05 12:30:21 +0100
committerMark Brown <broonie@kernel.org>2022-01-05 14:53:51 +0100
commit56852cf4b2179fb90068a49538501f31c2de18ea (patch)
treefafd051fd78ec5f3d31a4e2a37f16203a78c6a8d /sound/soc/codecs/cs35l41.c
parentASoC: cs35l41: Remove incorrect comment (diff)
downloadlinux-56852cf4b2179fb90068a49538501f31c2de18ea.tar.xz
linux-56852cf4b2179fb90068a49538501f31c2de18ea.zip
ASoC: cs35l41: Correct DSP power down
The wm_adsp_event should be called before the early_event on power down, event stops the core running and early_event then powers down the core. Additionally, the core should only be stopped if it was actually running in the first place. Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://lore.kernel.org/r/20220105113026.18955-4-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/codecs/cs35l41.c')
-rw-r--r--sound/soc/codecs/cs35l41.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/sound/soc/codecs/cs35l41.c b/sound/soc/codecs/cs35l41.c
index 980294c1bcdb..05839fabf97b 100644
--- a/sound/soc/codecs/cs35l41.c
+++ b/sound/soc/codecs/cs35l41.c
@@ -181,17 +181,21 @@ static SOC_ENUM_SINGLE_DECL(pcm_sft_ramp,
static int cs35l41_dsp_preload_ev(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol, int event)
{
+ struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm);
+ struct cs35l41_private *cs35l41 = snd_soc_component_get_drvdata(component);
int ret;
switch (event) {
case SND_SOC_DAPM_PRE_PMU:
return wm_adsp_early_event(w, kcontrol, event);
case SND_SOC_DAPM_PRE_PMD:
- ret = wm_adsp_early_event(w, kcontrol, event);
- if (ret)
- return ret;
+ if (cs35l41->dsp.cs_dsp.running) {
+ ret = wm_adsp_event(w, kcontrol, event);
+ if (ret)
+ return ret;
+ }
- return wm_adsp_event(w, kcontrol, event);
+ return wm_adsp_early_event(w, kcontrol, event);
default:
return 0;
}