Commit 56852cf4 authored by Charles Keepax's avatar Charles Keepax Committed by Mark Brown

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: default avatarCharles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20220105113026.18955-4-ckeepax@opensource.cirrus.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 4e7c3cd8
...@@ -181,17 +181,21 @@ static SOC_ENUM_SINGLE_DECL(pcm_sft_ramp, ...@@ -181,17 +181,21 @@ static SOC_ENUM_SINGLE_DECL(pcm_sft_ramp,
static int cs35l41_dsp_preload_ev(struct snd_soc_dapm_widget *w, static int cs35l41_dsp_preload_ev(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol, int event) 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; int ret;
switch (event) { switch (event) {
case SND_SOC_DAPM_PRE_PMU: case SND_SOC_DAPM_PRE_PMU:
return wm_adsp_early_event(w, kcontrol, event); return wm_adsp_early_event(w, kcontrol, event);
case SND_SOC_DAPM_PRE_PMD: case SND_SOC_DAPM_PRE_PMD:
ret = wm_adsp_early_event(w, kcontrol, event); if (cs35l41->dsp.cs_dsp.running) {
if (ret) ret = wm_adsp_event(w, kcontrol, event);
return ret; if (ret)
return ret;
}
return wm_adsp_event(w, kcontrol, event); return wm_adsp_early_event(w, kcontrol, event);
default: default:
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment