Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions sound/soc/sof/sof-audio.c
Original file line number Diff line number Diff line change
Expand Up @@ -736,8 +736,8 @@ int sof_widget_list_setup(struct snd_sof_dev *sdev, struct snd_sof_pcm *spcm,
struct snd_soc_dapm_widget *widget;
int i, ret;

/* nothing to set up */
if (!list)
/* nothing to set up or setup has been already done */
if (!list || spcm->setup_done[dir])
return 0;

/* Set up is used to send the IPC to the DSP to create the widget */
Expand Down Expand Up @@ -794,6 +794,8 @@ int sof_widget_list_setup(struct snd_sof_dev *sdev, struct snd_sof_pcm *spcm,
}
}

spcm->setup_done[dir] = true;

return 0;

widget_free:
Expand All @@ -811,12 +813,13 @@ int sof_widget_list_free(struct snd_sof_dev *sdev, struct snd_sof_pcm *spcm, int
int ret;

/* nothing to free */
if (!list)
if (!list || !spcm->setup_done[dir])
return 0;

/* send IPC to free widget in the DSP */
ret = sof_walk_widgets_in_order(sdev, spcm, NULL, NULL, dir, SOF_WIDGET_FREE);

spcm->setup_done[dir] = false;
pipeline_list->count = 0;

return ret;
Expand Down
1 change: 1 addition & 0 deletions sound/soc/sof/sof-audio.h
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,7 @@ struct snd_sof_pcm {
struct snd_pcm_hw_params params[2];
struct snd_sof_platform_stream_params platform_params[2];
bool prepared[2]; /* PCM_PARAMS set successfully */
bool setup_done[2]; /* the setup of the SOF PCM device is done */
bool pending_stop[2]; /* only used if (!pcm_ops->platform_stop_during_hw_free) */

/* Must be last - ends in a flex-array member. */
Expand Down
Loading