summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolin Chen <b42378@freescale.com>2013-07-18 20:05:07 +0800
committerNicolin Chen <b42378@freescale.com>2013-07-19 10:51:10 +0800
commit17aaed1ef4f7dee39cd6df75e0bf6f8f2bc1c8c1 (patch)
treea343d0446137a90a92d29145cda5c0d7f2b84497
parentd875e36721642f687548058c168654e803e72520 (diff)
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 <s.hauer@pengutronix.de> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Nicolin Chen <b42378@freescale.com>
-rw-r--r--sound/soc/soc-core.c3
1 files changed, 3 insertions, 0 deletions
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.
*/