From a63c3797c5e398312e9cfe2550a8c68118e0dca6 Mon Sep 17 00:00:00 2001 From: Satish Babu Patakokila Date: Thu, 27 Aug 2020 17:42:38 +0530 Subject: [PATCH] ASoC: soc-pcm: Fix playback shutdown sequence Change closes the frontend pcm substream followed by the backend substream to ensure correct playback shutdown sequence. Change-Id: Ie8e62487ce9efd08eb24326850c33fbb9d5f62a1 Signed-off-by: Satish Babu Patakokila --- sound/soc/soc-pcm.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c index 322e9c2dc19b..e97da9d17818 100644 --- a/sound/soc/soc-pcm.c +++ b/sound/soc/soc-pcm.c @@ -2113,6 +2113,15 @@ static int dpcm_fe_dai_shutdown(struct snd_pcm_substream *substream) dpcm_set_fe_update_state(fe, stream, SND_SOC_DPCM_UPDATE_FE); +#ifdef CONFIG_AUDIO_QGKI + dev_dbg(fe->dev, "ASoC: close FE %s\n", fe->dai_link->name); + + /* now shutdown the frontend */ + soc_pcm_close(substream); + + /* shutdown the BEs */ + dpcm_be_dai_shutdown(fe, substream->stream); +#else /* shutdown the BEs */ dpcm_be_dai_shutdown(fe, substream->stream); @@ -2120,6 +2129,7 @@ static int dpcm_fe_dai_shutdown(struct snd_pcm_substream *substream) /* now shutdown the frontend */ soc_pcm_close(substream); +#endif /* run the stream event for each BE */ dpcm_dapm_stream_event(fe, stream, SND_SOC_DAPM_STREAM_STOP);