diff mbox

ASoC: simple-card: cpu_dai_name creates confusion when DT case

Message ID 87eh2r9169.wl%kuninori.morimoto.gx@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Kuninori Morimoto Feb. 25, 2014, 6:06 a.m. UTC
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>
---
 sound/soc/generic/simple-card.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Mark Brown Feb. 27, 2014, 5:07 a.m. UTC | #1
On Mon, Feb 24, 2014 at 10:06:09PM -0800, Kuninori Morimoto wrote:
> 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().

This looks like a valid issue which still affects current code but it
doesn't apply due changes on the latest topic/simple branch.  Can you
please check and resend?
Kuninori Morimoto Feb. 27, 2014, 10:21 a.m. UTC | #2
Hi Mark

> > 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().
> 
> This looks like a valid issue which still affects current code but it
> doesn't apply due changes on the latest topic/simple branch.  Can you
> please check and resend?

OK
I will send it again tomorrow.
Thank you
diff mbox

Patch

diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c
index 2a1b1b5..4a0e06e 100644
--- a/sound/soc/generic/simple-card.c
+++ b/sound/soc/generic/simple-card.c
@@ -242,7 +242,8 @@  static int asoc_simple_card_probe(struct platform_device *pdev)
 	 */
 	cinfo->snd_link.name		= cinfo->name;
 	cinfo->snd_link.stream_name	= cinfo->name;
-	cinfo->snd_link.cpu_dai_name	= cinfo->cpu_dai.name;
+	if (!of_cpu)
+		cinfo->snd_link.cpu_dai_name	= cinfo->cpu_dai.name;
 	cinfo->snd_link.platform_name	= cinfo->platform;
 	cinfo->snd_link.codec_name	= cinfo->codec;
 	cinfo->snd_link.codec_dai_name	= cinfo->codec_dai.name;