aboutsummaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorLionel Xu <lionel.xu@freescale.com>2011-10-16 10:07:10 +0800
committerEric Miao <eric.miao@linaro.org>2011-12-19 11:24:41 +0800
commite4e46a50ab4e10762930fb1d8dc6fa92d3ba925c (patch)
tree7674074117be4987dd2d816c88905b94da34d070 /sound
parentcb223d1a1e841d1c3a5154c5d730ad77ea75f2a4 (diff)
SAUCE: sgtl5000: fix power on/off of MIC bias
BugLink: http://bugs.launchpad.net/bugs/837797 There is no sound in the recorded wav, to enable recording, the VAG should be powered up, and the mic bias resistor should be setup with proper value. Original patch subject: ENGR00156813 MX53 ALSA: Recording no sound Signed-off-by: Lionel Xu <lionel.xu@freescale.com> Signed-off-by: Eric Miao <eric.miao@linaro.org>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/codecs/sgtl5000.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/sound/soc/codecs/sgtl5000.c b/sound/soc/codecs/sgtl5000.c
index e7de1c01df2..cb9818c5830 100644
--- a/sound/soc/codecs/sgtl5000.c
+++ b/sound/soc/codecs/sgtl5000.c
@@ -131,13 +131,20 @@ static int mic_bias_event(struct snd_soc_dapm_widget *w,
case SND_SOC_DAPM_POST_PMU:
/* change mic bias resistor to 4Kohm */
snd_soc_update_bits(w->codec, SGTL5000_CHIP_MIC_CTRL,
- SGTL5000_BIAS_R_MASK,
- SGTL5000_BIAS_R_4k << SGTL5000_BIAS_R_SHIFT);
+ SGTL5000_BIAS_R_MASK,
+ SGTL5000_BIAS_R_4k << SGTL5000_BIAS_R_SHIFT);
+
+ snd_soc_update_bits(w->codec, SGTL5000_CHIP_ANA_POWER,
+ SGTL5000_VAG_POWERUP, SGTL5000_VAG_POWERUP);
break;
case SND_SOC_DAPM_PRE_PMD:
snd_soc_update_bits(w->codec, SGTL5000_CHIP_MIC_CTRL,
- SGTL5000_BIAS_R_MASK, 0);
+ SGTL5000_BIAS_R_MASK,
+ SGTL5000_BIAS_R_off << SGTL5000_BIAS_R_SHIFT);
+
+ snd_soc_update_bits(w->codec, SGTL5000_CHIP_ANA_POWER,
+ SGTL5000_VAG_POWERUP, 0);
break;
}
return 0;
@@ -198,7 +205,7 @@ static const struct snd_soc_dapm_widget sgtl5000_dapm_widgets[] = {
SND_SOC_DAPM_OUTPUT("HP_OUT"),
SND_SOC_DAPM_OUTPUT("LINE_OUT"),
- SND_SOC_DAPM_MICBIAS_E("Mic Bias", SGTL5000_CHIP_MIC_CTRL, 8, 0,
+ SND_SOC_DAPM_MICBIAS_E("Mic Bias", SND_SOC_NOPM, 0, 0,
mic_bias_event,
SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD),
@@ -230,7 +237,8 @@ static const struct snd_soc_dapm_widget sgtl5000_dapm_widgets[] = {
/* routes for sgtl5000 */
static const struct snd_soc_dapm_route audio_map[] = {
{"Capture Mux", "LINE_IN", "LINE_IN"}, /* line_in --> adc_mux */
- {"Capture Mux", "MIC_IN", "MIC_IN"}, /* mic_in --> adc_mux */
+ {"Mic Bias", NULL, "MIC_IN"}, /* mic_in --> mic bias */
+ {"Capture Mux", "MIC_IN", "Mic Bias"}, /* mic bias --> adc_mux */
{"ADC", NULL, "Capture Mux"}, /* adc_mux --> adc */
{"AIFOUT", NULL, "ADC"}, /* adc --> i2s_out */