[ALSA] soc - Ensure PCMs are suspended
authorLiam Girdwood <lg@opensource.wolfsonmicro.com>
Thu, 10 Jan 2008 13:39:01 +0000 (14:39 +0100)
committerJaroslav Kysela <perex@perex.cz>
Thu, 31 Jan 2008 16:29:50 +0000 (17:29 +0100)
This fixes a bug whereby PCMs were not being suspended when the rest of the
audio subsystem was suspended.

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>
include/sound/soc.h
sound/soc/soc-core.c

index 0afcdfe42a466af40cc02027f0d4ac156a54b3ee..6b51ff2269b482e1d50c08f2b99c9fdc1f4bd418 100644 (file)
@@ -447,6 +447,9 @@ struct snd_soc_dai_link  {
 
        /* codec/machine specific init - e.g. add machine controls */
        int (*init)(struct snd_soc_codec *codec);
+
+       /* DAI pcm */
+       struct snd_pcm *pcm;
 };
 
 /* SoC machine */
index 7d51be8ee069c6e1779f20f150afdf3482a5c170..5f86e033098f32652f442905a134a2afc9813706 100644 (file)
@@ -645,6 +645,10 @@ static int soc_suspend(struct platform_device *pdev, pm_message_t state)
                        dai->dai_ops.digital_mute(dai, 1);
        }
 
+       /* suspend all pcms */
+       for (i = 0; i < machine->num_links; i++)
+               snd_pcm_suspend_all(machine->dai_link[i].pcm);
+
        if (machine->suspend_pre)
                machine->suspend_pre(pdev, state);
 
@@ -879,6 +883,7 @@ static int soc_new_pcm(struct snd_soc_device *socdev,
                return ret;
        }
 
+       dai_link->pcm = pcm;
        pcm->private_data = rtd;
        soc_pcm_ops.mmap = socdev->platform->pcm_ops->mmap;
        soc_pcm_ops.pointer = socdev->platform->pcm_ops->pointer;