Skip to contentSkip to conversation

ASoC: tlv320dac33: small fixes

PATCH Applied Peter Ujfalusi 3 participants 5 messages Feb 16, 2010

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover 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(-)
#1 lore raw

PATCH 1/2 ASoC: tlv320dac33: Clearing FIFOFLUSH flag before playback

In repeated playback the FIFOFLUSH bit remained set, and never has been cleared.
Clear it during the setup phase.

---
 sound/soc/codecs/tlv320dac33.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
sound/soc/codecs/tlv320dac33.c +3 -0
index 1b35d0c..dab7fd5 100644
@@ -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:
Signature · 1 line
1.7.0
#2 lore raw

PATCH 2/2 ASoC: tlv320dac33: Correct the OSCSET calculation

In reply to Peter Ujfalusi

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.

---
 sound/soc/codecs/tlv320dac33.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
sound/soc/codecs/tlv320dac33.c +1 -1
index dab7fd5..f9f367d 100644
@@ -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)
 
Signature · 1 line
1.7.0
Acked-by on the v1 series
#3 lore raw
In reply to Peter Ujfalusi
Quoted 9 lines · Peter Ujfalusi

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).

Quoted 7 lines

---
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(-)
Signature · 3 lines
Freelance Developer, SlimLogic Ltd
ASoC and Voltage Regulator Maintainer.
http://www.slimlogic.co.uk
Applied
#4 lore raw
In reply to Peter Ujfalusi
Quoted 8 lines · Peter Ujfalusi

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.