2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-23 04:34:11 +08:00

ASoC: soc-core: defer card probe until all component is added to list

DAI component probe is not called if it is not present
in component list during sound card registration.
Check if component is available in component list for
platform and cpu dai before soundcard registration.

Signed-off-by: Ajit Pandey <ajitp@codeaurora.org>
Signed-off-by: Rohit kumar <rohitkr@codeaurora.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Ajit Pandey 2019-01-09 14:17:07 +05:30 committed by Mark Brown
parent 44fabd8cda
commit 8780cf1142
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0

View File

@ -1027,7 +1027,6 @@ static int snd_soc_init_platform(struct snd_soc_card *card,
struct snd_soc_dai_link *dai_link) struct snd_soc_dai_link *dai_link)
{ {
struct snd_soc_dai_link_component *platform = dai_link->platform; struct snd_soc_dai_link_component *platform = dai_link->platform;
/* /*
* FIXME * FIXME
* *
@ -1129,6 +1128,14 @@ static int soc_init_dai_link(struct snd_soc_card *card,
link->name); link->name);
return -EINVAL; return -EINVAL;
} }
/*
* Defer card registartion if platform dai component is not added to
* component list.
*/
if (!soc_find_component(link->platform->of_node, link->platform->name))
return -EPROBE_DEFER;
/* /*
* CPU device may be specified by either name or OF node, but * CPU device may be specified by either name or OF node, but
* can be left unspecified, and will be matched based on DAI * can be left unspecified, and will be matched based on DAI
@ -1140,6 +1147,14 @@ static int soc_init_dai_link(struct snd_soc_card *card,
link->name); link->name);
return -EINVAL; return -EINVAL;
} }
/*
* Defer card registartion if cpu dai component is not added to
* component list.
*/
if (!soc_find_component(link->cpu_of_node, link->cpu_name))
return -EPROBE_DEFER;
/* /*
* At least one of CPU DAI name or CPU device name/node must be * At least one of CPU DAI name or CPU device name/node must be
* specified * specified