All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rohit kumar <rohitkr@codeaurora.org>
To: plai@codeaurora.org, bgoswami@codeaurora.org,
	asishb@codeaurora.org, lgirdwood@gmail.com, broonie@kernel.org,
	perex@perex.cz, tiwai@suse.com, alsa-devel@alsa-project.org,
	linux-kernel@vger.kernel.org, rohkumar@qti.qualcomm.com,
	srinivas.kandagatla@linaro.org, vinod.koul@linaro.org
Cc: Ajit Pandey <ajitp@codeaurora.org>, Rohit kumar <rohitkr@codeaurora.org>
Subject: [PATCH v2] ASoC: soc-core: defer card probe until all component is added to list
Date: Wed,  9 Jan 2019 14:17:07 +0530	[thread overview]
Message-ID: <1547023627-30312-1-git-send-email-rohitkr@codeaurora.org> (raw)

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.


             reply	other threads:[~2019-01-09  8:48 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-09  8:47 Rohit kumar [this message]
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-09 12:49   ` 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  5:07   ` Pierre-Louis Bossart
2019-01-11  8:11   ` [alsa-devel] " Rohit Kumar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1547023627-30312-1-git-send-email-rohitkr@codeaurora.org \
    --to=rohitkr@codeaurora.org \
    --cc=ajitp@codeaurora.org \
    --cc=alsa-devel@alsa-project.org \
    --cc=asishb@codeaurora.org \
    --cc=bgoswami@codeaurora.org \
    --cc=broonie@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=plai@codeaurora.org \
    --cc=rohkumar@qti.qualcomm.com \
    --cc=srinivas.kandagatla@linaro.org \
    --cc=tiwai@suse.com \
    --cc=vinod.koul@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.