alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Jyri Sarha <jsarha@ti.com>
To: dri-devel@lists.freedesktop.org, airlied@linux.ie,
	linux-omap@vger.kernel.org, alsa-devel@alsa-project.org
Cc: broonie@kernel.org, liam.r.girdwood@linux.intel.com,
	peter.ujfalusi@ti.com, tomi.valkeinen@ti.com, moinejf@free.fr,
	rmk+kernel@arm.linux.org.uk, Jyri Sarha <jsarha@ti.com>
Subject: [PATCH RFC v2 1/7] ASoC: core: If component doesn't have of_node use parent's node instead
Date: Tue, 26 May 2015 21:59:05 +0300	[thread overview]
Message-ID: <1432666751-24794-2-git-send-email-jsarha@ti.com> (raw)
In-Reply-To: <1432666751-24794-1-git-send-email-jsarha@ti.com>

If an ASoC component device does not have a device tree node, use its
parent's node instead, when looking for a matching DAI based on a
device tree reference.

This allows video device drivers to register a separate child device
for their ASoC side audio functionality.

Signed-off-by: Jyri Sarha <jsarha@ti.com>
---
 sound/soc/soc-core.c | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 2373252..b1bcff2 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -904,12 +904,17 @@ static struct snd_soc_dai *snd_soc_find_dai(
 {
 	struct snd_soc_component *component;
 	struct snd_soc_dai *dai;
+	struct device_node *component_of_node;
 
 	lockdep_assert_held(&client_mutex);
 
 	/* Find CPU DAI from registered DAIs*/
 	list_for_each_entry(component, &component_list, list) {
-		if (dlc->of_node && component->dev->of_node != dlc->of_node)
+		component_of_node = component->dev->of_node;
+		if (!component_of_node && component->dev->parent)
+			component_of_node = component->dev->parent->of_node;
+
+		if (dlc->of_node && component_of_node != dlc->of_node)
 			continue;
 		if (dlc->name && strcmp(component->name, dlc->name))
 			continue;
@@ -3488,11 +3493,16 @@ static int snd_soc_get_dai_name(struct of_phandle_args *args,
 				const char **dai_name)
 {
 	struct snd_soc_component *pos;
+	struct device_node *component_of_node;
 	int ret = -EPROBE_DEFER;
 
 	mutex_lock(&client_mutex);
 	list_for_each_entry(pos, &component_list, list) {
-		if (pos->dev->of_node != args->np)
+		component_of_node = pos->dev->of_node;
+		if (!component_of_node && pos->dev->parent)
+			component_of_node = pos->dev->parent->of_node;
+
+		if (component_of_node != args->np)
 			continue;
 
 		if (pos->driver->of_xlate_dai_name) {
-- 
1.9.1


  reply	other threads:[~2015-05-26 18:59 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-26 18:59 [PATCH RFC v2 0/7] Implement generic ASoC HDMI codec Jyri Sarha
2015-05-26 18:59 ` Jyri Sarha [this message]
2015-06-02 20:09   ` [PATCH RFC v2 1/7] ASoC: core: If component doesn't have of_node use parent's node instead Mark Brown
2015-05-26 18:59 ` [PATCH RFC v2 2/7] ASoC: hdmi: Remove obsolete dummy HDMI codec Jyri Sarha
2015-06-02 20:10   ` Mark Brown
2015-09-20  0:13   ` Applied "ASoC: hdmi: Remove obsolete dummy HDMI codec" to the asoc tree Mark Brown
2015-05-26 18:59 ` [PATCH RFC v2 3/7] ASoC: hdmi-codec: Add hdmi-codec for external HDMI-encoders Jyri Sarha
2015-08-14 19:25   ` Mark Brown
2015-08-17  8:39     ` Jyri Sarha
2015-05-26 18:59 ` [PATCH RFC v2 4/7] ASoC: hdmi-codec: Add ELD based audio pcm rules DO NOT MERGE Jyri Sarha
2015-05-26 18:59 ` [PATCH RFC v2 5/7] drm/i2c: tda998x: Add support of a DT graph of ports " Jyri Sarha
2015-05-26 18:59 ` [PATCH RFC v2 6/7] drm/i2c: tda998x: Register ASoC HDMI codec for audio functionality " Jyri Sarha
2015-05-26 18:59 ` [PATCH RFC v2 7/7] ARM: dts: am335x-boneblack: Add HDMI audio support " Jyri Sarha

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=1432666751-24794-2-git-send-email-jsarha@ti.com \
    --to=jsarha@ti.com \
    --cc=airlied@linux.ie \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=liam.r.girdwood@linux.intel.com \
    --cc=linux-omap@vger.kernel.org \
    --cc=moinejf@free.fr \
    --cc=peter.ujfalusi@ti.com \
    --cc=rmk+kernel@arm.linux.org.uk \
    --cc=tomi.valkeinen@ti.com \
    /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 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).