diff options
author | Bard Liao <bardliao@realtek.com> | 2014-07-07 07:15:30 -0400 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2014-07-07 10:38:44 -0400 |
commit | bc6c4e455af9037bae619340bc95bf569806ba8b (patch) | |
tree | e5d9c7545b2690ecfb11ac4efa2f3cb75f640a12 | |
parent | 61a414c412886bdb98c8842c00b2f0a3d4436b12 (diff) |
ASoC: RT286: Fix silent at the beginning of stream
This patch fix the issue that the output is almost silent at the
beginning of starting a playback.
Signed-off-by: Bard Liao <bardliao@realtek.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
-rw-r--r-- | sound/soc/codecs/rt286.c | 20 | ||||
-rw-r--r-- | sound/soc/codecs/rt286.h | 5 |
2 files changed, 24 insertions, 1 deletions
diff --git a/sound/soc/codecs/rt286.c b/sound/soc/codecs/rt286.c index e6f33ab78954..81033154a412 100644 --- a/sound/soc/codecs/rt286.c +++ b/sound/soc/codecs/rt286.c | |||
@@ -54,6 +54,7 @@ static struct reg_default rt286_index_def[] = { | |||
54 | { 0x09, 0xd810 }, | 54 | { 0x09, 0xd810 }, |
55 | { 0x0a, 0x0060 }, | 55 | { 0x0a, 0x0060 }, |
56 | { 0x0b, 0x0000 }, | 56 | { 0x0b, 0x0000 }, |
57 | { 0x0d, 0x2800 }, | ||
57 | { 0x0f, 0x0000 }, | 58 | { 0x0f, 0x0000 }, |
58 | { 0x19, 0x0a17 }, | 59 | { 0x19, 0x0a17 }, |
59 | { 0x20, 0x0020 }, | 60 | { 0x20, 0x0020 }, |
@@ -62,6 +63,9 @@ static struct reg_default rt286_index_def[] = { | |||
62 | { 0x4f, 0x50e9 }, | 63 | { 0x4f, 0x50e9 }, |
63 | { 0x50, 0x2c00 }, | 64 | { 0x50, 0x2c00 }, |
64 | { 0x63, 0x2902 }, | 65 | { 0x63, 0x2902 }, |
66 | { 0x67, 0x1111 }, | ||
67 | { 0x68, 0x1016 }, | ||
68 | { 0x69, 0x273f }, | ||
65 | }; | 69 | }; |
66 | #define INDEX_CACHE_SIZE ARRAY_SIZE(rt286_index_def) | 70 | #define INDEX_CACHE_SIZE ARRAY_SIZE(rt286_index_def) |
67 | 71 | ||
@@ -902,14 +906,23 @@ static int rt286_set_bias_level(struct snd_soc_codec *codec, | |||
902 | { | 906 | { |
903 | switch (level) { | 907 | switch (level) { |
904 | case SND_SOC_BIAS_PREPARE: | 908 | case SND_SOC_BIAS_PREPARE: |
905 | if (SND_SOC_BIAS_STANDBY == codec->dapm.bias_level) | 909 | if (SND_SOC_BIAS_STANDBY == codec->dapm.bias_level) { |
906 | snd_soc_write(codec, | 910 | snd_soc_write(codec, |
907 | RT286_SET_AUDIO_POWER, AC_PWRST_D0); | 911 | RT286_SET_AUDIO_POWER, AC_PWRST_D0); |
912 | snd_soc_update_bits(codec, | ||
913 | RT286_DC_GAIN, 0x200, 0x200); | ||
914 | } | ||
915 | break; | ||
916 | |||
917 | case SND_SOC_BIAS_ON: | ||
918 | mdelay(10); | ||
908 | break; | 919 | break; |
909 | 920 | ||
910 | case SND_SOC_BIAS_STANDBY: | 921 | case SND_SOC_BIAS_STANDBY: |
911 | snd_soc_write(codec, | 922 | snd_soc_write(codec, |
912 | RT286_SET_AUDIO_POWER, AC_PWRST_D3); | 923 | RT286_SET_AUDIO_POWER, AC_PWRST_D3); |
924 | snd_soc_update_bits(codec, | ||
925 | RT286_DC_GAIN, 0x200, 0x0); | ||
913 | break; | 926 | break; |
914 | 927 | ||
915 | default: | 928 | default: |
@@ -1152,6 +1165,11 @@ static int rt286_i2c_probe(struct i2c_client *i2c, | |||
1152 | /*Power down LDO2*/ | 1165 | /*Power down LDO2*/ |
1153 | regmap_update_bits(rt286->regmap, RT286_POWER_CTRL2, 0x8, 0x0); | 1166 | regmap_update_bits(rt286->regmap, RT286_POWER_CTRL2, 0x8, 0x0); |
1154 | 1167 | ||
1168 | /*Set depop parameter*/ | ||
1169 | regmap_update_bits(rt286->regmap, RT286_DEPOP_CTRL2, 0x403a, 0x401a); | ||
1170 | regmap_update_bits(rt286->regmap, RT286_DEPOP_CTRL3, 0xf777, 0x4737); | ||
1171 | regmap_update_bits(rt286->regmap, RT286_DEPOP_CTRL4, 0x00ff, 0x003f); | ||
1172 | |||
1155 | if (rt286->i2c->irq) { | 1173 | if (rt286->i2c->irq) { |
1156 | regmap_update_bits(rt286->regmap, | 1174 | regmap_update_bits(rt286->regmap, |
1157 | RT286_IRQ_CTRL, 0x2, 0x2); | 1175 | RT286_IRQ_CTRL, 0x2, 0x2); |
diff --git a/sound/soc/codecs/rt286.h b/sound/soc/codecs/rt286.h index 21c570f88e9b..b539b7320a79 100644 --- a/sound/soc/codecs/rt286.h +++ b/sound/soc/codecs/rt286.h | |||
@@ -127,6 +127,7 @@ | |||
127 | #define RT286_I2S_CTRL1 0x09 | 127 | #define RT286_I2S_CTRL1 0x09 |
128 | #define RT286_I2S_CTRL2 0x0a | 128 | #define RT286_I2S_CTRL2 0x0a |
129 | #define RT286_CLK_DIV 0x0b | 129 | #define RT286_CLK_DIV 0x0b |
130 | #define RT286_DC_GAIN 0x0d | ||
130 | #define RT286_POWER_CTRL3 0x0f | 131 | #define RT286_POWER_CTRL3 0x0f |
131 | #define RT286_MIC1_DET_CTRL 0x19 | 132 | #define RT286_MIC1_DET_CTRL 0x19 |
132 | #define RT286_MISC_CTRL1 0x20 | 133 | #define RT286_MISC_CTRL1 0x20 |
@@ -135,6 +136,10 @@ | |||
135 | #define RT286_CBJ_CTRL1 0x4f | 136 | #define RT286_CBJ_CTRL1 0x4f |
136 | #define RT286_CBJ_CTRL2 0x50 | 137 | #define RT286_CBJ_CTRL2 0x50 |
137 | #define RT286_PLL_CTRL 0x63 | 138 | #define RT286_PLL_CTRL 0x63 |
139 | #define RT286_DEPOP_CTRL1 0x66 | ||
140 | #define RT286_DEPOP_CTRL2 0x67 | ||
141 | #define RT286_DEPOP_CTRL3 0x68 | ||
142 | #define RT286_DEPOP_CTRL4 0x69 | ||
138 | 143 | ||
139 | /* SPDIF (0x06) */ | 144 | /* SPDIF (0x06) */ |
140 | #define RT286_SPDIF_SEL_SFT 0 | 145 | #define RT286_SPDIF_SEL_SFT 0 |