aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Ujfalusi <peter.ujfalusi@nokia.com>2008-12-09 05:35:51 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2008-12-09 05:49:24 -0500
commitdf339804bbfc118eaca066b95488a2dbacc2e258 (patch)
tree9724185514c104b1fe663235007f6e83a5ed9640
parent5152d8c28b95e421b91483ca0df76726e6e6c41e (diff)
ASoC: TWL4030: DAPM mapping of the Handsfree outputs
Adds DAPM muxing, routing for the Handsfree outputs. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-rw-r--r--sound/soc/codecs/twl4030.c41
1 files changed, 41 insertions, 0 deletions
diff --git a/sound/soc/codecs/twl4030.c b/sound/soc/codecs/twl4030.c
index 08c33e9b96ce..d0612a4ca456 100644
--- a/sound/soc/codecs/twl4030.c
+++ b/sound/soc/codecs/twl4030.c
@@ -277,6 +277,30 @@ static const struct soc_enum twl4030_carkitr_enum =
277static const struct snd_kcontrol_new twl4030_dapm_carkitr_control = 277static const struct snd_kcontrol_new twl4030_dapm_carkitr_control =
278SOC_DAPM_ENUM("Route", twl4030_carkitr_enum); 278SOC_DAPM_ENUM("Route", twl4030_carkitr_enum);
279 279
280/* Handsfree Left */
281static const char *twl4030_handsfreel_texts[] =
282 {"Voice", "DACL1", "DACL2", "DACR2"};
283
284static const struct soc_enum twl4030_handsfreel_enum =
285 SOC_ENUM_SINGLE(TWL4030_REG_HFL_CTL, 0,
286 ARRAY_SIZE(twl4030_handsfreel_texts),
287 twl4030_handsfreel_texts);
288
289static const struct snd_kcontrol_new twl4030_dapm_handsfreel_control =
290SOC_DAPM_ENUM("Route", twl4030_handsfreel_enum);
291
292/* Handsfree Right */
293static const char *twl4030_handsfreer_texts[] =
294 {"Voice", "DACR1", "DACR2", "DACL2"};
295
296static const struct soc_enum twl4030_handsfreer_enum =
297 SOC_ENUM_SINGLE(TWL4030_REG_HFR_CTL, 0,
298 ARRAY_SIZE(twl4030_handsfreer_texts),
299 twl4030_handsfreer_texts);
300
301static const struct snd_kcontrol_new twl4030_dapm_handsfreer_control =
302SOC_DAPM_ENUM("Route", twl4030_handsfreer_enum);
303
280static int outmixer_event(struct snd_soc_dapm_widget *w, 304static int outmixer_event(struct snd_soc_dapm_widget *w,
281 struct snd_kcontrol *kcontrol, int event) 305 struct snd_kcontrol *kcontrol, int event)
282{ 306{
@@ -737,6 +761,8 @@ static const struct snd_soc_dapm_widget twl4030_dapm_widgets[] = {
737 SND_SOC_DAPM_OUTPUT("PREDRIVER"), 761 SND_SOC_DAPM_OUTPUT("PREDRIVER"),
738 SND_SOC_DAPM_OUTPUT("HSOL"), 762 SND_SOC_DAPM_OUTPUT("HSOL"),
739 SND_SOC_DAPM_OUTPUT("HSOR"), 763 SND_SOC_DAPM_OUTPUT("HSOR"),
764 SND_SOC_DAPM_OUTPUT("HFL"),
765 SND_SOC_DAPM_OUTPUT("HFR"),
740 766
741 /* DACs */ 767 /* DACs */
742 SND_SOC_DAPM_DAC("DACR1", "Right Front Playback", 768 SND_SOC_DAPM_DAC("DACR1", "Right Front Playback",
@@ -780,6 +806,11 @@ static const struct snd_soc_dapm_widget twl4030_dapm_widgets[] = {
780 &twl4030_dapm_carkitl_control), 806 &twl4030_dapm_carkitl_control),
781 SND_SOC_DAPM_MUX("CarkitR Mux", SND_SOC_NOPM, 0, 0, 807 SND_SOC_DAPM_MUX("CarkitR Mux", SND_SOC_NOPM, 0, 0,
782 &twl4030_dapm_carkitr_control), 808 &twl4030_dapm_carkitr_control),
809 /* HandsfreeL/R */
810 SND_SOC_DAPM_MUX("HandsfreeL Mux", TWL4030_REG_HFL_CTL, 5, 0,
811 &twl4030_dapm_handsfreel_control),
812 SND_SOC_DAPM_MUX("HandsfreeR Mux", TWL4030_REG_HFR_CTL, 5, 0,
813 &twl4030_dapm_handsfreer_control),
783 814
784 SND_SOC_DAPM_ADC("ADCL", "Left Capture", SND_SOC_NOPM, 0, 0), 815 SND_SOC_DAPM_ADC("ADCL", "Left Capture", SND_SOC_NOPM, 0, 0),
785 SND_SOC_DAPM_ADC("ADCR", "Right Capture", SND_SOC_NOPM, 0, 0), 816 SND_SOC_DAPM_ADC("ADCR", "Right Capture", SND_SOC_NOPM, 0, 0),
@@ -816,6 +847,14 @@ static const struct snd_soc_dapm_route intercon[] = {
816 /* CarkitR */ 847 /* CarkitR */
817 {"CarkitR Mux", "DACR1", "ARXR1_APGA"}, 848 {"CarkitR Mux", "DACR1", "ARXR1_APGA"},
818 {"CarkitR Mux", "DACR2", "ARXR2_APGA"}, 849 {"CarkitR Mux", "DACR2", "ARXR2_APGA"},
850 /* HandsfreeL */
851 {"HandsfreeL Mux", "DACL1", "ARXL1_APGA"},
852 {"HandsfreeL Mux", "DACL2", "ARXL2_APGA"},
853 {"HandsfreeL Mux", "DACR2", "ARXR2_APGA"},
854 /* HandsfreeR */
855 {"HandsfreeR Mux", "DACR1", "ARXR1_APGA"},
856 {"HandsfreeR Mux", "DACR2", "ARXR2_APGA"},
857 {"HandsfreeR Mux", "DACL2", "ARXL2_APGA"},
819 858
820 /* outputs */ 859 /* outputs */
821 {"OUTL", NULL, "ARXL2_APGA"}, 860 {"OUTL", NULL, "ARXL2_APGA"},
@@ -827,6 +866,8 @@ static const struct snd_soc_dapm_route intercon[] = {
827 {"HSOR", NULL, "HeadsetR Mux"}, 866 {"HSOR", NULL, "HeadsetR Mux"},
828 {"CARKITL", NULL, "CarkitL Mux"}, 867 {"CARKITL", NULL, "CarkitL Mux"},
829 {"CARKITR", NULL, "CarkitR Mux"}, 868 {"CARKITR", NULL, "CarkitR Mux"},
869 {"HFL", NULL, "HandsfreeL Mux"},
870 {"HFR", NULL, "HandsfreeR Mux"},
830 871
831 /* inputs */ 872 /* inputs */
832 {"ADCL", NULL, "INL"}, 873 {"ADCL", NULL, "INL"},