aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJavier Martin <javier.martin@vista-silicon.com>2012-10-31 06:53:33 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-11-01 10:35:56 -0400
commita405387c6825b1fc1956e22b10160b0f31536f3f (patch)
tree05d36e0c8f87c1e487b353282ed9aad7c3581c02
parent8f0d8163b50e01f398b14bcd4dc039ac5ab18d64 (diff)
ASoC: tlv320aic32x4: Fix problem with first capture.
In its previous status, the first capture didn't work properly; nothing was actually recorded from the microphone. This behaviour was observed using a Visstrim M10 board. In order to solve this BUG a workaround has been added that, during the initialization process of the codec, powers on and off the ADC. The issue seems related to a HW BUG or some behavior that is not documented in the datasheet. Signed-off-by: Javier Martin <javier.martin@vista-silicon.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-rw-r--r--sound/soc/codecs/tlv320aic32x4.c10
-rw-r--r--sound/soc/codecs/tlv320aic32x4.h3
2 files changed, 13 insertions, 0 deletions
diff --git a/sound/soc/codecs/tlv320aic32x4.c b/sound/soc/codecs/tlv320aic32x4.c
index f230292ba96b..d7d0e18f794c 100644
--- a/sound/soc/codecs/tlv320aic32x4.c
+++ b/sound/soc/codecs/tlv320aic32x4.c
@@ -675,6 +675,16 @@ static int aic32x4_probe(struct snd_soc_codec *codec)
675 ARRAY_SIZE(aic32x4_snd_controls)); 675 ARRAY_SIZE(aic32x4_snd_controls));
676 aic32x4_add_widgets(codec); 676 aic32x4_add_widgets(codec);
677 677
678 /*
679 * Workaround: for an unknown reason, the ADC needs to be powered up
680 * and down for the first capture to work properly. It seems related to
681 * a HW BUG or some kind of behavior not documented in the datasheet.
682 */
683 tmp_reg = snd_soc_read(codec, AIC32X4_ADCSETUP);
684 snd_soc_write(codec, AIC32X4_ADCSETUP, tmp_reg |
685 AIC32X4_LADC_EN | AIC32X4_RADC_EN);
686 snd_soc_write(codec, AIC32X4_ADCSETUP, tmp_reg);
687
678 return 0; 688 return 0;
679} 689}
680 690
diff --git a/sound/soc/codecs/tlv320aic32x4.h b/sound/soc/codecs/tlv320aic32x4.h
index aae2b2440398..35774223fd91 100644
--- a/sound/soc/codecs/tlv320aic32x4.h
+++ b/sound/soc/codecs/tlv320aic32x4.h
@@ -94,6 +94,9 @@
94#define AIC32X4_WORD_LEN_24BITS 0x02 94#define AIC32X4_WORD_LEN_24BITS 0x02
95#define AIC32X4_WORD_LEN_32BITS 0x03 95#define AIC32X4_WORD_LEN_32BITS 0x03
96 96
97#define AIC32X4_LADC_EN (1 << 7)
98#define AIC32X4_RADC_EN (1 << 6)
99
97#define AIC32X4_I2S_MODE 0x00 100#define AIC32X4_I2S_MODE 0x00
98#define AIC32X4_DSP_MODE 0x01 101#define AIC32X4_DSP_MODE 0x01
99#define AIC32X4_RIGHT_JUSTIFIED_MODE 0x02 102#define AIC32X4_RIGHT_JUSTIFIED_MODE 0x02