ASoC: compress: Only mute playback streams
authorMark Brown <broonie@opensource.wolfsonmicro.com>
Wed, 6 Feb 2013 13:52:42 +0000 (13:52 +0000)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Thu, 7 Feb 2013 18:41:50 +0000 (18:41 +0000)
Otherwise capture activity on a compressed DAI would mute any playback
on the same DAI.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Acked-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
sound/soc/soc-compress.c

index c81aeecec93677757642df341a65ba05bb70a135..35726cbf1f0215a0f3611ebe36c7c81e31fc6454 100644 (file)
@@ -116,13 +116,12 @@ static int soc_compr_free(struct snd_compr_stream *cstream)
        if (cstream->direction == SND_COMPRESS_PLAYBACK) {
                cpu_dai->playback_active--;
                codec_dai->playback_active--;
+               snd_soc_dai_digital_mute(codec_dai, 1);
        } else {
                cpu_dai->capture_active--;
                codec_dai->capture_active--;
        }
 
-       snd_soc_dai_digital_mute(codec_dai, 1);
-
        cpu_dai->active--;
        codec_dai->active--;
        codec->active--;
@@ -179,10 +178,16 @@ static int soc_compr_trigger(struct snd_compr_stream *cstream, int cmd)
                        goto out;
        }
 
-       if (cmd == SNDRV_PCM_TRIGGER_START)
-               snd_soc_dai_digital_mute(codec_dai, 0);
-       else if (cmd == SNDRV_PCM_TRIGGER_STOP)
-               snd_soc_dai_digital_mute(codec_dai, 1);
+       if (cstream->direction == SND_COMPRESS_PLAYBACK) {
+               switch (cmd) {
+               case SNDRV_PCM_TRIGGER_START:
+                       snd_soc_dai_digital_mute(codec_dai, 0);
+                       break;
+               case SNDRV_PCM_TRIGGER_STOP:
+                       snd_soc_dai_digital_mute(codec_dai, 1);
+                       break;
+               }
+       }
 
 out:
        mutex_unlock(&rtd->pcm_mutex);