Skip to content

Commit 3541aef

Browse files
mrajwabroonie
authored andcommitted
ASoC: SOF: add a power_down_notify method
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@linux.intel.com> Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Link: https://lore.kernel.org/r/20200515135958.17511-3-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent c26fde3 commit 3541aef

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

‎sound/soc/sof/pm.c‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,15 @@ static int sof_suspend(struct device *dev, bool runtime_suspend)
256256
return ret;
257257
}
258258

259+
int snd_sof_dsp_power_down_notify(struct snd_sof_dev *sdev)
260+
{
261+
/* Notify DSP of upcoming power down */
262+
if (sof_ops(sdev)->remove)
263+
return sof_send_pm_ctx_ipc(sdev, SOF_IPC_PM_CTX_SAVE);
264+
265+
return 0;
266+
}
267+
259268
int snd_sof_runtime_suspend(struct device *dev)
260269
{
261270
return sof_suspend(dev, true);

‎sound/soc/sof/sof-priv.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -453,6 +453,7 @@ int snd_sof_runtime_resume(struct device *dev);
453453
int snd_sof_runtime_idle(struct device *dev);
454454
int snd_sof_resume(struct device *dev);
455455
int snd_sof_suspend(struct device *dev);
456+
int snd_sof_dsp_power_down_notify(struct snd_sof_dev *sdev);
456457
int snd_sof_prepare(struct device *dev);
457458
void snd_sof_complete(struct device *dev);
458459

0 commit comments

Comments
 (0)