From 24f79221324b2937252dd1209f1b6d1fb549399d Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E9=82=B1=E5=BB=BA=E6=96=8C?= Date: Mon, 14 Jan 2013 18:28:08 +0800 Subject: [PATCH] sound soc-core: codec_name not adapted i2c_name --- sound/soc/soc-core.c | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) mode change 100644 => 100755 sound/soc/soc-core.c diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c old mode 100644 new mode 100755 index e20e8cc645aa..bebc1bee6087 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -1318,7 +1318,7 @@ EXPORT_SYMBOL_GPL(snd_soc_resume); static struct snd_soc_dai_ops null_dai_ops = { }; - +#define CODEC_NAME_CMP static int soc_bind_dai_link(struct snd_soc_card *card, int num) { struct snd_soc_dai_link *dai_link = &card->dai_link[num]; @@ -1327,7 +1327,14 @@ static int soc_bind_dai_link(struct snd_soc_card *card, int num) struct snd_soc_platform *platform; struct snd_soc_dai *codec_dai, *cpu_dai; const char *platform_name; - +#ifdef CODEC_NAME_CMP + char *p_codec_name; + char *p_dai_codec_name; + char tmp_codec_name[50]; + char tmp_dai_codec_name[50]; + p_codec_name = tmp_codec_name; + p_dai_codec_name = tmp_dai_codec_name; +#endif if (rtd->complete) return 1; dev_dbg(card->dev, "binding %s at idx %d\n", dai_link->name, num); @@ -1354,7 +1361,15 @@ find_codec: /* no, then find CODEC from registered CODECs*/ list_for_each_entry(codec, &codec_list, list) { - if (!strcmp(codec->name, dai_link->codec_name)) { +#ifdef CODEC_NAME_CMP + strcpy(p_codec_name,codec->name); + strcpy(p_dai_codec_name,dai_link->codec_name); +#endif + if (!strcmp(codec->name, dai_link->codec_name) +#ifdef CODEC_NAME_CMP + || !strcmp(strsep(&p_codec_name,"."), strsep(&p_dai_codec_name,".")) +#endif + ) { rtd->codec = codec; /* CODEC found, so find CODEC DAI from registered DAIs from this CODEC*/ -- 2.34.1