sound soc-core:codec_name not adapted i2c_name
authorqjb <qjb@rock-chips.com>
Wed, 5 Mar 2014 08:42:52 +0000 (16:42 +0800)
committerqjb <qjb@rock-chips.com>
Wed, 5 Mar 2014 08:43:58 +0000 (16:43 +0800)
change i2s id

arch/arm/boot/dts/rk3188-tb.dts [changed mode: 0644->0755]
arch/arm/boot/dts/rk3188.dtsi
sound/soc/soc-core.c [changed mode: 0644->0755]

old mode 100644 (file)
new mode 100755 (executable)
index ab9d2a9..74c4d0a
@@ -69,7 +69,7 @@
                dais {
                        dai0 {
                                codec-name = "rt5631.0-001a";
-                               cpu-dai-name = "rockchip-i2s.1";
+                               cpu-dai-name = "rockchip-i2s.0";
                                format = "i2s";
                                //continuous-clock;
                                //bitclock-inversion;
@@ -85,7 +85,7 @@
                dais {
                        dai0 {
                                codec-name = "rk610_codec.0-0060";
-                               cpu-dai-name = "rockchip-i2s.1";
+                               cpu-dai-name = "rockchip-i2s.0";
                                format = "i2s";
                                //continuous-clock;
                                //bitclock-inversion;
                dais {
                        dai0 {
                                codec-name = "hdmi-i2s";
-                               cpu-dai-name = "rockchip-i2s.1";
+                               cpu-dai-name = "rockchip-i2s.0";
                                format = "i2s";
                                //continuous-clock;
                                //bitclock-inversion;
index b1cb283fc93ab2a29d61b7c97851ac525e77549c..812fa29349ef235b0b69cc37c434f9aa037bf795 100755 (executable)
                pinctrl-0 = <&spdif_tx>;
        };
 
-       i2s1: rockchip-i2s@0x1011a000 {
+       i2s0: rockchip-i2s@0x1011a000 {
                compatible = "rockchip-i2s";
                reg = <0x1011a000 0x2000>;
-               i2s-id = <1>;
+               i2s-id = <0>;
                clocks = <&clk_i2s>;
                clock-names = "i2s_clk";
                interrupts = <GIC_SPI 31 IRQ_TYPE_LEVEL_HIGH>;
old mode 100644 (file)
new mode 100755 (executable)
index d56bbea..4a63b19
@@ -815,6 +815,7 @@ EXPORT_SYMBOL_GPL(snd_soc_resume);
 static const 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];
@@ -824,6 +825,14 @@ static int soc_bind_dai_link(struct snd_soc_card *card, int num)
        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
        dev_dbg(card->dev, "ASoC: binding %s at idx %d\n", dai_link->name, num);
 
        /* Find CPU DAI from registered DAIs*/
@@ -853,7 +862,15 @@ static int soc_bind_dai_link(struct snd_soc_card *card, int num)
                        if (codec->dev->of_node != dai_link->codec_of_node)
                                continue;
                } else {
-                       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
+                       )
                                continue;
                }