Message ID | 20191025224122.7718-18-pierre-louis.bossart@linux.intel.com (mailing list archive) |
---|---|
State | Accepted |
Commit | 601252869f50af6f5ab377e7f4846d7b09cc66c0 |
Headers | show |
Series | ASoC: SOF: enable S0ix support for Intel platforms | expand |
On 2019-10-26 00:41, Pierre-Louis Bossart wrote: > +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); Are reason for not merging this directly with snd_sof_dsp_set_power_state?
diff --git a/sound/soc/sof/pm.c b/sound/soc/sof/pm.c index ac900fb3379e..584241e9734a 100644 --- a/sound/soc/sof/pm.c +++ b/sound/soc/sof/pm.c @@ -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); diff --git a/sound/soc/sof/sof-priv.h b/sound/soc/sof/sof-priv.h index 7a21a45d3635..2231c673c678 100644 --- a/sound/soc/sof/sof-priv.h +++ b/sound/soc/sof/sof-priv.h @@ -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);