diff options
author | Peter Ujfalusi <peter.ujfalusi@nokia.com> | 2008-12-09 05:35:49 -0500 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2008-12-09 05:49:23 -0500 |
commit | dfad21a26f5b3cc379fbec9c5d12b5106dd1f9c5 (patch) | |
tree | 43c50e5e2f21886d79ab7934f69e545447f626eb /sound/soc | |
parent | 2a6f5c5892dcd17c81204fe5e26b92a37d2daafa (diff) |
ASoC: TWL4030: DAPM mapping of the Headset outputs
Adds DAPM muxing, routing for the Headset outputs.
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 | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/sound/soc/codecs/twl4030.c b/sound/soc/codecs/twl4030.c index c508344241e9..86ff5a9ffa7f 100644 --- a/sound/soc/codecs/twl4030.c +++ b/sound/soc/codecs/twl4030.c | |||
@@ -229,6 +229,30 @@ static const struct soc_enum twl4030_predriver_enum = | |||
229 | static const struct snd_kcontrol_new twl4030_dapm_predriver_control = | 229 | static const struct snd_kcontrol_new twl4030_dapm_predriver_control = |
230 | SOC_DAPM_ENUM("Route", twl4030_predriver_enum); | 230 | SOC_DAPM_ENUM("Route", twl4030_predriver_enum); |
231 | 231 | ||
232 | /* Headset Left */ | ||
233 | static const char *twl4030_hsol_texts[] = | ||
234 | {"Off", "DACL1", "DACL2"}; | ||
235 | |||
236 | static const struct soc_enum twl4030_hsol_enum = | ||
237 | SOC_ENUM_SINGLE(TWL4030_REG_HS_SEL, 1, | ||
238 | ARRAY_SIZE(twl4030_hsol_texts), | ||
239 | twl4030_hsol_texts); | ||
240 | |||
241 | static const struct snd_kcontrol_new twl4030_dapm_hsol_control = | ||
242 | SOC_DAPM_ENUM("Route", twl4030_hsol_enum); | ||
243 | |||
244 | /* Headset Right */ | ||
245 | static const char *twl4030_hsor_texts[] = | ||
246 | {"Off", "DACR1", "DACR2"}; | ||
247 | |||
248 | static const struct soc_enum twl4030_hsor_enum = | ||
249 | SOC_ENUM_SINGLE(TWL4030_REG_HS_SEL, 4, | ||
250 | ARRAY_SIZE(twl4030_hsor_texts), | ||
251 | twl4030_hsor_texts); | ||
252 | |||
253 | static const struct snd_kcontrol_new twl4030_dapm_hsor_control = | ||
254 | SOC_DAPM_ENUM("Route", twl4030_hsor_enum); | ||
255 | |||
232 | static int outmixer_event(struct snd_soc_dapm_widget *w, | 256 | static int outmixer_event(struct snd_soc_dapm_widget *w, |
233 | struct snd_kcontrol *kcontrol, int event) | 257 | struct snd_kcontrol *kcontrol, int event) |
234 | { | 258 | { |
@@ -687,6 +711,8 @@ static const struct snd_soc_dapm_widget twl4030_dapm_widgets[] = { | |||
687 | SND_SOC_DAPM_OUTPUT("EARPIECE"), | 711 | SND_SOC_DAPM_OUTPUT("EARPIECE"), |
688 | SND_SOC_DAPM_OUTPUT("PREDRIVEL"), | 712 | SND_SOC_DAPM_OUTPUT("PREDRIVEL"), |
689 | SND_SOC_DAPM_OUTPUT("PREDRIVER"), | 713 | SND_SOC_DAPM_OUTPUT("PREDRIVER"), |
714 | SND_SOC_DAPM_OUTPUT("HSOL"), | ||
715 | SND_SOC_DAPM_OUTPUT("HSOR"), | ||
690 | 716 | ||
691 | /* DACs */ | 717 | /* DACs */ |
692 | SND_SOC_DAPM_DAC("DACR1", "Right Front Playback", | 718 | SND_SOC_DAPM_DAC("DACR1", "Right Front Playback", |
@@ -720,6 +746,11 @@ static const struct snd_soc_dapm_widget twl4030_dapm_widgets[] = { | |||
720 | SND_SOC_DAPM_MUX_E("PredriveR Mux", SND_SOC_NOPM, 0, 0, | 746 | SND_SOC_DAPM_MUX_E("PredriveR Mux", SND_SOC_NOPM, 0, 0, |
721 | &twl4030_dapm_predriver_control, outmixer_event, | 747 | &twl4030_dapm_predriver_control, outmixer_event, |
722 | SND_SOC_DAPM_PRE_REG), | 748 | SND_SOC_DAPM_PRE_REG), |
749 | /* HeadsetL/R */ | ||
750 | SND_SOC_DAPM_MUX("HeadsetL Mux", SND_SOC_NOPM, 0, 0, | ||
751 | &twl4030_dapm_hsol_control), | ||
752 | SND_SOC_DAPM_MUX("HeadsetR Mux", SND_SOC_NOPM, 0, 0, | ||
753 | &twl4030_dapm_hsor_control), | ||
723 | 754 | ||
724 | SND_SOC_DAPM_ADC("ADCL", "Left Capture", SND_SOC_NOPM, 0, 0), | 755 | SND_SOC_DAPM_ADC("ADCL", "Left Capture", SND_SOC_NOPM, 0, 0), |
725 | SND_SOC_DAPM_ADC("ADCR", "Right Capture", SND_SOC_NOPM, 0, 0), | 756 | SND_SOC_DAPM_ADC("ADCR", "Right Capture", SND_SOC_NOPM, 0, 0), |
@@ -744,6 +775,12 @@ static const struct snd_soc_dapm_route intercon[] = { | |||
744 | {"PredriveR Mux", "DACR1", "ARXR1_APGA"}, | 775 | {"PredriveR Mux", "DACR1", "ARXR1_APGA"}, |
745 | {"PredriveR Mux", "DACR2", "ARXR2_APGA"}, | 776 | {"PredriveR Mux", "DACR2", "ARXR2_APGA"}, |
746 | {"PredriveR Mux", "DACL2", "ARXL2_APGA"}, | 777 | {"PredriveR Mux", "DACL2", "ARXL2_APGA"}, |
778 | /* HeadsetL */ | ||
779 | {"HeadsetL Mux", "DACL1", "ARXL1_APGA"}, | ||
780 | {"HeadsetL Mux", "DACL2", "ARXL2_APGA"}, | ||
781 | /* HeadsetR */ | ||
782 | {"HeadsetR Mux", "DACR1", "ARXR1_APGA"}, | ||
783 | {"HeadsetR Mux", "DACR2", "ARXR2_APGA"}, | ||
747 | 784 | ||
748 | /* outputs */ | 785 | /* outputs */ |
749 | {"OUTL", NULL, "ARXL2_APGA"}, | 786 | {"OUTL", NULL, "ARXL2_APGA"}, |
@@ -751,6 +788,8 @@ static const struct snd_soc_dapm_route intercon[] = { | |||
751 | {"EARPIECE", NULL, "Earpiece Mux"}, | 788 | {"EARPIECE", NULL, "Earpiece Mux"}, |
752 | {"PREDRIVEL", NULL, "PredriveL Mux"}, | 789 | {"PREDRIVEL", NULL, "PredriveL Mux"}, |
753 | {"PREDRIVER", NULL, "PredriveR Mux"}, | 790 | {"PREDRIVER", NULL, "PredriveR Mux"}, |
791 | {"HSOL", NULL, "HeadsetL Mux"}, | ||
792 | {"HSOR", NULL, "HeadsetR Mux"}, | ||
754 | 793 | ||
755 | /* inputs */ | 794 | /* inputs */ |
756 | {"ADCL", NULL, "INL"}, | 795 | {"ADCL", NULL, "INL"}, |