[PATCH][ASoC v2] Add checks for codec DAI number during match-up

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.

Signed-off-by: Timur Tabi <timur@xxxxxxxxxxxxx>
---
 sound/soc/soc-core.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index a88e3a0..cc543e6 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -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);
-- 
1.5.5

_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux