All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 1/2] ASoC: tlv320aic32x4: Fix problem with first capture.
@ 2012-10-31 10:53 Javier Martin
  2012-10-31 10:53 ` [PATCH v2 2/2] ASoC: tlv320aic32x4: Add rstn gpio to platform data Javier Martin
  2012-11-01 14:36 ` [PATCH v2 1/2] ASoC: tlv320aic32x4: Fix problem with first capture Mark Brown
  0 siblings, 2 replies; 9+ messages in thread
From: Javier Martin @ 2012-10-31 10:53 UTC (permalink / raw)
  To: alsa-devel; +Cc: lrg, lars, broonie, javier.martin, w.sang

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>
---
Changes since v1:
 - Use a subject line according to the ASoC subsystem.

---
 sound/soc/codecs/tlv320aic32x4.c |   10 ++++++++++
 sound/soc/codecs/tlv320aic32x4.h |    3 +++
 2 files changed, 13 insertions(+)

diff --git a/sound/soc/codecs/tlv320aic32x4.c b/sound/soc/codecs/tlv320aic32x4.c
index b0a73d3..aad92f9 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)
 			     ARRAY_SIZE(aic32x4_snd_controls));
 	aic32x4_add_widgets(codec);
 
+	/*
+	 * Workaround: for an unknown reason, the ADC needs to be powered up
+	 * and down for the first capture to work properly. It seems related to
+	 * a HW BUG or some kind of behavior not documented in the datasheet.
+	 */
+	tmp_reg = snd_soc_read(codec, AIC32X4_ADCSETUP);
+	snd_soc_write(codec, AIC32X4_ADCSETUP, tmp_reg |
+				AIC32X4_LADC_EN | AIC32X4_RADC_EN);
+	snd_soc_write(codec, AIC32X4_ADCSETUP, tmp_reg);
+
 	return 0;
 }
 
diff --git a/sound/soc/codecs/tlv320aic32x4.h b/sound/soc/codecs/tlv320aic32x4.h
index aae2b24..3577422 100644
--- a/sound/soc/codecs/tlv320aic32x4.h
+++ b/sound/soc/codecs/tlv320aic32x4.h
@@ -94,6 +94,9 @@
 #define AIC32X4_WORD_LEN_24BITS		0x02
 #define AIC32X4_WORD_LEN_32BITS		0x03
 
+#define AIC32X4_LADC_EN			(1 << 7)
+#define AIC32X4_RADC_EN			(1 << 6)
+
 #define AIC32X4_I2S_MODE		0x00
 #define AIC32X4_DSP_MODE		0x01
 #define AIC32X4_RIGHT_JUSTIFIED_MODE	0x02
-- 
1.7.9.5

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

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

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-31 10:53 [PATCH v2 1/2] ASoC: tlv320aic32x4: Fix problem with first capture Javier Martin
2012-10-31 10:53 ` [PATCH v2 2/2] ASoC: tlv320aic32x4: Add rstn gpio to platform data Javier Martin
2012-10-31 14:40   ` Mike Looijmans
2012-11-01 14:35     ` Mark Brown
2012-11-01 15:28       ` Mike Looijmans
2012-11-02 14:40         ` Mark Brown
2012-11-05  8:14       ` javier Martin
2012-11-05  8:15         ` Mark Brown
2012-11-01 14:36 ` [PATCH v2 1/2] ASoC: tlv320aic32x4: Fix problem with first capture Mark Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.