aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/twl4030.c
diff options
context:
space:
mode:
authorPeter Ujfalusi <peter.ujfalusi@nokia.com>2008-11-24 06:49:35 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2008-11-24 09:05:39 -0500
commitc10b82cf085c38f2568609ffb10a6d725130f389 (patch)
treef7736f2799e855a1f0516d950b9c50101e3d1973 /sound/soc/codecs/twl4030.c
parentf8d05bdbb07458e5f2c6a8281bde08056836fea6 (diff)
ASoC: TWL4030: Change the Master volume control to TLV
TWL4030 FGAIN volume control has a range: -62 to 0 dB in 1 dB steps, 0 in the FGAIN means mute. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/codecs/twl4030.c')
-rw-r--r--sound/soc/codecs/twl4030.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/sound/soc/codecs/twl4030.c b/sound/soc/codecs/twl4030.c
index 49c7da39497e..498c42f7c6e0 100644
--- a/sound/soc/codecs/twl4030.c
+++ b/sound/soc/codecs/twl4030.c
@@ -33,6 +33,7 @@
33#include <sound/soc.h> 33#include <sound/soc.h>
34#include <sound/soc-dapm.h> 34#include <sound/soc-dapm.h>
35#include <sound/initval.h> 35#include <sound/initval.h>
36#include <sound/tlv.h>
36 37
37#include "twl4030.h" 38#include "twl4030.h"
38 39
@@ -189,10 +190,16 @@ static void twl4030_init_chip(struct snd_soc_codec *codec)
189 190
190} 191}
191 192
193/*
194 * FGAIN volume control:
195 * from -62 to 0 dB in 1 dB steps (mute instead of -63 dB)
196 */
197static DECLARE_TLV_DB_SCALE(master_tlv, -6300, 100, 1);
198
192static const struct snd_kcontrol_new twl4030_snd_controls[] = { 199static const struct snd_kcontrol_new twl4030_snd_controls[] = {
193 SOC_DOUBLE_R("Master Playback Volume", 200 SOC_DOUBLE_R_TLV("Master Playback Volume",
194 TWL4030_REG_ARXL2PGA, TWL4030_REG_ARXR2PGA, 201 TWL4030_REG_ARXL2PGA, TWL4030_REG_ARXR2PGA,
195 0, 0x3f, 0), 202 0, 0x3f, 0, master_tlv),
196 SOC_DOUBLE_R("Capture Volume", 203 SOC_DOUBLE_R("Capture Volume",
197 TWL4030_REG_ATXL1PGA, TWL4030_REG_ATXR1PGA, 204 TWL4030_REG_ATXL1PGA, TWL4030_REG_ATXR1PGA,
198 0, 0x1f, 0), 205 0, 0x1f, 0),