if (!widget->dobj.private)
continue;
- snd_soc_dapm_widget_for_each_sink_path(widget, p)
+ snd_soc_dapm_widget_for_each_sink_path(widget, p) {
+ if (!widget_in_list(list, p->sink))
+ continue;
+
if (p->sink->dobj.private) {
ret = sof_route_setup(sdev, widget, p->sink);
if (ret < 0)
return ret;
}
+ }
}
} else {
for_each_dapm_widgets(list, i, widget) {
if (!widget->dobj.private)
continue;
- snd_soc_dapm_widget_for_each_source_path(widget, p)
+ snd_soc_dapm_widget_for_each_source_path(widget, p) {
+ if (!widget_in_list(list, p->source))
+ continue;
+
if (p->source->dobj.private) {
ret = sof_route_setup(sdev, p->source, widget);
if (ret < 0)
return ret;
}
+ }
}
}
}
static void
-sof_unprepare_widgets_in_path(struct snd_sof_dev *sdev, struct snd_soc_dapm_widget *widget)
+sof_unprepare_widgets_in_path(struct snd_sof_dev *sdev, struct snd_soc_dapm_widget *widget,
+ struct snd_soc_dapm_widget_list *list)
{
const struct sof_ipc_tplg_ops *tplg_ops = sof_ipc_get_ops(sdev, tplg);
struct snd_sof_widget *swidget = widget->dobj.private;
sink_unprepare:
/* unprepare all widgets in the sink paths */
snd_soc_dapm_widget_for_each_sink_path(widget, p) {
+ if (!widget_in_list(list, p->sink))
+ continue;
if (!p->walking && p->sink->dobj.private) {
p->walking = true;
- sof_unprepare_widgets_in_path(sdev, p->sink);
+ sof_unprepare_widgets_in_path(sdev, p->sink, list);
p->walking = false;
}
}
sof_prepare_widgets_in_path(struct snd_sof_dev *sdev, struct snd_soc_dapm_widget *widget,
struct snd_pcm_hw_params *fe_params,
struct snd_sof_platform_stream_params *platform_params,
- struct snd_pcm_hw_params *pipeline_params, int dir)
+ struct snd_pcm_hw_params *pipeline_params, int dir,
+ struct snd_soc_dapm_widget_list *list)
{
const struct sof_ipc_tplg_ops *tplg_ops = sof_ipc_get_ops(sdev, tplg);
struct snd_sof_widget *swidget = widget->dobj.private;
sink_prepare:
/* prepare all widgets in the sink paths */
snd_soc_dapm_widget_for_each_sink_path(widget, p) {
+ if (!widget_in_list(list, p->sink))
+ continue;
if (!p->walking && p->sink->dobj.private) {
p->walking = true;
ret = sof_prepare_widgets_in_path(sdev, p->sink, fe_params,
- platform_params, pipeline_params, dir);
+ platform_params, pipeline_params, dir,
+ list);
p->walking = false;
if (ret < 0) {
/* unprepare the source widget */
* (DAI type for capture, AIF type for playback)
*/
static int sof_free_widgets_in_path(struct snd_sof_dev *sdev, struct snd_soc_dapm_widget *widget,
- int dir)
+ int dir, struct snd_soc_dapm_widget_list *list)
{
struct snd_soc_dapm_path *p;
int err;
/* free all widgets in the sink paths even in case of error to keep use counts balanced */
snd_soc_dapm_widget_for_each_sink_path(widget, p) {
if (!p->walking) {
+ if (!widget_in_list(list, p->sink))
+ continue;
+
p->walking = true;
- err = sof_free_widgets_in_path(sdev, p->sink, dir);
+ err = sof_free_widgets_in_path(sdev, p->sink, dir, list);
if (err < 0)
ret = err;
p->walking = false;
* The error path in this function ensures that all successfully set up widgets getting freed.
*/
static int sof_set_up_widgets_in_path(struct snd_sof_dev *sdev, struct snd_soc_dapm_widget *widget,
- int dir)
+ int dir, struct snd_soc_dapm_widget_list *list)
{
struct snd_soc_dapm_path *p;
int ret;
snd_soc_dapm_widget_for_each_sink_path(widget, p) {
if (!p->walking) {
+ if (!widget_in_list(list, p->sink))
+ continue;
+
p->walking = true;
- ret = sof_set_up_widgets_in_path(sdev, p->sink, dir);
+ ret = sof_set_up_widgets_in_path(sdev, p->sink, dir, list);
p->walking = false;
if (ret < 0) {
if (widget->dobj.private)
switch (op) {
case SOF_WIDGET_SETUP:
- ret = sof_set_up_widgets_in_path(sdev, widget, dir);
+ ret = sof_set_up_widgets_in_path(sdev, widget, dir, list);
str = "set up";
break;
case SOF_WIDGET_FREE:
- ret = sof_free_widgets_in_path(sdev, widget, dir);
+ ret = sof_free_widgets_in_path(sdev, widget, dir, list);
str = "free";
break;
case SOF_WIDGET_PREPARE:
*/
memcpy(&pipeline_params, fe_params, sizeof(*fe_params));
- ret = sof_prepare_widgets_in_path(sdev, widget, fe_params,
- platform_params, &pipeline_params, dir);
+ ret = sof_prepare_widgets_in_path(sdev, widget, fe_params, platform_params,
+ &pipeline_params, dir, list);
break;
}
case SOF_WIDGET_UNPREPARE:
- sof_unprepare_widgets_in_path(sdev, widget);
+ sof_unprepare_widgets_in_path(sdev, widget, list);
break;
default:
dev_err(sdev->dev, "Invalid widget op %d\n", op);