[alsa-devel] [PATCH 6/9] ASoC: TWL4030: Add Headset outupt mux and volume controls

Peter Ujfalusi peter.ujfalusi at nokia.com
Mon Nov 24 12:49:40 CET 2008


This patch adds the routing selection for the headset output
and Headset gain control.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi at nokia.com>
---
 sound/soc/codecs/twl4030.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/sound/soc/codecs/twl4030.c b/sound/soc/codecs/twl4030.c
index cee52ab..b3cd498 100644
--- a/sound/soc/codecs/twl4030.c
+++ b/sound/soc/codecs/twl4030.c
@@ -194,11 +194,15 @@ static const char *twl4030_predrivl_mix[] = {"Off", "Voice", "DACL1",
 					    "DACL2", "DACR2"};
 static const char *twl4030_predrivr_mix[] = {"Off", "Voice", "DACR1",
 					    "DACR2", "DACL2"};
+static const char *twl4030_hsoutl_mix[] = {"Off", "Voice", "DACL1", "DACL2"};
+static const char *twl4030_hsoutr_mix[] = {"Off", "Voice", "DACR1", "DACR2"};
 
 
 static const struct soc_enum twl4030_enum[] = {
 	SOC_ENUM_SINGLE(TWL4030_REG_PREDL_CTL, 0, 5, twl4030_predrivl_mix),
 	SOC_ENUM_SINGLE(TWL4030_REG_PREDR_CTL, 0, 5, twl4030_predrivr_mix),
+	SOC_ENUM_SINGLE(TWL4030_REG_HS_SEL, 0, 4, twl4030_hsoutl_mix),
+	SOC_ENUM_SINGLE(TWL4030_REG_HS_SEL, 3, 4, twl4030_hsoutr_mix),
 };
 /*
  * Some of TWL's input selection are in bitfield.
@@ -447,6 +451,14 @@ static const struct snd_kcontrol_new twl4030_snd_controls[] = {
 		 TWL4030_REG_PREDL_CTL, TWL4030_REG_PREDR_CTL,
 		4, 3, 0, gainv1_tvl),
 
+	/* Headset output controls*/
+	SOC_ENUM_EXT("HeadsetL Playback Mux", twl4030_enum[2],
+		     snd_soc_get_enum_twl4030, snd_soc_put_enum_twl4030),
+	SOC_ENUM_EXT("HeadsetR Playback Mux", twl4030_enum[3],
+		     snd_soc_get_enum_twl4030, snd_soc_put_enum_twl4030),
+	SOC_DOUBLE_TLV_TWL4030("Headset Playback Volume",
+		 TWL4030_REG_HS_GAIN_SET, 0, 2, 3, 0, gainv1_tvl),
+
 };
 
 /* add non dapm controls */
-- 
1.6.0.3



More information about the Alsa-devel mailing list