Skip to content

Commit 56852cf

Browse files
charleskeepaxbroonie
authored andcommitted
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 4e7c3cd commit 56852cf

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

sound/soc/codecs/cs35l41.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -181,17 +181,21 @@ static SOC_ENUM_SINGLE_DECL(pcm_sft_ramp,
181181
static int cs35l41_dsp_preload_ev(struct snd_soc_dapm_widget *w,
182182
struct snd_kcontrol *kcontrol, int event)
183183
{
184+
struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm);
185+
struct cs35l41_private *cs35l41 = snd_soc_component_get_drvdata(component);
184186
int ret;
185187

186188
switch (event) {
187189
case SND_SOC_DAPM_PRE_PMU:
188190
return wm_adsp_early_event(w, kcontrol, event);
189191
case SND_SOC_DAPM_PRE_PMD:
190-
ret = wm_adsp_early_event(w, kcontrol, event);
191-
if (ret)
192-
return ret;
192+
if (cs35l41->dsp.cs_dsp.running) {
193+
ret = wm_adsp_event(w, kcontrol, event);
194+
if (ret)
195+
return ret;
196+
}
193197

194-
return wm_adsp_event(w, kcontrol, event);
198+
return wm_adsp_early_event(w, kcontrol, event);
195199
default:
196200
return 0;
197201
}

0 commit comments

Comments
 (0)