From: Patrick Lai Date: Sun, 1 Jan 2017 06:44:39 +0000 (-0800) Subject: ASoC: dpcm: Avoid putting stream state to STOP when FE stream is paused X-Git-Tag: v4.9.41~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=007dffc661cf20f9e924eccc7b161ce2419ba81b;p=platform%2Fkernel%2Flinux-amlogic.git ASoC: dpcm: Avoid putting stream state to STOP when FE stream is paused [ Upstream commit 9f169b9f52a4afccdab7a7d2311b0c53a78a1e6b ] When multiple front-ends are using the same back-end, putting state of a front-end to STOP state upon receiving pause command will result in backend stream getting released by DPCM framework unintentionally. In order to avoid backend to be released when another active front-end stream is present, put the stream state to PAUSED state instead of STOP state. Signed-off-by: Patrick Lai Signed-off-by: Mark Brown Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c index d56a16a..21c3ef0 100644 --- a/sound/soc/soc-pcm.c +++ b/sound/soc/soc-pcm.c @@ -2184,9 +2184,11 @@ static int dpcm_fe_dai_do_trigger(struct snd_pcm_substream *substream, int cmd) break; case SNDRV_PCM_TRIGGER_STOP: case SNDRV_PCM_TRIGGER_SUSPEND: - case SNDRV_PCM_TRIGGER_PAUSE_PUSH: fe->dpcm[stream].state = SND_SOC_DPCM_STATE_STOP; break; + case SNDRV_PCM_TRIGGER_PAUSE_PUSH: + fe->dpcm[stream].state = SND_SOC_DPCM_STATE_PAUSED; + break; } out: