ASoC: tlv320dac33: small fixes
Subsystems (3)
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(-)
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
@@ -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
PATCH 2/2 ASoC: tlv320dac33: Correct the OSCSET calculation
In reply to Peter UjfalusiOSCSET 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
@@ -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
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 of0x1589, 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 calculationsound/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
Mark Brown
AppliedQuoted 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 of0x1589, which is the value should be used according to TI).
Applied both, thanks.