From: Nicolin Chen Date: Thu, 18 Jul 2013 12:05:07 +0000 (+0800) Subject: ENGR00271718 ASoC: Fix check for symmetric rate enforcement X-Git-Tag: v3.0.35-fsl_4.1.0~19 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=3ce9f1022e7b6d34350e2e786c7f89f0bbf318e6;p=karo-tx-linux.git ENGR00271718 ASoC: Fix check for symmetric rate enforcement This patch is copied from commit 25b7679136fd85b1e5197e36a0ca126163e89590 Just unable to cherry-pick due to different file names. The ASoC core tries to not enforce symmetric rates when two streams open simultaneously. It does so by checking rtd->rate being zero. This works exactly once after booting because it is not set to zero again when the streams close. Fix this by setting rtd->rate when no active stream is left. [This leads to lots of warnings about not enforcing the symmetry in some situations as there's a race in the userspace API where we know we've got two applications but don't know what rates they want to set. -- broonie ] Signed-off-by: Sascha Hauer Signed-off-by: Mark Brown Signed-off-by: Nicolin Chen --- diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index e62ad5ffce66..b3ab124652be 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -748,6 +748,9 @@ static int soc_codec_close(struct snd_pcm_substream *substream) codec_dai->active--; codec->active--; + if (!cpu_dai->active && !codec_dai->active) + rtd->rate = 0; + /* Muting the DAC suppresses artifacts caused during digital * shutdown, for example from stopping clocks. */