diff options
author | Ranjani Sridharan <ranjani.sridharan@linux.intel.com> | 2021-11-25 12:15:16 +0200 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2021-11-26 13:24:21 +0000 |
commit | d9a7246534753efa383ad8d05ab3691df846c4b4 (patch) | |
tree | e1d0ce0d58c3d0d90750e0dd3c044560385d3901 /sound/soc/sof/pcm.c | |
parent | 47934e0fcbbe2bf488bcae2d68431b9ea5972488 (diff) | |
download | lwn-d9a7246534753efa383ad8d05ab3691df846c4b4.tar.gz lwn-d9a7246534753efa383ad8d05ab3691df846c4b4.zip |
ASoC: SOF: Add a helper for freeing PCM stream
Add a helper function to free PCM in the FW, stop the DMA and free the
widget list. These actions are performed both during PCM trigger STOP
and when a paused stream is freed during system suspend.
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-7-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/sof/pcm.c')
-rw-r--r-- | sound/soc/sof/pcm.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/sound/soc/sof/pcm.c b/sound/soc/sof/pcm.c index 1d0d90551e8f..3aa708b1ac26 100644 --- a/sound/soc/sof/pcm.c +++ b/sound/soc/sof/pcm.c @@ -466,17 +466,10 @@ static int sof_pcm_trigger(struct snd_soc_component *component, /* free PCM if reset_hw_params is set and the STOP IPC is successful */ if (!ret && reset_hw_params) { - ret = sof_pcm_dsp_pcm_free(substream, sdev, spcm); + ret = sof_pcm_stream_free(sdev, substream, spcm, substream->stream, + free_widget_list); if (ret < 0) return ret; - - ret = snd_sof_pcm_platform_hw_free(sdev, substream); - if (ret < 0) - return ret; - - /* free widget list only for SUSPEND trigger */ - if (free_widget_list) - ret = sof_widget_list_free(sdev, spcm, substream->stream); } return ret; |