diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2011-08-17 03:20:01 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-08-17 03:22:09 -0400 |
commit | 25b7679136fd85b1e5197e36a0ca126163e89590 (patch) | |
tree | 9b7520e60fd332a5b52047427e732c23f23dbbc6 /sound/soc | |
parent | 0cc62e926324d4f3bd02d378baafbe73164fca35 (diff) |
ASoC: Fix check for symmetric rate enforcement
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>
Diffstat (limited to 'sound/soc')
-rw-r--r-- | sound/soc/soc-pcm.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c index b5759397afa3..2879c883eebc 100644 --- a/sound/soc/soc-pcm.c +++ b/sound/soc/soc-pcm.c | |||
@@ -290,6 +290,9 @@ static int soc_pcm_close(struct snd_pcm_substream *substream) | |||
290 | codec_dai->active--; | 290 | codec_dai->active--; |
291 | codec->active--; | 291 | codec->active--; |
292 | 292 | ||
293 | if (!cpu_dai->active && !codec_dai->active) | ||
294 | rtd->rate = 0; | ||
295 | |||
293 | /* Muting the DAC suppresses artifacts caused during digital | 296 | /* Muting the DAC suppresses artifacts caused during digital |
294 | * shutdown, for example from stopping clocks. | 297 | * shutdown, for example from stopping clocks. |
295 | */ | 298 | */ |