Skip to content

Commit

Permalink
ASoC: TWL4030: Change the Master volume control to TLV
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Peter Ujfalusi authored and Mark Brown committed Nov 24, 2008
1 parent f8d05bd commit c10b82c
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions sound/soc/codecs/twl4030.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#include <sound/soc.h>
#include <sound/soc-dapm.h>
#include <sound/initval.h>
#include <sound/tlv.h>

#include "twl4030.h"

Expand Down Expand Up @@ -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),
Expand Down

0 comments on commit c10b82c

Please sign in to comment.