aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoroder_chiou@realtek.com <oder_chiou@realtek.com>2017-08-13 21:46:59 -0400
committerMark Brown <broonie@kernel.org>2017-08-14 12:16:50 -0400
commitc5755fbc0702ddb38d2b476a49327b59d4d75a00 (patch)
treedf981b1a326e4ab81e48c255cbcfa7cdaf48746d
parent278982b50b28d654ff8cca0efb1ff6e835c6cc4c (diff)
ASoC: rt5663: Fine tune for the headphone output pop sound
The patch fine tunes for the headphone output pop sound. Signed-off-by: Oder Chiou <oder_chiou@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--sound/soc/codecs/rt5663.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/sound/soc/codecs/rt5663.c b/sound/soc/codecs/rt5663.c
index be93231b0f58..fdc2bbcb67c2 100644
--- a/sound/soc/codecs/rt5663.c
+++ b/sound/soc/codecs/rt5663.c
@@ -1565,6 +1565,10 @@ static int rt5663_jack_detect(struct snd_soc_codec *codec, int jack_insert)
1565 val = snd_soc_read(codec, RT5663_EM_JACK_TYPE_2) & 0x0003; 1565 val = snd_soc_read(codec, RT5663_EM_JACK_TYPE_2) & 0x0003;
1566 dev_dbg(codec->dev, "%s val = %d\n", __func__, val); 1566 dev_dbg(codec->dev, "%s val = %d\n", __func__, val);
1567 1567
1568 snd_soc_update_bits(codec, RT5663_HP_CHARGE_PUMP_1,
1569 RT5663_OSW_HP_L_MASK | RT5663_OSW_HP_R_MASK,
1570 RT5663_OSW_HP_L_EN | RT5663_OSW_HP_R_EN);
1571
1568 switch (val) { 1572 switch (val) {
1569 case 1: 1573 case 1:
1570 case 2: 1574 case 2:
@@ -2073,6 +2077,8 @@ static int rt5663_hp_event(struct snd_soc_dapm_widget *w,
2073 snd_soc_write(codec, RT5663_ANA_BIAS_CUR_1, 0x7766); 2077 snd_soc_write(codec, RT5663_ANA_BIAS_CUR_1, 0x7766);
2074 snd_soc_write(codec, RT5663_HP_BIAS, 0xafaa); 2078 snd_soc_write(codec, RT5663_HP_BIAS, 0xafaa);
2075 snd_soc_write(codec, RT5663_CHARGE_PUMP_2, 0x7777); 2079 snd_soc_write(codec, RT5663_CHARGE_PUMP_2, 0x7777);
2080 snd_soc_update_bits(codec, RT5663_STO_DRE_1, 0x8000,
2081 0x8000);
2076 snd_soc_update_bits(codec, RT5663_DEPOP_1, 0x3000, 2082 snd_soc_update_bits(codec, RT5663_DEPOP_1, 0x3000,
2077 0x3000); 2083 0x3000);
2078 } 2084 }
@@ -2105,14 +2111,19 @@ static int rt5663_charge_pump_event(struct snd_soc_dapm_widget *w,
2105 2111
2106 switch (event) { 2112 switch (event) {
2107 case SND_SOC_DAPM_PRE_PMU: 2113 case SND_SOC_DAPM_PRE_PMU:
2108 if (rt5663->codec_ver == CODEC_VER_0) 2114 if (rt5663->codec_ver == CODEC_VER_0) {
2109 snd_soc_update_bits(codec, RT5663_DEPOP_1, 0x003b, 2115 snd_soc_update_bits(codec, RT5663_DEPOP_1, 0x0030,
2110 0x003b); 2116 0x0030);
2117 snd_soc_update_bits(codec, RT5663_DEPOP_1, 0x0003,
2118 0x0003);
2119 }
2111 break; 2120 break;
2112 2121
2113 case SND_SOC_DAPM_POST_PMD: 2122 case SND_SOC_DAPM_POST_PMD:
2114 if (rt5663->codec_ver == CODEC_VER_0) 2123 if (rt5663->codec_ver == CODEC_VER_0) {
2115 snd_soc_update_bits(codec, RT5663_DEPOP_1, 0x003b, 0); 2124 snd_soc_update_bits(codec, RT5663_DEPOP_1, 0x0003, 0);
2125 snd_soc_update_bits(codec, RT5663_DEPOP_1, 0x0030, 0);
2126 }
2116 break; 2127 break;
2117 2128
2118 default: 2129 default: