aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc
diff options
context:
space:
mode:
authorPeter Ujfalusi <peter.ujfalusi@nokia.com>2008-12-09 05:35:48 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2008-12-09 05:49:23 -0500
commit2a6f5c5892dcd17c81204fe5e26b92a37d2daafa (patch)
tree416dafae91f28beb4680b0a030d761971095e423 /sound/soc
parent5e98a46449cd028b9b97a8ef2c2448c8f473d6c5 (diff)
ASoC: TWL4030: DAPM mapping of the PreDriv outputs
Adds DAPM muxing, routing for the PreDrive 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.c45
1 files changed, 45 insertions, 0 deletions
diff --git a/sound/soc/codecs/twl4030.c b/sound/soc/codecs/twl4030.c
index 1da46175519e..c508344241e9 100644
--- a/sound/soc/codecs/twl4030.c
+++ b/sound/soc/codecs/twl4030.c
@@ -203,6 +203,32 @@ static const struct soc_enum twl4030_earpiece_enum =
203static const struct snd_kcontrol_new twl4030_dapm_earpiece_control = 203static const struct snd_kcontrol_new twl4030_dapm_earpiece_control =
204SOC_DAPM_ENUM("Route", twl4030_earpiece_enum); 204SOC_DAPM_ENUM("Route", twl4030_earpiece_enum);
205 205
206/* PreDrive Left */
207static const char *twl4030_predrivel_texts[] =
208 {"Off", "DACL1", "DACL2", "Invalid",
209 "DACR2"};
210
211static const struct soc_enum twl4030_predrivel_enum =
212 SOC_ENUM_SINGLE(TWL4030_REG_PREDL_CTL, 1,
213 ARRAY_SIZE(twl4030_predrivel_texts),
214 twl4030_predrivel_texts);
215
216static const struct snd_kcontrol_new twl4030_dapm_predrivel_control =
217SOC_DAPM_ENUM("Route", twl4030_predrivel_enum);
218
219/* PreDrive Right */
220static const char *twl4030_predriver_texts[] =
221 {"Off", "DACR1", "DACR2", "Invalid",
222 "DACL2"};
223
224static const struct soc_enum twl4030_predriver_enum =
225 SOC_ENUM_SINGLE(TWL4030_REG_PREDR_CTL, 1,
226 ARRAY_SIZE(twl4030_predriver_texts),
227 twl4030_predriver_texts);
228
229static const struct snd_kcontrol_new twl4030_dapm_predriver_control =
230SOC_DAPM_ENUM("Route", twl4030_predriver_enum);
231
206static int outmixer_event(struct snd_soc_dapm_widget *w, 232static int outmixer_event(struct snd_soc_dapm_widget *w,
207 struct snd_kcontrol *kcontrol, int event) 233 struct snd_kcontrol *kcontrol, int event)
208{ 234{
@@ -659,6 +685,8 @@ static const struct snd_soc_dapm_widget twl4030_dapm_widgets[] = {
659 SND_SOC_DAPM_OUTPUT("OUTL"), 685 SND_SOC_DAPM_OUTPUT("OUTL"),
660 SND_SOC_DAPM_OUTPUT("OUTR"), 686 SND_SOC_DAPM_OUTPUT("OUTR"),
661 SND_SOC_DAPM_OUTPUT("EARPIECE"), 687 SND_SOC_DAPM_OUTPUT("EARPIECE"),
688 SND_SOC_DAPM_OUTPUT("PREDRIVEL"),
689 SND_SOC_DAPM_OUTPUT("PREDRIVER"),
662 690
663 /* DACs */ 691 /* DACs */
664 SND_SOC_DAPM_DAC("DACR1", "Right Front Playback", 692 SND_SOC_DAPM_DAC("DACR1", "Right Front Playback",
@@ -685,6 +713,13 @@ static const struct snd_soc_dapm_widget twl4030_dapm_widgets[] = {
685 SND_SOC_DAPM_MUX_E("Earpiece Mux", SND_SOC_NOPM, 0, 0, 713 SND_SOC_DAPM_MUX_E("Earpiece Mux", SND_SOC_NOPM, 0, 0,
686 &twl4030_dapm_earpiece_control, outmixer_event, 714 &twl4030_dapm_earpiece_control, outmixer_event,
687 SND_SOC_DAPM_PRE_REG), 715 SND_SOC_DAPM_PRE_REG),
716 /* PreDrivL/R */
717 SND_SOC_DAPM_MUX_E("PredriveL Mux", SND_SOC_NOPM, 0, 0,
718 &twl4030_dapm_predrivel_control, outmixer_event,
719 SND_SOC_DAPM_PRE_REG),
720 SND_SOC_DAPM_MUX_E("PredriveR Mux", SND_SOC_NOPM, 0, 0,
721 &twl4030_dapm_predriver_control, outmixer_event,
722 SND_SOC_DAPM_PRE_REG),
688 723
689 SND_SOC_DAPM_ADC("ADCL", "Left Capture", SND_SOC_NOPM, 0, 0), 724 SND_SOC_DAPM_ADC("ADCL", "Left Capture", SND_SOC_NOPM, 0, 0),
690 SND_SOC_DAPM_ADC("ADCR", "Right Capture", SND_SOC_NOPM, 0, 0), 725 SND_SOC_DAPM_ADC("ADCR", "Right Capture", SND_SOC_NOPM, 0, 0),
@@ -701,11 +736,21 @@ static const struct snd_soc_dapm_route intercon[] = {
701 {"Earpiece Mux", "DACL1", "ARXL1_APGA"}, 736 {"Earpiece Mux", "DACL1", "ARXL1_APGA"},
702 {"Earpiece Mux", "DACL2", "ARXL2_APGA"}, 737 {"Earpiece Mux", "DACL2", "ARXL2_APGA"},
703 {"Earpiece Mux", "DACR1", "ARXR1_APGA"}, 738 {"Earpiece Mux", "DACR1", "ARXR1_APGA"},
739 /* PreDrivL */
740 {"PredriveL Mux", "DACL1", "ARXL1_APGA"},
741 {"PredriveL Mux", "DACL2", "ARXL2_APGA"},
742 {"PredriveL Mux", "DACR2", "ARXR2_APGA"},
743 /* PreDrivR */
744 {"PredriveR Mux", "DACR1", "ARXR1_APGA"},
745 {"PredriveR Mux", "DACR2", "ARXR2_APGA"},
746 {"PredriveR Mux", "DACL2", "ARXL2_APGA"},
704 747
705 /* outputs */ 748 /* outputs */
706 {"OUTL", NULL, "ARXL2_APGA"}, 749 {"OUTL", NULL, "ARXL2_APGA"},
707 {"OUTR", NULL, "ARXR2_APGA"}, 750 {"OUTR", NULL, "ARXR2_APGA"},
708 {"EARPIECE", NULL, "Earpiece Mux"}, 751 {"EARPIECE", NULL, "Earpiece Mux"},
752 {"PREDRIVEL", NULL, "PredriveL Mux"},
753 {"PREDRIVER", NULL, "PredriveR Mux"},
709 754
710 /* inputs */ 755 /* inputs */
711 {"ADCL", NULL, "INL"}, 756 {"ADCL", NULL, "INL"},