From 3b92924871266a29acb824f6a76bda46efce4eee Mon Sep 17 00:00:00 2001 From: zhangjun Date: Fri, 23 Aug 2013 09:22:22 +0800 Subject: [PATCH] Richtek5512 codec: fix DAPM error --- sound/soc/codecs/rt5512.c | 13 ++++++++----- sound/soc/rk29/rk29_rt5512.c | 15 +++------------ 2 files changed, 11 insertions(+), 17 deletions(-) diff --git a/sound/soc/codecs/rt5512.c b/sound/soc/codecs/rt5512.c index 171634d9d77e..90b036082d9f 100755 --- a/sound/soc/codecs/rt5512.c +++ b/sound/soc/codecs/rt5512.c @@ -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[] = diff --git a/sound/soc/rk29/rk29_rt5512.c b/sound/soc/rk29/rk29_rt5512.c index 2fc769869ae6..0d30236738e8 100755 --- a/sound/soc/rk29/rk29_rt5512.c +++ b/sound/soc/rk29/rk29_rt5512.c @@ -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", -- 2.34.1