OSDN Git Service

ASoC: SOF: call platform hw_free for paused streams during suspend
authorRanjani Sridharan <ranjani.sridharan@linux.intel.com>
Thu, 25 Nov 2021 10:15:15 +0000 (12:15 +0200)
committerMark Brown <broonie@kernel.org>
Fri, 26 Nov 2021 13:24:20 +0000 (13:24 +0000)
Paused streams must be stopped and platform hw_free should be invoked
during system suspend so they can be restarted properly after system
resume.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20211125101520.291581-6-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/sof/sof-audio.c

index e00ce27..d81071b 100644 (file)
@@ -751,10 +751,17 @@ static int sof_tear_down_left_over_pipelines(struct snd_sof_dev *sdev)
                                continue;
 
                        if (spcm->stream[dir].list) {
+                               /* Free PCM in the DSP */
                                ret = sof_pcm_dsp_pcm_free(substream, sdev, spcm);
                                if (ret < 0)
                                        return ret;
 
+                               /* stop DMA */
+                               ret = snd_sof_pcm_platform_hw_free(sdev, substream);
+                               if (ret < 0)
+                                       return ret;
+
+                               /* free the DAPM widget list */
                                ret = sof_widget_list_free(sdev, spcm, dir);
                                if (ret < 0) {
                                        dev_err(sdev->dev, "failed to free widgets during suspend\n");