[PATCH] Ensure PCMs are suspended

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Liam Girdwood <liam@xxxxxxxxxxxxxxxxxxxxx>

This fixes a bug whereby PCMs were not being suspended when the rest of the
audio subsystem was suspended.
---
 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 c69b58c..e32fa2f 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -448,6 +448,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 f3e1b74..7c41212 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -646,6 +646,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);
 
@@ -880,6 +884,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;
-- 
1.5.3.5

_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux