]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
ASoC: SOF: add helper to check if we should enter d0i3 suspend
authorKeyon Jie <yang.jie@linux.intel.com>
Mon, 11 Nov 2019 22:33:42 +0000 (16:33 -0600)
committerMark Brown <broonie@kernel.org>
Tue, 12 Nov 2019 12:10:40 +0000 (12:10 +0000)
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>
sound/soc/sof/core.c
sound/soc/sof/sof-priv.h

index 8661c2cca76b9ab7d8923b34a791c66b128f62cd..805918d3bcc09df6b68fa3626ef46dcbd3496758 100644 (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.
  */
index 6408ac88a3e58264c0f3223856d2c0ecad775a04..c7c2c70ee4d04db210613fd9b643f05e6de94069 100644 (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,