diff options
-rw-r--r-- | sound/soc/codecs/twl4030.c | 52 |
1 files changed, 19 insertions, 33 deletions
diff --git a/sound/soc/codecs/twl4030.c b/sound/soc/codecs/twl4030.c index fd392c65f475..eaf91ab465b4 100644 --- a/sound/soc/codecs/twl4030.c +++ b/sound/soc/codecs/twl4030.c | |||
@@ -422,36 +422,18 @@ static const struct snd_kcontrol_new twl4030_dapm_vibrapath_control = | |||
422 | SOC_DAPM_ENUM("Route", twl4030_vibrapath_enum); | 422 | SOC_DAPM_ENUM("Route", twl4030_vibrapath_enum); |
423 | 423 | ||
424 | /* Left analog microphone selection */ | 424 | /* Left analog microphone selection */ |
425 | static const char *twl4030_analoglmic_texts[] = | 425 | static const struct snd_kcontrol_new twl4030_dapm_analoglmic_controls[] = { |
426 | {"Off", "Main mic", "Headset mic", "AUXL", "Carkit mic"}; | 426 | SOC_DAPM_SINGLE("Main mic", TWL4030_REG_ANAMICL, 0, 1, 0), |
427 | 427 | SOC_DAPM_SINGLE("Headset mic", TWL4030_REG_ANAMICL, 1, 1, 0), | |
428 | static const unsigned int twl4030_analoglmic_values[] = | 428 | SOC_DAPM_SINGLE("AUXL", TWL4030_REG_ANAMICL, 2, 1, 0), |
429 | {0x0, 0x1, 0x2, 0x4, 0x8}; | 429 | SOC_DAPM_SINGLE("Carkit mic", TWL4030_REG_ANAMICL, 3, 1, 0), |
430 | 430 | }; | |
431 | static const struct soc_enum twl4030_analoglmic_enum = | ||
432 | SOC_VALUE_ENUM_SINGLE(TWL4030_REG_ANAMICL, 0, 0xf, | ||
433 | ARRAY_SIZE(twl4030_analoglmic_texts), | ||
434 | twl4030_analoglmic_texts, | ||
435 | twl4030_analoglmic_values); | ||
436 | |||
437 | static const struct snd_kcontrol_new twl4030_dapm_analoglmic_control = | ||
438 | SOC_DAPM_VALUE_ENUM("Route", twl4030_analoglmic_enum); | ||
439 | 431 | ||
440 | /* Right analog microphone selection */ | 432 | /* Right analog microphone selection */ |
441 | static const char *twl4030_analogrmic_texts[] = | 433 | static const struct snd_kcontrol_new twl4030_dapm_analogrmic_controls[] = { |
442 | {"Off", "Sub mic", "AUXR"}; | 434 | SOC_DAPM_SINGLE("Sub mic", TWL4030_REG_ANAMICR, 0, 1, 0), |
443 | 435 | SOC_DAPM_SINGLE("AUXR", TWL4030_REG_ANAMICR, 1, 1, 0), | |
444 | static const unsigned int twl4030_analogrmic_values[] = | 436 | }; |
445 | {0x0, 0x1, 0x4}; | ||
446 | |||
447 | static const struct soc_enum twl4030_analogrmic_enum = | ||
448 | SOC_VALUE_ENUM_SINGLE(TWL4030_REG_ANAMICR, 0, 0x5, | ||
449 | ARRAY_SIZE(twl4030_analogrmic_texts), | ||
450 | twl4030_analogrmic_texts, | ||
451 | twl4030_analogrmic_values); | ||
452 | |||
453 | static const struct snd_kcontrol_new twl4030_dapm_analogrmic_control = | ||
454 | SOC_DAPM_VALUE_ENUM("Route", twl4030_analogrmic_enum); | ||
455 | 437 | ||
456 | /* TX1 L/R Analog/Digital microphone selection */ | 438 | /* TX1 L/R Analog/Digital microphone selection */ |
457 | static const char *twl4030_micpathtx1_texts[] = | 439 | static const char *twl4030_micpathtx1_texts[] = |
@@ -1138,11 +1120,15 @@ static const struct snd_soc_dapm_widget twl4030_dapm_widgets[] = { | |||
1138 | SND_SOC_DAPM_POST_PMU|SND_SOC_DAPM_POST_PMD| | 1120 | SND_SOC_DAPM_POST_PMU|SND_SOC_DAPM_POST_PMD| |
1139 | SND_SOC_DAPM_POST_REG), | 1121 | SND_SOC_DAPM_POST_REG), |
1140 | 1122 | ||
1141 | /* Analog input muxes with switch for the capture amplifiers */ | 1123 | /* Analog input mixers for the capture amplifiers */ |
1142 | SND_SOC_DAPM_VALUE_MUX("Analog Left Capture Route", | 1124 | SND_SOC_DAPM_MIXER("Analog Left Capture Route", |
1143 | TWL4030_REG_ANAMICL, 4, 0, &twl4030_dapm_analoglmic_control), | 1125 | TWL4030_REG_ANAMICL, 4, 0, |
1144 | SND_SOC_DAPM_VALUE_MUX("Analog Right Capture Route", | 1126 | &twl4030_dapm_analoglmic_controls[0], |
1145 | TWL4030_REG_ANAMICR, 4, 0, &twl4030_dapm_analogrmic_control), | 1127 | ARRAY_SIZE(twl4030_dapm_analoglmic_controls)), |
1128 | SND_SOC_DAPM_MIXER("Analog Right Capture Route", | ||
1129 | TWL4030_REG_ANAMICR, 4, 0, | ||
1130 | &twl4030_dapm_analogrmic_controls[0], | ||
1131 | ARRAY_SIZE(twl4030_dapm_analogrmic_controls)), | ||
1146 | 1132 | ||
1147 | SND_SOC_DAPM_PGA("ADC Physical Left", | 1133 | SND_SOC_DAPM_PGA("ADC Physical Left", |
1148 | TWL4030_REG_AVADC_CTL, 3, 0, NULL, 0), | 1134 | TWL4030_REG_AVADC_CTL, 3, 0, NULL, 0), |