Commit 61b0088b authored by Mengdong Lin's avatar Mengdong Lin Committed by Mark Brown

ASoC: Bind new DAI links after probing components

Probing components can bring new DAI or DAI links based on the topology
info. This patch finds the unbound DAI links and bind them.
Signed-off-by: default avatarMengdong Lin <mengdong.lin@linux.intel.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 49a5ba1c
...@@ -1806,6 +1806,7 @@ static int snd_soc_instantiate_card(struct snd_soc_card *card) ...@@ -1806,6 +1806,7 @@ static int snd_soc_instantiate_card(struct snd_soc_card *card)
{ {
struct snd_soc_codec *codec; struct snd_soc_codec *codec;
struct snd_soc_pcm_runtime *rtd; struct snd_soc_pcm_runtime *rtd;
struct snd_soc_dai_link *dai_link;
int ret, i, order; int ret, i, order;
mutex_lock(&client_mutex); mutex_lock(&client_mutex);
...@@ -1893,6 +1894,21 @@ static int snd_soc_instantiate_card(struct snd_soc_card *card) ...@@ -1893,6 +1894,21 @@ static int snd_soc_instantiate_card(struct snd_soc_card *card)
} }
} }
/* Find new DAI links added during probing components and bind them.
* Components with topology may bring new DAIs and DAI links.
*/
list_for_each_entry(dai_link, &card->dai_link_list, list) {
if (soc_is_dai_link_bound(card, dai_link))
continue;
ret = soc_init_dai_link(card, dai_link);
if (ret)
goto probe_dai_err;
ret = soc_bind_dai_link(card, dai_link);
if (ret)
goto probe_dai_err;
}
/* probe all DAI links on this card */ /* probe all DAI links on this card */
for (order = SND_SOC_COMP_ORDER_FIRST; order <= SND_SOC_COMP_ORDER_LAST; for (order = SND_SOC_COMP_ORDER_FIRST; order <= SND_SOC_COMP_ORDER_LAST;
order++) { order++) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment