Richtek5512 codec: fix DAPM error
authorzhangjun <zhangjun@rock-chips.com>
Fri, 23 Aug 2013 01:22:22 +0000 (09:22 +0800)
committerzhangjun <zhangjun@rock-chips.com>
Fri, 23 Aug 2013 01:22:22 +0000 (09:22 +0800)
sound/soc/codecs/rt5512.c
sound/soc/rk29/rk29_rt5512.c

index 171634d9d77e4c16dcda0751ed8a05dc3b69ec84..90b036082d9f9ce5e8a69c2e0d400c0dbcf67532 100755 (executable)
@@ -184,8 +184,8 @@ static struct rt5512_init_reg init_list[] = {
     {0x8c , 0x09},
     {0xec , 0x27c},
     /*record*/
-    {0x95 , 0xa0},
-    {0x85 , 0x20},  
+    {0x95 , 0x82},
+    {0x85 , 0x30},  
 };
 #define RT5512_INIT_REG_LEN ARRAY_SIZE(init_list)
 
@@ -631,9 +631,9 @@ static int rt5512_capture_path_put(struct snd_kcontrol *kcontrol,
               
                        case Main_Mic:
                 RT_DBG(">>>>>>>>>>>>>>>>%s Main_Mic",__FUNCTION__); 
-                /*record gain*/
+                /*Mic2 record gain*/
                 snd_soc_update_bits(codec, 0x93, 0x1f, 0x15);
-                snd_soc_update_bits(codec, 0x96, 0x0c, 0x02);
+                snd_soc_update_bits(codec, 0x97, 0x0c, 0x08);
                 snd_soc_dapm_enable_pin(dapm, "Main Mic");
                 snd_soc_dapm_disable_pin(dapm, "LineIn");
                 snd_soc_dapm_sync(dapm);
@@ -644,6 +644,9 @@ static int rt5512_capture_path_put(struct snd_kcontrol *kcontrol,
                 
                        case Hands_Free_Mic:
                 RT_DBG(">>>>>>>>>>>>>>>>%s Hands_Free_Mic",__FUNCTION__);
+                /*Aux record gain*/
+                snd_soc_update_bits(codec, 0x91, 0x1f, 0x15);
+                snd_soc_update_bits(codec, 0x96, 0xc0, 0x80);
                                snd_soc_dapm_disable_pin(dapm, "Main Mic");
                 snd_soc_dapm_enable_pin(dapm, "LineIn");
                 snd_soc_dapm_sync(dapm);
@@ -1162,7 +1165,7 @@ static const struct snd_soc_dapm_widget rt5512_dapm_widgets[] =
        SND_SOC_DAPM_OUTPUT("RHeadphone"),
        //MicBias
        SND_SOC_DAPM_MICBIAS("MicBias1", 0x81, 5, 0),
-       SND_SOC_DAPM_MICBIAS("MicBias2", 0x81, 4, 0),
+       SND_SOC_DAPM_MICBIAS("MicBias2", 0x81, 5, 0),
 };
 
 static const struct snd_soc_dapm_route rt5512_dapm_routes[] = 
index 2fc769869ae618b64ecaf4540e0610bfa3e915b3..0d30236738e8303036eadaa7953306f314c1c16d 100755 (executable)
@@ -186,7 +186,8 @@ static const struct snd_soc_dapm_route rt5512_audio_map[] = {
        // Input
        {"MicBias1", NULL,"Main Mic"},
        {"Mic2", NULL, "MicBias1"},
-       {"Aux", NULL, "LineIn"},
+    {"MicBias2", NULL, "LineIn"},
+    {"Aux", NULL, "MicBias2"},
        // Output
        {"Ext Spk", NULL, "LSpeaker"},
        {"Ext Spk", NULL, "RSpeaker"},
@@ -286,17 +287,7 @@ static int rt5512_init(struct snd_soc_pcm_runtime *rtd)
 static struct snd_soc_dai_link rk29_dai[] = {
        { /* Primary DAI i/f */
                .name = "RT5512 AIF1",
-               .stream_name = "Playback",
-               .cpu_dai_name = "rk29_i2s.1",
-               .codec_dai_name = "RT5512-aif1",
-               .platform_name = "rockchip-audio",
-               .codec_name = "rt5512.1-0018",
-               .init = rt5512_init,
-               .ops = &rk29_ops,
-       },
-       { /* Sec_Fifo DAI i/f */
-               .name = "RT5512 AIF2",
-               .stream_name = "Capture",
+               .stream_name = "RT5512 PCM",
                .cpu_dai_name = "rk29_i2s.1",
                .codec_dai_name = "RT5512-aif1",
                .platform_name = "rockchip-audio",