Commit 4260393e authored by Peter Ujfalusi's avatar Peter Ujfalusi Committed by Liam Girdwood

ASoC: tlv320dac33: Change magic numbers used in Mode7

Upper and Lower threshold values are used as magic
numbers. Replace them with defines for later use.
Signed-off-by: default avatarPeter Ujfalusi <peter.ujfalusi@nokia.com>
Acked-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: default avatarLiam Girdwood <lrg@slimlogic.co.uk>
parent 55abb59c
...@@ -50,6 +50,9 @@ ...@@ -50,6 +50,9 @@
#define LATENCY_TIME_MS 20 #define LATENCY_TIME_MS 20
#define MODE7_LTHR 10
#define MODE7_UTHR (DAC33_BUFFER_SIZE_SAMPLES - 10)
static struct snd_soc_codec *tlv320dac33_codec; static struct snd_soc_codec *tlv320dac33_codec;
enum dac33_state { enum dac33_state {
...@@ -567,7 +570,7 @@ static inline void dac33_prefill_handler(struct tlv320dac33_priv *dac33) ...@@ -567,7 +570,7 @@ static inline void dac33_prefill_handler(struct tlv320dac33_priv *dac33)
break; break;
case DAC33_FIFO_MODE7: case DAC33_FIFO_MODE7:
dac33_write16(codec, DAC33_PREFILL_MSB, dac33_write16(codec, DAC33_PREFILL_MSB,
DAC33_THRREG(10)); DAC33_THRREG(MODE7_LTHR));
break; break;
default: default:
dev_warn(codec->dev, "Unhandled FIFO mode: %d\n", dev_warn(codec->dev, "Unhandled FIFO mode: %d\n",
...@@ -867,10 +870,8 @@ static int dac33_prepare_chip(struct snd_pcm_substream *substream) ...@@ -867,10 +870,8 @@ static int dac33_prepare_chip(struct snd_pcm_substream *substream)
* Configure the threshold levels, and leave 10 sample space * Configure the threshold levels, and leave 10 sample space
* at the bottom, and also at the top of the FIFO * at the bottom, and also at the top of the FIFO
*/ */
dac33_write16(codec, DAC33_UTHR_MSB, dac33_write16(codec, DAC33_UTHR_MSB, DAC33_THRREG(MODE7_UTHR));
DAC33_THRREG(DAC33_BUFFER_SIZE_SAMPLES - 10)); dac33_write16(codec, DAC33_LTHR_MSB, DAC33_THRREG(MODE7_LTHR));
dac33_write16(codec, DAC33_LTHR_MSB,
DAC33_THRREG(10));
break; break;
default: default:
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment