diff options
author | Peter Ujfalusi <peter.ujfalusi@nokia.com> | 2010-04-23 03:09:59 -0400 |
---|---|---|
committer | Liam Girdwood <lrg@slimlogic.co.uk> | 2010-04-26 10:16:28 -0400 |
commit | 4260393e71f1e99c2f4fcde10fcb98fe00188d21 (patch) | |
tree | 6f7902d218c6737c99b0efc18751fac8da27462a /sound | |
parent | 55abb59c9a03d3aceda61e97b5ff19d9274fc611 (diff) |
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: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/codecs/tlv320dac33.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/sound/soc/codecs/tlv320dac33.c b/sound/soc/codecs/tlv320dac33.c index b101cbd95740..fa1994262c98 100644 --- a/sound/soc/codecs/tlv320dac33.c +++ b/sound/soc/codecs/tlv320dac33.c | |||
@@ -50,6 +50,9 @@ | |||
50 | 50 | ||
51 | #define LATENCY_TIME_MS 20 | 51 | #define LATENCY_TIME_MS 20 |
52 | 52 | ||
53 | #define MODE7_LTHR 10 | ||
54 | #define MODE7_UTHR (DAC33_BUFFER_SIZE_SAMPLES - 10) | ||
55 | |||
53 | static struct snd_soc_codec *tlv320dac33_codec; | 56 | static struct snd_soc_codec *tlv320dac33_codec; |
54 | 57 | ||
55 | enum dac33_state { | 58 | enum dac33_state { |
@@ -567,7 +570,7 @@ static inline void dac33_prefill_handler(struct tlv320dac33_priv *dac33) | |||
567 | break; | 570 | break; |
568 | case DAC33_FIFO_MODE7: | 571 | case DAC33_FIFO_MODE7: |
569 | dac33_write16(codec, DAC33_PREFILL_MSB, | 572 | dac33_write16(codec, DAC33_PREFILL_MSB, |
570 | DAC33_THRREG(10)); | 573 | DAC33_THRREG(MODE7_LTHR)); |
571 | break; | 574 | break; |
572 | default: | 575 | default: |
573 | dev_warn(codec->dev, "Unhandled FIFO mode: %d\n", | 576 | dev_warn(codec->dev, "Unhandled FIFO mode: %d\n", |
@@ -867,10 +870,8 @@ static int dac33_prepare_chip(struct snd_pcm_substream *substream) | |||
867 | * Configure the threshold levels, and leave 10 sample space | 870 | * Configure the threshold levels, and leave 10 sample space |
868 | * at the bottom, and also at the top of the FIFO | 871 | * at the bottom, and also at the top of the FIFO |
869 | */ | 872 | */ |
870 | dac33_write16(codec, DAC33_UTHR_MSB, | 873 | dac33_write16(codec, DAC33_UTHR_MSB, DAC33_THRREG(MODE7_UTHR)); |
871 | DAC33_THRREG(DAC33_BUFFER_SIZE_SAMPLES - 10)); | 874 | dac33_write16(codec, DAC33_LTHR_MSB, DAC33_THRREG(MODE7_LTHR)); |
872 | dac33_write16(codec, DAC33_LTHR_MSB, | ||
873 | DAC33_THRREG(10)); | ||
874 | break; | 875 | break; |
875 | default: | 876 | default: |
876 | break; | 877 | break; |