[ALSA] soc - Add D1 power event to power down event sequence
authorLiam Girdwood <lg@opensource.wolfsonmicro.com>
Thu, 10 Jan 2008 13:38:24 +0000 (14:38 +0100)
committerJaroslav Kysela <perex@perex.cz>
Thu, 31 Jan 2008 16:29:50 +0000 (17:29 +0100)
Signed-off-by: Liam Girdwood <lg@opensource.wolfsonmicro.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
sound/soc/soc-core.c

index e748b00466b786de8ad6397d6be022dd45b98dea..7d51be8ee069c6e1779f20f150afdf3482a5c170 100644 (file)
@@ -287,6 +287,14 @@ static void close_delayed_work(struct work_struct *work)
                /* are we waiting on this codec DAI stream */
                if (codec_dai->pop_wait == 1) {
 
+                       /* power down the codec to D1 if no longer active */
+                       if (codec->active == 0) {
+                               dbg("pop wq D1 %s %s\n", codec->name,
+                                       codec_dai->playback.stream_name);
+                               snd_soc_dapm_device_event(socdev,
+                                       SNDRV_CTL_POWER_D1);
+                       }
+
                        codec_dai->pop_wait = 0;
                        snd_soc_dapm_stream_event(codec,
                                codec_dai->playback.stream_name,