summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorLionel Xu <Lionel.Xu@freescale.com>2011-09-15 15:44:26 +0800
committerJason Liu <r64343@freescale.com>2012-01-09 20:23:46 +0800
commitfe78bcef8f69b511ea73619570aa9ab805ec45ab (patch)
tree49b513857619038954f9e249603efedfe0e6c93b /sound
parentbb7b26c68a3c0333c16d043206a9758a3718562a (diff)
ENGR00156813 MX53 ALSA: Recording no sound
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. Signed-off-by: Lionel Xu <Lionel.Xu@freescale.com>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/codecs/sgtl5000.c17
-rw-r--r--sound/soc/codecs/sgtl5000.h2
2 files changed, 14 insertions, 5 deletions
diff --git a/sound/soc/codecs/sgtl5000.c b/sound/soc/codecs/sgtl5000.c
index c324d92739f3..41a988dfb963 100644
--- a/sound/soc/codecs/sgtl5000.c
+++ b/sound/soc/codecs/sgtl5000.c
@@ -130,7 +130,11 @@ 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_4k, SGTL5000_BIAS_R_4k);
+ 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:
@@ -139,7 +143,11 @@ static int mic_bias_event(struct snd_soc_dapm_widget *w,
* of mic bias and output impedance
*/
snd_soc_update_bits(w->codec, SGTL5000_CHIP_MIC_CTRL,
- SGTL5000_BIAS_R_8k, 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;
@@ -267,7 +275,7 @@ static const struct snd_soc_dapm_widget sgtl5000_dapm_widgets[] = {
0, SGTL5000_CHIP_DIG_POWER,
1, 0),
- 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),
@@ -298,7 +306,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 */
diff --git a/sound/soc/codecs/sgtl5000.h b/sound/soc/codecs/sgtl5000.h
index eec3ab368f39..8a9f43534b79 100644
--- a/sound/soc/codecs/sgtl5000.h
+++ b/sound/soc/codecs/sgtl5000.h
@@ -280,7 +280,7 @@
/*
* SGTL5000_CHIP_MIC_CTRL
*/
-#define SGTL5000_BIAS_R_MASK 0x0200
+#define SGTL5000_BIAS_R_MASK 0x0300
#define SGTL5000_BIAS_R_SHIFT 8
#define SGTL5000_BIAS_R_WIDTH 2
#define SGTL5000_BIAS_R_off 0x0