Skip to content

Commit

Permalink
ASoC: tlv320aic32x4: Fix problem with first capture.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Javier Martin authored and Mark Brown committed Nov 1, 2012
1 parent 8f0d816 commit a405387
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
10 changes: 10 additions & 0 deletions sound/soc/codecs/tlv320aic32x4.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
3 changes: 3 additions & 0 deletions sound/soc/codecs/tlv320aic32x4.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a405387

Please sign in to comment.