ASoC: pcm: If pmdown_time is zero then shut down DAPM immediately
authorMark Brown <broonie@opensource.wolfsonmicro.com>
Wed, 8 Feb 2012 20:10:56 +0000 (20:10 +0000)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Thu, 9 Feb 2012 10:42:55 +0000 (10:42 +0000)
Since we've already got logic to special case immediate teardown of the
stream we may as well use it if the pmdown_time has been set to zero by
the application layer instead of scheduling a work item with zero delay.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
sound/soc/soc-pcm.c

index 121318defea3a1c1f1276f98b1a294863a01f028..15816eccad34611714105413fd510a3983f505a3 100644 (file)
@@ -369,7 +369,7 @@ static int soc_pcm_close(struct snd_pcm_substream *substream)
        cpu_dai->runtime = NULL;
 
        if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
-               if (codec->ignore_pmdown_time ||
+               if (!rtd->pmdown_time || codec->ignore_pmdown_time ||
                    rtd->dai_link->ignore_pmdown_time) {
                        /* powered down playback stream now */
                        snd_soc_dapm_stream_event(rtd,