ASoC: Intel: Skylake: Fix bind of source with multiple sinks

skl_tplg_bind_sinks() takes only the first sink widget. This
breaks in case we have multiple sinks for a module.

So pass source widget to skl_tplg_bind_sinks() and bind for all
sinks by calling this recursively

Signed-off-by: Jeeja KP <jeeja.kp@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Jeeja KP 2016-02-03 17:59:51 +05:30 committed by Mark Brown
parent 9946f70906
commit 6bd4cf8556

View File

@ -547,6 +547,7 @@ static int skl_tplg_mixer_dapm_pre_pmu_event(struct snd_soc_dapm_widget *w,
static int skl_tplg_bind_sinks(struct snd_soc_dapm_widget *w,
struct skl *skl,
struct snd_soc_dapm_widget *src_w,
struct skl_module_cfg *src_mconfig)
{
struct snd_soc_dapm_path *p;
@ -563,6 +564,10 @@ static int skl_tplg_bind_sinks(struct snd_soc_dapm_widget *w,
dev_dbg(ctx->dev, "%s: sink widget=%s\n", __func__, p->sink->name);
next_sink = p->sink;
if (!is_skl_dsp_widget_type(p->sink))
return skl_tplg_bind_sinks(p->sink, skl, src_w, src_mconfig);
/*
* here we will check widgets in sink pipelines, so that
* can be any widgets type and we are only interested if
@ -592,7 +597,7 @@ static int skl_tplg_bind_sinks(struct snd_soc_dapm_widget *w,
}
if (!sink)
return skl_tplg_bind_sinks(next_sink, skl, src_mconfig);
return skl_tplg_bind_sinks(next_sink, skl, src_w, src_mconfig);
return 0;
}
@ -621,7 +626,7 @@ static int skl_tplg_pga_dapm_pre_pmu_event(struct snd_soc_dapm_widget *w,
* if sink is not started, start sink pipe first, then start
* this pipe
*/
ret = skl_tplg_bind_sinks(w, skl, src_mconfig);
ret = skl_tplg_bind_sinks(w, skl, w, src_mconfig);
if (ret)
return ret;