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>
This commit is contained in:
Keyon Jie 2019-11-08 08:26:28 +08:00 committed by Pierre Bossart
parent 031bea594f
commit df365f514d
2 changed files with 15 additions and 0 deletions

View File

@ -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.
*/

View File

@ -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,