aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/twl4030.c
diff options
context:
space:
mode:
authorJoonyoung Shim <jy0922.shim@samsung.com>2009-05-11 07:36:08 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2009-05-12 05:53:22 -0400
commit97b8096dc92ae62b1d40e6bec7e7b257d2b30161 (patch)
tree24a6cf6e7cbbf0aebfa331a73a5fc4b8d80c8247 /sound/soc/codecs/twl4030.c
parent7de0a0aee5cf24639c14b17ab4077f5dba0d7cb9 (diff)
ASoC: TWL4030: change DAPM for analog microphone selection
The inputs of the twl4030 codec can be mixed, so we will use the mixer DAPM for the analog microphone registers(0x05, 0x06), but if we enable more than one input at the same time, the input impedance of the input amplifier will be reduced. Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com> Acked-by: Peter Ujfalusi <peter.ujfalusi@nokia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/codecs/twl4030.c')
-rw-r--r--sound/soc/codecs/twl4030.c52
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 =
422SOC_DAPM_ENUM("Route", twl4030_vibrapath_enum); 422SOC_DAPM_ENUM("Route", twl4030_vibrapath_enum);
423 423
424/* Left analog microphone selection */ 424/* Left analog microphone selection */
425static const char *twl4030_analoglmic_texts[] = 425static 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),
428static 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};
431static 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
437static const struct snd_kcontrol_new twl4030_dapm_analoglmic_control =
438SOC_DAPM_VALUE_ENUM("Route", twl4030_analoglmic_enum);
439 431
440/* Right analog microphone selection */ 432/* Right analog microphone selection */
441static const char *twl4030_analogrmic_texts[] = 433static 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),
444static const unsigned int twl4030_analogrmic_values[] = 436};
445 {0x0, 0x1, 0x4};
446
447static 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
453static const struct snd_kcontrol_new twl4030_dapm_analogrmic_control =
454SOC_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 */
457static const char *twl4030_micpathtx1_texts[] = 439static 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),