diff options
author | Keyon Jie <yang.jie@linux.intel.com> | 2019-11-11 16:33:42 -0600 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2019-11-12 12:10:40 +0000 |
commit | a77e5d573f847d2f984c38eb711351326bc55258 (patch) | |
tree | 90420ae09c430fc74b7dc460b2b70e898d9b77c8 /sound/soc/sof | |
parent | 58a972efd21bb5adadd97f2546693ec64bfc99b9 (diff) | |
download | linux-a77e5d573f847d2f984c38eb711351326bc55258.tar.gz linux-a77e5d573f847d2f984c38eb711351326bc55258.tar.bz2 linux-a77e5d573f847d2f984c38eb711351326bc55258.zip |
ASoC: SOF: add helper to check if we should enter d0i3 suspend
Add helper to check if the DSP should be put in D0i3. This function
returns true if a stream has ignored the SUSPEND trigger to keep the
pipelines running in the DSP.
Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20191111223343.19986-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/sof')
-rw-r--r-- | sound/soc/sof/core.c | 13 | ||||
-rw-r--r-- | sound/soc/sof/sof-priv.h | 2 |
2 files changed, 15 insertions, 0 deletions
diff --git a/sound/soc/sof/core.c b/sound/soc/sof/core.c index 8661c2cca76b..805918d3bcc0 100644 --- a/sound/soc/sof/core.c +++ b/sound/soc/sof/core.c @@ -132,6 +132,19 @@ struct snd_sof_dai *snd_sof_find_dai(struct snd_sof_dev *sdev, return NULL; } +bool snd_sof_dsp_d0i3_on_suspend(struct snd_sof_dev *sdev) +{ + struct snd_sof_pcm *spcm; + + list_for_each_entry(spcm, &sdev->pcm_list, list) { + if (spcm->stream[SNDRV_PCM_STREAM_PLAYBACK].suspend_ignored || + spcm->stream[SNDRV_PCM_STREAM_CAPTURE].suspend_ignored) + return true; + } + + return false; +} + /* * FW Panic/fault handling. */ diff --git a/sound/soc/sof/sof-priv.h b/sound/soc/sof/sof-priv.h index 6408ac88a3e5..c7c2c70ee4d0 100644 --- a/sound/soc/sof/sof-priv.h +++ b/sound/soc/sof/sof-priv.h @@ -553,6 +553,8 @@ struct snd_sof_pcm *snd_sof_find_spcm_dai(struct snd_sof_dev *sdev, return NULL; } +bool snd_sof_dsp_d0i3_on_suspend(struct snd_sof_dev *sdev); + struct snd_sof_pcm *snd_sof_find_spcm_name(struct snd_sof_dev *sdev, const char *name); struct snd_sof_pcm *snd_sof_find_spcm_comp(struct snd_sof_dev *sdev, |