diff options
author | Andrew Bresticker <abrestic@chromium.org> | 2013-05-16 15:03:54 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2013-05-17 07:07:18 -0400 |
commit | fd5f940f82cdc0132438a96559b27dd7fd574875 (patch) | |
tree | e126c1476b67bc64cb5e33702ff85b41dca38b5c /sound/soc/codecs/max98090.c | |
parent | f722406faae2d073cc1d01063d1123c35425939e (diff) |
ASoC: max98090: add digital mic mux to record path
The max98090 driver currently treats the digital mic enable as a supply
on the record path, causing the digital mic enable to always be turned on
when attempting to record. This is incorrect, however, since the digital
mic enable is also a mux control where 0 selects the ADC output as input
to the record-path DSP and 1 selects the digital mic. This patch adds
a virtual DMIC mux to the reocrd path so that we can switch between the
ADC and the digital mic for recording.
Signed-off-by: Andrew Bresticker <abrestic@chromium.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/codecs/max98090.c')
-rw-r--r-- | sound/soc/codecs/max98090.c | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/sound/soc/codecs/max98090.c b/sound/soc/codecs/max98090.c index ce0d36412c97..cbb272b1f73d 100644 --- a/sound/soc/codecs/max98090.c +++ b/sound/soc/codecs/max98090.c | |||
@@ -857,6 +857,14 @@ static const struct soc_enum mic2_mux_enum = | |||
857 | static const struct snd_kcontrol_new max98090_mic2_mux = | 857 | static const struct snd_kcontrol_new max98090_mic2_mux = |
858 | SOC_DAPM_ENUM("MIC2 Mux", mic2_mux_enum); | 858 | SOC_DAPM_ENUM("MIC2 Mux", mic2_mux_enum); |
859 | 859 | ||
860 | static const char *dmic_mux_text[] = { "ADC", "DMIC" }; | ||
861 | |||
862 | static const struct soc_enum dmic_mux_enum = | ||
863 | SOC_ENUM_SINGLE_EXT(ARRAY_SIZE(dmic_mux_text), dmic_mux_text); | ||
864 | |||
865 | static const struct snd_kcontrol_new max98090_dmic_mux = | ||
866 | SOC_DAPM_ENUM_VIRT("DMIC Mux", dmic_mux_enum); | ||
867 | |||
860 | static const char *max98090_micpre_text[] = { "Off", "On" }; | 868 | static const char *max98090_micpre_text[] = { "Off", "On" }; |
861 | 869 | ||
862 | static const struct soc_enum max98090_pa1en_enum = | 870 | static const struct soc_enum max98090_pa1en_enum = |
@@ -1144,6 +1152,9 @@ static const struct snd_soc_dapm_widget max98090_dapm_widgets[] = { | |||
1144 | SND_SOC_DAPM_MUX("MIC2 Mux", SND_SOC_NOPM, | 1152 | SND_SOC_DAPM_MUX("MIC2 Mux", SND_SOC_NOPM, |
1145 | 0, 0, &max98090_mic2_mux), | 1153 | 0, 0, &max98090_mic2_mux), |
1146 | 1154 | ||
1155 | SND_SOC_DAPM_VIRT_MUX("DMIC Mux", SND_SOC_NOPM, | ||
1156 | 0, 0, &max98090_dmic_mux), | ||
1157 | |||
1147 | SND_SOC_DAPM_PGA_E("MIC1 Input", M98090_REG_MIC1_INPUT_LEVEL, | 1158 | SND_SOC_DAPM_PGA_E("MIC1 Input", M98090_REG_MIC1_INPUT_LEVEL, |
1148 | M98090_MIC_PA1EN_SHIFT, 0, NULL, 0, max98090_micinput_event, | 1159 | M98090_MIC_PA1EN_SHIFT, 0, NULL, 0, max98090_micinput_event, |
1149 | SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_POST_PMD), | 1160 | SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_POST_PMD), |
@@ -1336,11 +1347,14 @@ static const struct snd_soc_dapm_route max98090_dapm_routes[] = { | |||
1336 | {"ADCL", NULL, "SHDN"}, | 1347 | {"ADCL", NULL, "SHDN"}, |
1337 | {"ADCR", NULL, "SHDN"}, | 1348 | {"ADCR", NULL, "SHDN"}, |
1338 | 1349 | ||
1339 | {"LBENL Mux", "Normal", "ADCL"}, | 1350 | {"DMIC Mux", "ADC", "ADCL"}, |
1340 | {"LBENL Mux", "Normal", "DMICL"}, | 1351 | {"DMIC Mux", "ADC", "ADCR"}, |
1352 | {"DMIC Mux", "DMIC", "DMICL"}, | ||
1353 | {"DMIC Mux", "DMIC", "DMICR"}, | ||
1354 | |||
1355 | {"LBENL Mux", "Normal", "DMIC Mux"}, | ||
1341 | {"LBENL Mux", "Loopback", "LTENL Mux"}, | 1356 | {"LBENL Mux", "Loopback", "LTENL Mux"}, |
1342 | {"LBENR Mux", "Normal", "ADCR"}, | 1357 | {"LBENR Mux", "Normal", "DMIC Mux"}, |
1343 | {"LBENR Mux", "Normal", "DMICR"}, | ||
1344 | {"LBENR Mux", "Loopback", "LTENR Mux"}, | 1358 | {"LBENR Mux", "Loopback", "LTENR Mux"}, |
1345 | 1359 | ||
1346 | {"AIFOUTL", NULL, "LBENL Mux"}, | 1360 | {"AIFOUTL", NULL, "LBENL Mux"}, |