[ALSA] soc - Ensure PCMs are suspended

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linux Kernel Mailing List
Date: Thursday, January 31, 2008 - 5:02 pm

Gitweb:     http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=4ccab3...
Commit:     4ccab3e72e211c40d868045c7d3216948999bcf7
Parent:     3c1c47e0eb92264d555003ee2003f836e432615b
Author:     Liam Girdwood <lg@opensource.wolfsonmicro.com>
AuthorDate: Thu Jan 10 14:39:01 2008 +0100
Committer:  Jaroslav Kysela <perex@perex.cz>
CommitDate: Thu Jan 31 17:29:50 2008 +0100

    [ALSA] soc - Ensure PCMs are suspended
    
    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  |    3 +++
 sound/soc/soc-core.c |    5 +++++
 2 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/include/sound/soc.h b/include/sound/soc.h
index 0afcdfe..6b51ff2 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -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 */
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 7d51be8..5f86e03 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -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;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[ALSA] soc - Ensure PCMs are suspended, Linux Kernel Mailing ..., (Thu Jan 31, 5:02 pm)