ASoC: SOF: PM: only suspend to D0I3 when needed
authorKeyon Jie <yang.jie@linux.intel.com>
Mon, 11 Nov 2019 22:33:43 +0000 (16:33 -0600)
committerMark Brown <broonie@kernel.org>
Tue, 12 Nov 2019 12:10:59 +0000 (12:10 +0000)
We should suspend audio to D3 by default, for the sake of power saving,
change the condition of D0I3 suspending here to that when there is
stream with suspend_ignored specified.

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-5-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/sof/pm.c

index b89810bf32303153a930cb9528a82c4a3d553c08..0fd5567237a8d56383335080bb66233914c01aff 100644 (file)
@@ -468,7 +468,7 @@ int snd_sof_resume(struct device *dev)
        struct snd_sof_dev *sdev = dev_get_drvdata(dev);
        int ret;
 
-       if (sdev->s0_suspend) {
+       if (snd_sof_dsp_d0i3_on_suspend(sdev)) {
                /* resume from D0I3 */
                dev_dbg(sdev->dev, "DSP will exit from D0i3...\n");
                ret = snd_sof_set_d0_substate(sdev, SOF_DSP_D0I0);
@@ -497,7 +497,7 @@ int snd_sof_suspend(struct device *dev)
        struct snd_sof_dev *sdev = dev_get_drvdata(dev);
        int ret;
 
-       if (sdev->s0_suspend) {
+       if (snd_sof_dsp_d0i3_on_suspend(sdev)) {
                /* suspend to D0i3 */
                dev_dbg(sdev->dev, "DSP is trying to enter D0i3...\n");
                ret = snd_sof_set_d0_substate(sdev, SOF_DSP_D0I3);