Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Kuninori Morimoto <kuninori.morimoto.gx@gmail.com>
To: Mark Brown <broonie@kernel.org>
Cc: Linux-ALSA <alsa-devel@alsa-project.org>,
	Simon <horms@verge.net.au>, Liam Girdwood <lgirdwood@gmail.com>,
	Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Subject: [PATCH v2] ASoC: simple-card: cpu_dai_name creates confusion when DT case
Date: Thu, 27 Feb 2014 18:25:24 -0800 (PST)	[thread overview]
Message-ID: <87ppm87z3i.wl%kuninori.morimoto.gx@gmail.com> (raw)
In-Reply-To: <87ios0etzw.wl%kuninori.morimoto.gx@gmail.com>

From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

Basically, soc_bind_dai_link() checks
cpu_dai->dev->of_node and dai_link->cpu_of_node in DT case.
But after that it will check
cpu_dai->name and dai_link->cpu_dai_name too.

On the other hand, snd_soc_dai :: name is created by
fmt_single_name() or fmt_multiple_name().

There is no confusion if dai name is created by fmt_multiple_name(),
since cpu_dai->name is same as dai_link->cpu_dai_name.
but, if dai name is created by fmt_single_name(), CPU DAI never match.

Thus, simple-card not set dai_link->cpu_dai_name if DT case
to skip naming match on soc_bind_dai_link()

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
v1 -> v2

 - for latest mark/topic/simple branch

 sound/soc/generic/simple-card.c |   11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c
index bdd176d..034a2b7 100644
--- a/sound/soc/generic/simple-card.c
+++ b/sound/soc/generic/simple-card.c
@@ -234,6 +234,17 @@ static int asoc_simple_card_parse_of(struct device_node *node,
 		priv->codec_dai.fmt,
 		priv->codec_dai.sysclk);
 
+	/*
+	 * soc_bind_dai_link() will check cpu name
+	 * after of_node matching if dai_link has cpu_dai_name.
+	 * but, it will never match if name was created by fmt_single_name()
+	 * remove cpu_dai_name to escape name matching.
+	 * see
+	 *	fmt_single_name()
+	 *	fmt_multiple_name()
+	 */
+	dai_link->cpu_dai_name = NULL;
+
 	return 0;
 }
 
-- 
1.7.9.5

  reply	other threads:[~2014-02-28  2:25 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-25  6:06 [PATCH] ASoC: simple-card: cpu_dai_name creates confusion when DT case Kuninori Morimoto
2014-02-27  5:07 ` Mark Brown
2014-02-27 10:21   ` Kuninori Morimoto
2014-02-28  2:25     ` Kuninori Morimoto [this message]
2014-02-28  3:53       ` [PATCH v2] " Mark Brown
2014-02-28  4:31         ` Kuninori Morimoto
2014-02-28  5:25           ` Mark Brown

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=87ppm87z3i.wl%kuninori.morimoto.gx@gmail.com \
    --to=kuninori.morimoto.gx@gmail.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=horms@verge.net.au \
    --cc=kuninori.morimoto.gx@renesas.com \
    --cc=lgirdwood@gmail.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