提交 19c2c5f5 编写于 作者: R Russell King 提交者: Mark Brown

ASoC: avoid duplicated DAI routes

ASoC automatically creates snd_soc_dapm_dai_in and snd_soc_dapm_dai_out
widgets for DAI drivers, and adds them to the list.  Later on, ASoC
creates automatic routes between these widgets and a widget with a
stream name.

We look for a snd_soc_dapm_dai_in or snd_soc_dapm_dai_out widget, and
use this to obtain the DAI structure.  We then scan all widgets for
any with a stream name refering to either the capture or the playback
stream, and create routes.

If you have both a snd_soc_dapm_dai_in and a snd_soc_dapm_dai_out
referring to the same DAI structure, this ends up creating one set of
routes for the DAI for the snd_soc_dapm_dai_in widget, and a duplicated
set of routes for the snd_soc_dapm_dai_out widget.

Fix this by checking that the stream name for the widget matches the
DAI widget name.
Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: NMark Brown <broonie@linaro.org>
上级 57295073
...@@ -3551,7 +3551,7 @@ int snd_soc_dapm_link_dai_widgets(struct snd_soc_card *card) ...@@ -3551,7 +3551,7 @@ int snd_soc_dapm_link_dai_widgets(struct snd_soc_card *card)
break; break;
} }
if (!w->sname) if (!w->sname || !strstr(w->sname, dai_w->name))
continue; continue;
if (dai->driver->playback.stream_name && if (dai->driver->playback.stream_name &&
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册