From: 邱建斌 Date: Mon, 14 Jan 2013 10:28:08 +0000 (+0800) Subject: sound soc-core: codec_name not adapted i2c_name X-Git-Tag: firefly_0821_release~7957^2 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=24f79221324b2937252dd1209f1b6d1fb549399d;p=firefly-linux-kernel-4.4.55.git sound soc-core: codec_name not adapted i2c_name --- 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*/