]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ENGR00271718 ASoC: Fix check for symmetric rate enforcement
authorNicolin Chen <b42378@freescale.com>
Thu, 18 Jul 2013 12:05:07 +0000 (20:05 +0800)
committerOliver Wendt <ow@karo-electronics.de>
Mon, 30 Sep 2013 12:14:15 +0000 (14:14 +0200)
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>
sound/soc/soc-core.c

index e62ad5ffce6641e439c58a13405a9f07a37310d9..b3ab124652bea666ce7b054ddca9c938ddb2444f 100644 (file)
@@ -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.
         */