linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] ASoC: soc-core: defer card probe until all component is added to list
@ 2019-01-09  8:47 Rohit kumar
  2019-01-09 12:49 ` Applied "ASoC: soc-core: defer card probe until all component is added to list" to the asoc tree Mark Brown
  2019-01-11  5:07 ` [alsa-devel] [PATCH v2] ASoC: soc-core: defer card probe until all component is added to list Pierre-Louis Bossart
  0 siblings, 2 replies; 7+ messages in thread
From: Rohit kumar @ 2019-01-09  8:47 UTC (permalink / raw)
  To: plai, bgoswami, asishb, lgirdwood, broonie, perex, tiwai,
	alsa-devel, linux-kernel, rohkumar, srinivas.kandagatla,
	vinod.koul
  Cc: Ajit Pandey, Rohit kumar

From: Ajit Pandey <ajitp@codeaurora.org>

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>
---
Changes since v1:
Moved component find logic to soc-core instead of machine driver
as suggested by Mark.

 sound/soc/soc-core.c | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 0462b3e..eec92f1 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -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_component *platform = dai_link->platform;
-
 	/*
 	 * FIXME
 	 *
@@ -1129,6 +1128,14 @@ static int soc_init_dai_link(struct snd_soc_card *card,
 			link->name);
 		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
 	 * 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);
 		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
 	 * specified
-- 
Qualcomm India Private Limited, on behalf of Qualcomm Innovation Center, Inc.,
is a member of Code Aurora Forum, a Linux Foundation Collaborative Project.


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-01-11  8:12 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-09  8:47 [PATCH v2] ASoC: soc-core: defer card probe until all component is added to list Rohit kumar
2019-01-09 12:49 ` Applied "ASoC: soc-core: defer card probe until all component is added to list" to the asoc tree Mark Brown
2019-01-10  2:32   ` [alsa-devel] " Kuninori Morimoto
2019-01-10  7:09     ` Rohit Kumar
2019-01-10  7:29       ` Kuninori Morimoto
2019-01-11  5:07 ` [alsa-devel] [PATCH v2] ASoC: soc-core: defer card probe until all component is added to list Pierre-Louis Bossart
2019-01-11  8:11   ` Rohit Kumar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).