mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-24 06:50:58 +07:00
ASoC: pcm: allow delayed suspending request by users
If a device would like to use delayed suspending then PM recommendation is to set ‘power.use_autosuspend’ flag. To allow users to do so we need to change runtime calls in core to use autosuspend counterparts. For user who do not wish to use delayed suspend not setting the device's ‘power.use_autosuspend’ flag will result in non-delayed suspend even with these APIs which incidentally is also the default behaviour, so only users will be impacted who opt in for this. Signed-off-by: Sanyog Kale <sanyog.r.kale@intel.com> Signed-off-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
8005c49d9a
commit
3f80978397
@ -599,10 +599,15 @@ static int soc_pcm_open(struct snd_pcm_substream *substream)
|
||||
out:
|
||||
mutex_unlock(&rtd->pcm_mutex);
|
||||
|
||||
pm_runtime_put(platform->dev);
|
||||
for (i = 0; i < rtd->num_codecs; i++)
|
||||
pm_runtime_put(rtd->codec_dais[i]->dev);
|
||||
pm_runtime_put(cpu_dai->dev);
|
||||
pm_runtime_mark_last_busy(platform->dev);
|
||||
pm_runtime_put_autosuspend(platform->dev);
|
||||
for (i = 0; i < rtd->num_codecs; i++) {
|
||||
pm_runtime_mark_last_busy(rtd->codec_dais[i]->dev);
|
||||
pm_runtime_put_autosuspend(rtd->codec_dais[i]->dev);
|
||||
}
|
||||
|
||||
pm_runtime_mark_last_busy(cpu_dai->dev);
|
||||
pm_runtime_put_autosuspend(cpu_dai->dev);
|
||||
for (i = 0; i < rtd->num_codecs; i++) {
|
||||
if (!rtd->codec_dais[i]->active)
|
||||
pinctrl_pm_select_sleep_state(rtd->codec_dais[i]->dev);
|
||||
@ -706,10 +711,17 @@ static int soc_pcm_close(struct snd_pcm_substream *substream)
|
||||
|
||||
mutex_unlock(&rtd->pcm_mutex);
|
||||
|
||||
pm_runtime_put(platform->dev);
|
||||
for (i = 0; i < rtd->num_codecs; i++)
|
||||
pm_runtime_put(rtd->codec_dais[i]->dev);
|
||||
pm_runtime_put(cpu_dai->dev);
|
||||
pm_runtime_mark_last_busy(platform->dev);
|
||||
pm_runtime_put_autosuspend(platform->dev);
|
||||
|
||||
for (i = 0; i < rtd->num_codecs; i++) {
|
||||
pm_runtime_mark_last_busy(rtd->codec_dais[i]->dev);
|
||||
pm_runtime_put_autosuspend(rtd->codec_dais[i]->dev);
|
||||
}
|
||||
|
||||
pm_runtime_mark_last_busy(cpu_dai->dev);
|
||||
pm_runtime_put_autosuspend(cpu_dai->dev);
|
||||
|
||||
for (i = 0; i < rtd->num_codecs; i++) {
|
||||
if (!rtd->codec_dais[i]->active)
|
||||
pinctrl_pm_select_sleep_state(rtd->codec_dais[i]->dev);
|
||||
|
Loading…
Reference in New Issue
Block a user