Commit 60125286 authored by Keyon Jie's avatar Keyon Jie Committed by Mark Brown

ASoC: SOF: PM: add helpers for setting D0 substate for ADSP

Add snd_sof_set_d0_substate() helper for setting ADSP to a specific D0
substate, it will call into the platform specific implementation, and
update the d0_substate at success.
Signed-off-by: default avatarKeyon Jie <yang.jie@linux.intel.com>
Signed-off-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20191025224122.7718-18-pierre-louis.bossart@linux.intel.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 534037fd
......@@ -411,6 +411,23 @@ int snd_sof_runtime_resume(struct device *dev)
}
EXPORT_SYMBOL(snd_sof_runtime_resume);
int snd_sof_set_d0_substate(struct snd_sof_dev *sdev,
enum sof_d0_substate d0_substate)
{
int ret;
/* do platform specific set_state */
ret = snd_sof_dsp_set_power_state(sdev, d0_substate);
if (ret < 0)
return ret;
/* update dsp D0 sub-state */
sdev->d0_substate = d0_substate;
return 0;
}
EXPORT_SYMBOL(snd_sof_set_d0_substate);
int snd_sof_resume(struct device *dev)
{
return sof_resume(dev, false);
......
......@@ -485,6 +485,8 @@ 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_set_d0_substate(struct snd_sof_dev *sdev,
enum sof_d0_substate d0_substate);
void snd_sof_new_platform_drv(struct snd_sof_dev *sdev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment