[alsa-devel] [PATCH 0/2] ASoC: tlv320dac33: small fixes
Hello,
Two small fixes for the tlv320dac33 codec driver: Clearing the FIFFLUSH flag before playback start The register cache has the bit set after the playback is stopped, so clear it before the playback. OSCSET calculation in case of 44.1KHz sampling rate was off by 1 (0x1588 instead of 0x1589, which is the value should be used according to TI).
--- Peter Ujfalusi (2): ASoC: tlv320dac33: Clearing FIFOFLUSH flag before playback ASoC: tlv320dac33: Correct the OSCSET calculation
sound/soc/codecs/tlv320dac33.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-)
In repeated playback the FIFOFLUSH bit remained set, and never has been cleared. Clear it during the setup phase.
Signed-off-by: Peter Ujfalusi peter.ujfalusi@nokia.com --- sound/soc/codecs/tlv320dac33.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/sound/soc/codecs/tlv320dac33.c b/sound/soc/codecs/tlv320dac33.c index 1b35d0c..dab7fd5 100644 --- a/sound/soc/codecs/tlv320dac33.c +++ b/sound/soc/codecs/tlv320dac33.c @@ -734,7 +734,10 @@ static int dac33_prepare_chip(struct snd_pcm_substream *substream)
aictrl_a = dac33_read_reg_cache(codec, DAC33_SER_AUDIOIF_CTRL_A); aictrl_a &= ~(DAC33_NCYCL_MASK | DAC33_WLEN_MASK); + /* Read FIFO control A, and clear FIFO flush bit */ fifoctrl_a = dac33_read_reg_cache(codec, DAC33_FIFO_CTRL_A); + fifoctrl_a &= ~DAC33_FIFOFLUSH; + fifoctrl_a &= ~DAC33_WIDTH; switch (substream->runtime->format) { case SNDRV_PCM_FORMAT_S16_LE:
OSCSET calculation was not correct in case of 44.1KHz sampling rate. With small adjustment both 48 and 44.1 KHz calculation now gives the correct value.
Signed-off-by: Peter Ujfalusi peter.ujfalusi@nokia.com --- sound/soc/codecs/tlv320dac33.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/sound/soc/codecs/tlv320dac33.c b/sound/soc/codecs/tlv320dac33.c index dab7fd5..f9f367d 100644 --- a/sound/soc/codecs/tlv320dac33.c +++ b/sound/soc/codecs/tlv320dac33.c @@ -700,7 +700,7 @@ static int dac33_hw_params(struct snd_pcm_substream *substream, }
#define CALC_OSCSET(rate, refclk) ( \ - ((((rate * 10000) / refclk) * 4096) + 5000) / 10000) + ((((rate * 10000) / refclk) * 4096) + 7000) / 10000) #define CALC_RATIOSET(rate, refclk) ( \ ((((refclk * 100000) / rate) * 16384) + 50000) / 100000)
On Tue, 2010-02-16 at 13:23 +0200, Peter Ujfalusi wrote:
Hello,
Two small fixes for the tlv320dac33 codec driver: Clearing the FIFFLUSH flag before playback start The register cache has the bit set after the playback is stopped, so clear it before the playback. OSCSET calculation in case of 44.1KHz sampling rate was off by 1 (0x1588 instead of 0x1589, which is the value should be used according to TI).
Peter Ujfalusi (2): ASoC: tlv320dac33: Clearing FIFOFLUSH flag before playback ASoC: tlv320dac33: Correct the OSCSET calculation
sound/soc/codecs/tlv320dac33.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-)
Acked-by: Liam Girdwood lrg@slimlogic.co.uk
On Tue, Feb 16, 2010 at 01:23:14PM +0200, Peter Ujfalusi wrote:
Hello,
Two small fixes for the tlv320dac33 codec driver: Clearing the FIFFLUSH flag before playback start The register cache has the bit set after the playback is stopped, so clear it before the playback. OSCSET calculation in case of 44.1KHz sampling rate was off by 1 (0x1588 instead of 0x1589, which is the value should be used according to TI).
Applied both, thanks.
participants (3)
-
Liam Girdwood
-
Mark Brown
-
Peter Ujfalusi