Skip to content

Commit a77e5d5

Browse files
keyonjiebroonie
authored andcommitted
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>
1 parent 58a972e commit a77e5d5

2 files changed

Lines changed: 15 additions & 0 deletions

File tree

‎sound/soc/sof/core.c‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,19 @@ struct snd_sof_dai *snd_sof_find_dai(struct snd_sof_dev *sdev,
132132
return NULL;
133133
}
134134

135+
bool snd_sof_dsp_d0i3_on_suspend(struct snd_sof_dev *sdev)
136+
{
137+
struct snd_sof_pcm *spcm;
138+
139+
list_for_each_entry(spcm, &sdev->pcm_list, list) {
140+
if (spcm->stream[SNDRV_PCM_STREAM_PLAYBACK].suspend_ignored ||
141+
spcm->stream[SNDRV_PCM_STREAM_CAPTURE].suspend_ignored)
142+
return true;
143+
}
144+
145+
return false;
146+
}
147+
135148
/*
136149
* FW Panic/fault handling.
137150
*/

‎sound/soc/sof/sof-priv.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -553,6 +553,8 @@ struct snd_sof_pcm *snd_sof_find_spcm_dai(struct snd_sof_dev *sdev,
553553
return NULL;
554554
}
555555

556+
bool snd_sof_dsp_d0i3_on_suspend(struct snd_sof_dev *sdev);
557+
556558
struct snd_sof_pcm *snd_sof_find_spcm_name(struct snd_sof_dev *sdev,
557559
const char *name);
558560
struct snd_sof_pcm *snd_sof_find_spcm_comp(struct snd_sof_dev *sdev,

0 commit comments

Comments
 (0)