Skip to contentSkip to conversation

Add checks for codec DAI number during match-up

PATCH Applied Timur Tabi 2 participants 2 messages Jun 13, 2008

Subsystems (2)
lore
Share & tools
lore

Timur Tabi

author
#0 lore raw

PATCH v2 1/1 Add checks for codec DAI number during match-up

Update the Codec DAI matching scheme to take the DAI number into account, and not just the name. This is necessary for systems with multiple codecs that use the Codec ID number to differentiate them.

---
 sound/soc/soc-core.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
sound/soc/soc-core.c +2 -0
index a88e3a0..cc543e6 100644
@@ -801,6 +801,7 @@ codec_dai:
 	/* yes, then check the codec_dai list */
 	list_for_each_entry(codec_dai, &codec_dai_list, list) {
 		if (!strcmp(config->codec_dai, codec_dai->name) &&
+		    (codec_dai->id == config->codec_num) &&
 		    try_module_get(codec_dai->dev->driver->owner)) {
 			dbg("ASoC %s %s: Match for %s %s\n",
 			    soc_card->name, config->name,
@@ -1767,6 +1768,7 @@ struct snd_soc_dai *snd_soc_register_codec_dai(
 	dai->playback = template->playback;
 	dai->capture = template->capture;
 	dai->name = template->name;
+	dai->id = template->id;
 	dai->ac97_control = template->ac97_control;
 	mutex_lock(&client_mutex);
 	list_add(&dai->list, &codec_dai_list);
Signature · 1 line
1.5.5
Applied
#1 lore raw
Quoted 3 lines · Timur Tabi

Update the Codec DAI matching scheme to take the DAI number into account, and not just the name. This is necessary for systems with multiple codecs that use the Codec ID number to differentiate them.

Applied, thanks.