@@ -715,6 +715,18 @@ int sof_widget_list_prepare(struct snd_sof_dev *sdev, struct snd_sof_pcm *spcm,
715715 dir , SOF_WIDGET_PREPARE );
716716}
717717
718+ void sof_widget_list_unprepare (struct snd_sof_dev * sdev , struct snd_sof_pcm * spcm , int dir )
719+ {
720+ struct snd_soc_dapm_widget_list * list = spcm -> stream [dir ].list ;
721+
722+ /* unprepare the widget */
723+ sof_walk_widgets_in_order (sdev , spcm , NULL , NULL , dir , SOF_WIDGET_UNPREPARE );
724+
725+ snd_soc_dapm_dai_free_widgets (& list );
726+ spcm -> stream [dir ].list = NULL ;
727+ }
728+
729+
718730int sof_widget_list_setup (struct snd_sof_dev * sdev , struct snd_sof_pcm * spcm ,
719731 struct snd_pcm_hw_params * fe_params ,
720732 struct snd_sof_platform_stream_params * platform_params ,
@@ -806,12 +818,6 @@ int sof_widget_list_free(struct snd_sof_dev *sdev, struct snd_sof_pcm *spcm, int
806818 /* send IPC to free widget in the DSP */
807819 ret = sof_walk_widgets_in_order (sdev , spcm , NULL , NULL , dir , SOF_WIDGET_FREE );
808820
809- /* unprepare the widget */
810- sof_walk_widgets_in_order (sdev , spcm , NULL , NULL , dir , SOF_WIDGET_UNPREPARE );
811-
812- snd_soc_dapm_dai_free_widgets (& list );
813- spcm -> stream [dir ].list = NULL ;
814-
815821 pipeline_list -> count = 0 ;
816822
817823 return ret ;
0 commit comments