Thread (8 messages) 8 messages, 4 authors, 2013-02-01

[RFC][PATCH 1/2] ASoC: codec_dai_name become option

From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Date: 2013-02-01 05:19:11
Also in: alsa-devel
Subsystem: sound, sound - soc layer / dynamic audio power management (asoc), the rest · Maintainers: Jaroslav Kysela, Takashi Iwai, Liam Girdwood, Mark Brown, Linus Torvalds

Possibly related (same subject, not in this thread)

Current ASoC always request codec_dai_name for matching,
but it can be option.
This patch set codec_dai_name as option.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 sound/soc/soc-core.c |   17 ++++++-----------
 1 file changed, 6 insertions(+), 11 deletions(-)
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 689eb04..ab3aafc 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -863,12 +863,13 @@ static int soc_bind_dai_link(struct snd_soc_card *card, int num)
 		 * this CODEC
 		 */
 		list_for_each_entry(codec_dai, &dai_list, list) {
-			if (codec->dev == codec_dai->dev &&
-				!strcmp(codec_dai->name,
-					dai_link->codec_dai_name)) {
+			if (codec->dev != codec_dai->dev)
+				continue;
+			if (dai_link->codec_dai_name &&
+			    strcmp(codec_dai->name, dai_link->codec_dai_name))
+				continue;
 
-				rtd->codec_dai = codec_dai;
-			}
+			rtd->codec_dai = codec_dai;
 		}
 
 		if (!rtd->codec_dai) {
@@ -3548,12 +3549,6 @@ int snd_soc_register_card(struct snd_soc_card *card)
 				" name/of_node are set for %s\n", link->name);
 			return -EINVAL;
 		}
-		/* Codec DAI name must be specified */
-		if (!link->codec_dai_name) {
-			dev_err(card->dev, "ASoC: codec_dai_name not"
-				" set for %s\n", link->name);
-			return -EINVAL;
-		}
 
 		/*
 		 * Platform may be specified by either name or OF node, but
-- 
1.7.9.5
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help