summaryrefslogtreecommitdiff
path: root/sound/soc/codecs/twl6040.c
diff options
context:
space:
mode:
authorPeter Ujfalusi <peter.ujfalusi@ti.com>2011-09-22 11:05:45 +0300
committerMark Brown <broonie@opensource.wolfsonmicro.com>2011-09-22 17:20:21 +0100
commit3acef6854c440b29f20d7ea0ec5f4707aad23923 (patch)
tree80c1ac8cd523405507c02ea3858be3714c89b06f /sound/soc/codecs/twl6040.c
parentfadd81b52cf1f0a0f9be240ad56a86d20663b065 (diff)
ASoC: twl6040: Lower the power on gain values at startup
The default gains on outputs/inputs are set to 0dB. This is fixing the pop noise issue at the first playback, which caused by the wrong starting point of the ramp code. The ramp code for the outputs expects the gains to be in their lowest configuration in order to be effective. After the playback stops, the ramp code takes care of ramping down the gains to their minimum. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Acked-by: Liam Girdwood <lrg@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/codecs/twl6040.c')
-rw-r--r--sound/soc/codecs/twl6040.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/sound/soc/codecs/twl6040.c b/sound/soc/codecs/twl6040.c
index 81645c632447..0694d65f9de3 100644
--- a/sound/soc/codecs/twl6040.c
+++ b/sound/soc/codecs/twl6040.c
@@ -269,6 +269,17 @@ static void twl6040_init_chip(struct snd_soc_codec *codec)
/* No imput selected for microphone amplifiers */
twl6040_write_reg_cache(codec, TWL6040_REG_MICLCTL, 0x18);
twl6040_write_reg_cache(codec, TWL6040_REG_MICRCTL, 0x18);
+
+ /*
+ * We need to lower the default gain values, so the ramp code
+ * can work correctly for the first playback.
+ * This reduces the pop noise heard at the first playback.
+ */
+ twl6040_write_reg_cache(codec, TWL6040_REG_HSGAIN, 0xff);
+ twl6040_write_reg_cache(codec, TWL6040_REG_EARCTL, 0x1e);
+ twl6040_write_reg_cache(codec, TWL6040_REG_HFLGAIN, 0x1d);
+ twl6040_write_reg_cache(codec, TWL6040_REG_HFRGAIN, 0x1d);
+ twl6040_write_reg_cache(codec, TWL6040_REG_LINEGAIN, 0);
}
static void twl6040_restore_regs(struct snd_soc_codec *codec)