diff options
author | Peter Ujfalusi <peter.ujfalusi@nokia.com> | 2008-12-09 05:35:47 -0500 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2008-12-09 05:49:22 -0500 |
commit | 5e98a46449cd028b9b97a8ef2c2448c8f473d6c5 (patch) | |
tree | 19e814134134fa484be01c8547588dd41662d15f /sound/soc | |
parent | e8ff9c417ad6e8f7ef253e36f9d6e22dc2aa2512 (diff) |
ASoC: TWL4030: DAPM mapping of the Earpiece output
Adds DAPM muxing, routing for the Earpiece output.
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.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/sound/soc/codecs/twl4030.c b/sound/soc/codecs/twl4030.c index 9d1078325c3d..1da46175519e 100644 --- a/sound/soc/codecs/twl4030.c +++ b/sound/soc/codecs/twl4030.c | |||
@@ -190,6 +190,19 @@ static void twl4030_init_chip(struct snd_soc_codec *codec) | |||
190 | 190 | ||
191 | } | 191 | } |
192 | 192 | ||
193 | /* Earpiece */ | ||
194 | static const char *twl4030_earpiece_texts[] = | ||
195 | {"Off", "DACL1", "DACL2", "Invalid", | ||
196 | "DACR1"}; | ||
197 | |||
198 | static const struct soc_enum twl4030_earpiece_enum = | ||
199 | SOC_ENUM_SINGLE(TWL4030_REG_EAR_CTL, 1, | ||
200 | ARRAY_SIZE(twl4030_earpiece_texts), | ||
201 | twl4030_earpiece_texts); | ||
202 | |||
203 | static const struct snd_kcontrol_new twl4030_dapm_earpiece_control = | ||
204 | SOC_DAPM_ENUM("Route", twl4030_earpiece_enum); | ||
205 | |||
193 | static int outmixer_event(struct snd_soc_dapm_widget *w, | 206 | static int outmixer_event(struct snd_soc_dapm_widget *w, |
194 | struct snd_kcontrol *kcontrol, int event) | 207 | struct snd_kcontrol *kcontrol, int event) |
195 | { | 208 | { |
@@ -645,6 +658,7 @@ static const struct snd_soc_dapm_widget twl4030_dapm_widgets[] = { | |||
645 | 658 | ||
646 | SND_SOC_DAPM_OUTPUT("OUTL"), | 659 | SND_SOC_DAPM_OUTPUT("OUTL"), |
647 | SND_SOC_DAPM_OUTPUT("OUTR"), | 660 | SND_SOC_DAPM_OUTPUT("OUTR"), |
661 | SND_SOC_DAPM_OUTPUT("EARPIECE"), | ||
648 | 662 | ||
649 | /* DACs */ | 663 | /* DACs */ |
650 | SND_SOC_DAPM_DAC("DACR1", "Right Front Playback", | 664 | SND_SOC_DAPM_DAC("DACR1", "Right Front Playback", |
@@ -666,6 +680,12 @@ static const struct snd_soc_dapm_widget twl4030_dapm_widgets[] = { | |||
666 | SND_SOC_DAPM_PGA("ARXL2_APGA", TWL4030_REG_ARXL2_APGA_CTL, | 680 | SND_SOC_DAPM_PGA("ARXL2_APGA", TWL4030_REG_ARXL2_APGA_CTL, |
667 | 0, 0, NULL, 0), | 681 | 0, 0, NULL, 0), |
668 | 682 | ||
683 | /* Output MUX controls */ | ||
684 | /* Earpiece */ | ||
685 | SND_SOC_DAPM_MUX_E("Earpiece Mux", SND_SOC_NOPM, 0, 0, | ||
686 | &twl4030_dapm_earpiece_control, outmixer_event, | ||
687 | SND_SOC_DAPM_PRE_REG), | ||
688 | |||
669 | SND_SOC_DAPM_ADC("ADCL", "Left Capture", SND_SOC_NOPM, 0, 0), | 689 | SND_SOC_DAPM_ADC("ADCL", "Left Capture", SND_SOC_NOPM, 0, 0), |
670 | SND_SOC_DAPM_ADC("ADCR", "Right Capture", SND_SOC_NOPM, 0, 0), | 690 | SND_SOC_DAPM_ADC("ADCR", "Right Capture", SND_SOC_NOPM, 0, 0), |
671 | }; | 691 | }; |
@@ -676,9 +696,16 @@ static const struct snd_soc_dapm_route intercon[] = { | |||
676 | {"ARXL2_APGA", NULL, "DACL2"}, | 696 | {"ARXL2_APGA", NULL, "DACL2"}, |
677 | {"ARXR2_APGA", NULL, "DACR2"}, | 697 | {"ARXR2_APGA", NULL, "DACR2"}, |
678 | 698 | ||
699 | /* Internal playback routings */ | ||
700 | /* Earpiece */ | ||
701 | {"Earpiece Mux", "DACL1", "ARXL1_APGA"}, | ||
702 | {"Earpiece Mux", "DACL2", "ARXL2_APGA"}, | ||
703 | {"Earpiece Mux", "DACR1", "ARXR1_APGA"}, | ||
704 | |||
679 | /* outputs */ | 705 | /* outputs */ |
680 | {"OUTL", NULL, "ARXL2_APGA"}, | 706 | {"OUTL", NULL, "ARXL2_APGA"}, |
681 | {"OUTR", NULL, "ARXR2_APGA"}, | 707 | {"OUTR", NULL, "ARXR2_APGA"}, |
708 | {"EARPIECE", NULL, "Earpiece Mux"}, | ||
682 | 709 | ||
683 | /* inputs */ | 710 | /* inputs */ |
684 | {"ADCL", NULL, "INL"}, | 711 | {"ADCL", NULL, "INL"}, |