[alsa-devel] [PATCH 11/12] ASoC: AMD: add suspend/resume for ACP PCM driver

Alex Deucher alexdeucher at gmail.com
Thu Aug 6 16:25:11 CEST 2015


From: Maruthi Srinivas Bayyavarapu <Maruthi.Bayyavarapu at amd.com>

Added suspend/resume functionality for AMD ACP ASoC PCM driver.
Enabled them in the ASoC machine driver

Signed-off-by: Maruthi Bayyavarapu <maruthi.bayyavarapu at amd.com>
Reviewed-by: Alex Deucher <alexander.deucher at amd.com>
Reviewed-by: Murali Krishna Vemuri <murali-krishna.vemuri at amd.com>
---
 sound/soc/amd/acp-pcm-dma.c | 31 +++++++++++++++++++++++++++++++
 sound/soc/amd/acp-rt286.c   |  1 -
 2 files changed, 31 insertions(+), 1 deletion(-)

diff --git a/sound/soc/amd/acp-pcm-dma.c b/sound/soc/amd/acp-pcm-dma.c
index 0f58957..db09b77 100644
--- a/sound/soc/amd/acp-pcm-dma.c
+++ b/sound/soc/amd/acp-pcm-dma.c
@@ -625,11 +625,42 @@ static int acp_amdsoc_remove(struct amd_gnb_bus_dev *adev)
 	return 0;
 }
 
+static int acp_pcm_suspend(struct device *dev)
+{
+	return 0;
+}
+
+static int acp_pcm_resume(struct device *dev)
+{
+	struct snd_pcm_substream *substream;
+	struct snd_pcm_runtime *runtime;
+	struct audio_substream_data *rtd;
+
+	struct audio_drv_data *irq_data =
+	    (struct audio_drv_data *)dev_get_drvdata(dev);
+
+	substream = irq_data->play_stream;
+	runtime = substream->runtime;
+	rtd = runtime->private_data;
+
+	irq_data->acp_dev->config_i2s(irq_data->acp_dev, rtd->i2s_config);
+	irq_data->acp_dev->config_dma(irq_data->acp_dev, rtd->dma_config);
+
+	return 0;
+}
+
+static const struct dev_pm_ops acp_pm_ops = {
+	SET_SYSTEM_SLEEP_PM_OPS(acp_pcm_suspend, acp_pcm_resume)
+};
+
 static struct amd_gnb_bus_driver acp_dma_driver = {
 	.name = "acp-pcm-driver",
 	.ip = AMD_GNB_IP_ACP_PCM,
 	.probe = acp_amdsoc_probe,
 	.remove = acp_amdsoc_remove,
+	.driver = {
+		.pm = &acp_pm_ops,
+	},
 };
 
 static int __init amdsoc_bus_acp_dma_driver_init(void)
diff --git a/sound/soc/amd/acp-rt286.c b/sound/soc/amd/acp-rt286.c
index 7d4bdf9..8be9236 100644
--- a/sound/soc/amd/acp-rt286.c
+++ b/sound/soc/amd/acp-rt286.c
@@ -129,7 +129,6 @@ static struct snd_soc_dai_link carrizo_dai_rt286 = {
 	.codec_name = "rt286.3-001c",
 	.dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF
 			| SND_SOC_DAIFMT_CBM_CFM,
-	.ignore_suspend = 1,
 	.ops = &carrizo_rt286_ops,
 	.init = carrizo_init,
 };
-- 
1.8.3.1



More information about the Alsa-devel mailing list