alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ASoC: Fix mic bias handling in TI tlv320aic32x codec.
@ 2012-01-05 15:05 Javier Martin
  2012-01-05 15:56 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Javier Martin @ 2012-01-05 15:05 UTC (permalink / raw)
  To: alsa-devel; +Cc: broonie, lrg, Javier Martin

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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-01-05 15:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-05 15:05 [PATCH] ASoC: Fix mic bias handling in TI tlv320aic32x codec Javier Martin
2012-01-05 15:56 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).