[alsa-devel] [PATCH] ASoC: Fix mic bias handling in TI tlv320aic32x codec.

Javier Martin javier.martin at vista-silicon.com
Thu Jan 5 16:05:04 CET 2012


tlv320aic32x doesn't have a dedicated MIC input, it
has a MICBIAS pin instead, which is used to provide
power to an external microphone.

This means one can enable this MICBIAS pin for any input
configuration of INX_L and INX_R.

For this reason it's not possible to add this as
a DAPM event since we lack the possibility to associate
it to a DAPM route. So we use platform data totell the
device whether we are connecting a microphone or not.
---
 sound/soc/codecs/tlv320aic32x4.c |    6 +++---
 sound/soc/codecs/tlv320aic32x4.h |    1 +
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/sound/soc/codecs/tlv320aic32x4.c b/sound/soc/codecs/tlv320aic32x4.c
index e93b9d1..f260e60 100644
--- a/sound/soc/codecs/tlv320aic32x4.c
+++ b/sound/soc/codecs/tlv320aic32x4.c
@@ -208,7 +208,6 @@ static const struct snd_soc_dapm_widget aic32x4_dapm_widgets[] = {
 			   ARRAY_SIZE(right_input_mixer_controls)),
 	SND_SOC_DAPM_ADC("Left ADC", "Left Capture", AIC32X4_ADCSETUP, 7, 0),
 	SND_SOC_DAPM_ADC("Right ADC", "Right Capture", AIC32X4_ADCSETUP, 6, 0),
-	SND_SOC_DAPM_MICBIAS("Mic Bias", AIC32X4_MICBIAS, 6, 0),
 
 	SND_SOC_DAPM_OUTPUT("HPL"),
 	SND_SOC_DAPM_OUTPUT("HPR"),
@@ -659,8 +658,9 @@ static int aic32x4_probe(struct snd_soc_codec *codec)
 
 	/* Power platform configuration */
 	if (aic32x4->power_cfg & AIC32X4_PWR_MICBIAS_2075_LDOIN) {
-		snd_soc_write(codec, AIC32X4_MICBIAS, AIC32X4_MICBIAS_LDOIN |
-						      AIC32X4_MICBIAS_2075V);
+		snd_soc_write(codec, AIC32X4_MICBIAS,
+				AIC32X4_MICBIAS_ON | AIC32X4_MICBIAS_LDOIN |
+				AIC32X4_MICBIAS_2075V);
 	}
 	if (aic32x4->power_cfg & AIC32X4_PWR_AVDD_DVDD_WEAK_DISABLE) {
 		snd_soc_write(codec, AIC32X4_PWRCFG, AIC32X4_AVDDWEAKDISABLE);
diff --git a/sound/soc/codecs/tlv320aic32x4.h b/sound/soc/codecs/tlv320aic32x4.h
index aae2b24..7b9ed7e 100644
--- a/sound/soc/codecs/tlv320aic32x4.h
+++ b/sound/soc/codecs/tlv320aic32x4.h
@@ -113,6 +113,7 @@
 
 #define AIC32X4_PLLCLKIN		0x03
 
+#define AIC32X4_MICBIAS_ON		0x40
 #define AIC32X4_MICBIAS_LDOIN		0x08
 #define AIC32X4_MICBIAS_2075V		0x60
 
-- 
1.7.0.4



More information about the Alsa-devel mailing list