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>
This commit is contained in:
Marcin Rajwa 2020-05-15 16:59:52 +03:00 committed by Mark Brown
parent c26fde3b15
commit 3541aef1b8
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0
2 changed files with 10 additions and 0 deletions

View File

@ -256,6 +256,15 @@ static int sof_suspend(struct device *dev, bool runtime_suspend)
return ret; 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) int snd_sof_runtime_suspend(struct device *dev)
{ {
return sof_suspend(dev, true); return sof_suspend(dev, true);

View File

@ -453,6 +453,7 @@ int snd_sof_runtime_resume(struct device *dev);
int snd_sof_runtime_idle(struct device *dev); int snd_sof_runtime_idle(struct device *dev);
int snd_sof_resume(struct device *dev); int snd_sof_resume(struct device *dev);
int snd_sof_suspend(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); int snd_sof_prepare(struct device *dev);
void snd_sof_complete(struct device *dev); void snd_sof_complete(struct device *dev);