[PATCH 2/8] ASoC: SOF: add a power_down_notify method
Kai Vehmanen
kai.vehmanen at linux.intel.com
Fri May 15 15:59:52 CEST 2020
From: Marcin Rajwa <marcin.rajwa at linux.intel.com>
This patch adds a snd_sof_dsp_power_down_notify() method which aims to
prepare the DSP for the upcoming power down.
This new function make use of SOF_IPC_PM_CTX_SAVE message.
Signed-off-by: Marcin Rajwa <marcin.rajwa at linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan at linux.intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen at linux.intel.com>
---
sound/soc/sof/pm.c | 9 +++++++++
sound/soc/sof/sof-priv.h | 1 +
2 files changed, 10 insertions(+)
diff --git a/sound/soc/sof/pm.c b/sound/soc/sof/pm.c
index 119e4d644ef4..5e804a7728f5 100644
--- a/sound/soc/sof/pm.c
+++ b/sound/soc/sof/pm.c
@@ -256,6 +256,15 @@ static int sof_suspend(struct device *dev, bool runtime_suspend)
return ret;
}
+int snd_sof_dsp_power_down_notify(struct snd_sof_dev *sdev)
+{
+ /* Notify DSP of upcoming power down */
+ if (sof_ops(sdev)->remove)
+ return sof_send_pm_ctx_ipc(sdev, SOF_IPC_PM_CTX_SAVE);
+
+ return 0;
+}
+
int snd_sof_runtime_suspend(struct device *dev)
{
return sof_suspend(dev, true);
diff --git a/sound/soc/sof/sof-priv.h b/sound/soc/sof/sof-priv.h
index a34dbae9f971..3ed39b887214 100644
--- a/sound/soc/sof/sof-priv.h
+++ b/sound/soc/sof/sof-priv.h
@@ -453,6 +453,7 @@ int snd_sof_runtime_resume(struct device *dev);
int snd_sof_runtime_idle(struct device *dev);
int snd_sof_resume(struct device *dev);
int snd_sof_suspend(struct device *dev);
+int snd_sof_dsp_power_down_notify(struct snd_sof_dev *sdev);
int snd_sof_prepare(struct device *dev);
void snd_sof_complete(struct device *dev);
--
2.26.0
More information about the Alsa-devel
mailing list