aboutsummaryrefslogtreecommitdiff
path: root/sound/soc
diff options
context:
space:
mode:
authorPeter Ujfalusi <peter.ujfalusi@nokia.com>2008-11-24 13:49:35 +0200
committerMark Brown <broonie@opensource.wolfsonmicro.com>2008-11-24 14:05:39 +0000
commitc10b82cf085c38f2568609ffb10a6d725130f389 (patch)
treef7736f2799e855a1f0516d950b9c50101e3d1973 /sound/soc
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')
-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 49c7da39497..498c42f7c6e 100644
--- a/sound/soc/codecs/twl4030.c
+++ b/sound/soc/codecs/twl4030.c
@@ -33,6 +33,7 @@
#include <sound/soc.h>
#include <sound/soc-dapm.h>
#include <sound/initval.h>
+#include <sound/tlv.h>
#include "twl4030.h"
@@ -189,10 +190,16 @@ static void twl4030_init_chip(struct snd_soc_codec *codec)
}
+/*
+ * FGAIN volume control:
+ * from -62 to 0 dB in 1 dB steps (mute instead of -63 dB)
+ */
+static DECLARE_TLV_DB_SCALE(master_tlv, -6300, 100, 1);
+
static const struct snd_kcontrol_new twl4030_snd_controls[] = {
- SOC_DOUBLE_R("Master Playback Volume",
+ SOC_DOUBLE_R_TLV("Master Playback Volume",
TWL4030_REG_ARXL2PGA, TWL4030_REG_ARXR2PGA,
- 0, 0x3f, 0),
+ 0, 0x3f, 0, master_tlv),
SOC_DOUBLE_R("Capture Volume",
TWL4030_REG_ATXL1PGA, TWL4030_REG_ATXR1PGA,
0, 0x1f, 0),