rt3261: fix two little issue.
author宋秀杰 <sxj@rock-chips.com>
Mon, 21 Jan 2013 07:12:10 +0000 (15:12 +0800)
committer宋秀杰 <sxj@rock-chips.com>
Mon, 21 Jan 2013 07:12:10 +0000 (15:12 +0800)
sound/soc/codecs/rt3261.c
sound/soc/rk29/rk29_rt3261.c

index 5ab69f2d7e50e7b43783abec9c1207610d82a83b..56718b90022019f3c3fd22f59a01fd56733ba3e9 100644 (file)
@@ -565,6 +565,10 @@ int rt3261_headset_mic_detect(int jack_insert)
        int sclk_src;
 #endif
 
+       if(rt3261_codec == NULL){
+               return -1;
+       }
+
        if(jack_insert) {
                if (SND_SOC_BIAS_OFF == rt3261_codec->dapm.bias_level) {
                        snd_soc_write(rt3261_codec, RT3261_PWR_ANLG1, 0x2004);
index 09117cf5a2278d84f9af8dec1ff2e9daba50861b..ba6db7f393c35aa0e66cc071a050c2db495d7a46 100644 (file)
@@ -258,7 +258,11 @@ static struct snd_soc_dai_link rk29_dai[] = {
                .stream_name = "RT3261 PCM",
                .codec_name = "rt3261.0-001c",
                .platform_name = "rockchip-audio",
-               .cpu_dai_name = "rk29_i2s.0",
+               #if defined(CONFIG_SND_RK29_SOC_I2S_8CH)    
+                       .cpu_dai_name = "rk29_i2s.0",
+               #elif defined(CONFIG_SND_RK29_SOC_I2S_2CH)
+                       .cpu_dai_name = "rk29_i2s.1",
+               #endif
                .codec_dai_name = "rt3261-aif1",
                .init = rk29_rt3261_init,
                .ops = &rk29_ops,
@@ -268,7 +272,11 @@ static struct snd_soc_dai_link rk29_dai[] = {
                .stream_name = "RT3261 PCM",
                .codec_name = "rt3261.0-001c",
                .platform_name = "rockchip-audio",
-               .cpu_dai_name = "rk29_i2s.0",
+               #if defined(CONFIG_SND_RK29_SOC_I2S_8CH)    
+                       .cpu_dai_name = "rk29_i2s.0",
+               #elif defined(CONFIG_SND_RK29_SOC_I2S_2CH)
+                       .cpu_dai_name = "rk29_i2s.1",
+               #endif 
                .codec_dai_name = "rt3261-aif2",
                .ops = &rt3261_voice_ops,
        },