[alsa-devel] [PATCH 9/9] ASoC: TWL4030: Add Earpiece outupt mux and volume controls
Peter Ujfalusi
peter.ujfalusi at nokia.com
Mon Nov 24 12:49:43 CET 2008
This patch adds the routing selection for the Earpiece output
and Earpiece gain control.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi at nokia.com>
---
sound/soc/codecs/twl4030.c | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/sound/soc/codecs/twl4030.c b/sound/soc/codecs/twl4030.c
index 88f5cbe..98d6bb0 100644
--- a/sound/soc/codecs/twl4030.c
+++ b/sound/soc/codecs/twl4030.c
@@ -202,6 +202,8 @@ static const char *twl4030_handsfreel_mix[] = {"Voice", "DACL1",
"DACL2", "DACR2"};
static const char *twl4030_handsfreer_mix[] = {"Voice", "DACR1",
"DACR2", "DACL2"};
+static const char *twl4030_earpiece_mix[] = {"Off", "Voice", "DACL1",
+ "DACL2", "DACR1"};
static const struct soc_enum twl4030_enum[] = {
@@ -213,6 +215,7 @@ static const struct soc_enum twl4030_enum[] = {
SOC_ENUM_SINGLE(TWL4030_REG_PRECKR_CTL, 0, 4, twl4030_carkitr_mix),
SOC_ENUM_SINGLE(TWL4030_REG_HFL_CTL, 0, 4, twl4030_handsfreel_mix),
SOC_ENUM_SINGLE(TWL4030_REG_HFR_CTL, 0, 4, twl4030_handsfreer_mix),
+ SOC_ENUM_SINGLE(TWL4030_REG_EAR_CTL, 0, 5, twl4030_earpiece_mix),
};
/*
* Some of TWL's input selection are in bitfield.
@@ -481,6 +484,12 @@ static const struct snd_kcontrol_new twl4030_snd_controls[] = {
/* Hand-free output controls*/
SOC_ENUM("HandsfreeL Playback Mux", twl4030_enum[6]),
SOC_ENUM("HandsfreeR Playback Mux", twl4030_enum[7]),
+
+ /* Earpiece output controls */
+ SOC_ENUM_EXT("Earpiece Playback Mux", twl4030_enum[8],
+ snd_soc_get_enum_twl4030, snd_soc_put_enum_twl4030),
+ SOC_SINGLE_TLV_TWL4030("Earpiece Playback Volume",
+ TWL4030_REG_EAR_CTL, 4, 3, 0, gainv1_tvl),
};
/* add non dapm controls */
--
1.6.0.3
More information about the Alsa-devel
mailing list