Unverified Commit 08820902 authored by Mark Brown's avatar Mark Brown
Browse files

ASoC: SOF: sof-audio: fix prepare/unprepare

Merge series from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:

2 patches from Rander required to enable mixing usages with multiple
pipelines.
parents 899a8e7d 9862dcf7
Loading
Loading
Loading
Loading
+7 −5
Original line number Diff line number Diff line
@@ -271,14 +271,16 @@ sof_unprepare_widgets_in_path(struct snd_sof_dev *sdev, struct snd_soc_dapm_widg
	struct snd_sof_widget *swidget = widget->dobj.private;
	struct snd_soc_dapm_path *p;

	if (!widget_ops[widget->id].ipc_unprepare || !swidget->prepared)
		goto sink_unprepare;
	/* return if the widget is in use or if it is already unprepared */
	if (!swidget->prepared || swidget->use_count > 1)
		return;

	if (widget_ops[widget->id].ipc_unprepare)
		/* unprepare the source widget */
		widget_ops[widget->id].ipc_unprepare(swidget);

	swidget->prepared = false;

sink_unprepare:
	/* unprepare all widgets in the sink paths */
	snd_soc_dapm_widget_for_each_sink_path(widget, p) {
		if (!p->walking && p->sink->dobj.private) {