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