aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew F. Davis <afd@ti.com>2017-12-12 17:43:04 -0500
committerMark Brown <broonie@kernel.org>2017-12-13 07:27:26 -0500
commit7e2a4dc5c1f0875646816c527cad5943cb6d5cc7 (patch)
tree053b9bd9c2a1f905c7a1418fc37137745fc9f2d0
parent1714196c7ec540292324d9022c43b5f281dbf74c (diff)
ASoC: tlv320aic32x4: Drop define mapping from number to number
Drop definition of frequencies that only map from one number to the same number. This is not needed and if misused can hide bugs. Signed-off-by: Andrew F. Davis <afd@ti.com> Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--sound/soc/codecs/tlv320aic32x4.c46
-rw-r--r--sound/soc/codecs/tlv320aic32x4.h4
2 files changed, 23 insertions, 27 deletions
diff --git a/sound/soc/codecs/tlv320aic32x4.c b/sound/soc/codecs/tlv320aic32x4.c
index e694f5f04eb9..d7a67bfcc6d8 100644
--- a/sound/soc/codecs/tlv320aic32x4.c
+++ b/sound/soc/codecs/tlv320aic32x4.c
@@ -281,34 +281,34 @@ static const struct snd_kcontrol_new aic32x4_snd_controls[] = {
281 281
282static const struct aic32x4_rate_divs aic32x4_divs[] = { 282static const struct aic32x4_rate_divs aic32x4_divs[] = {
283 /* 8k rate */ 283 /* 8k rate */
284 {AIC32X4_FREQ_12000000, 8000, 1, 7, 6800, 768, 5, 3, 128, 5, 18, 24}, 284 {12000000, 8000, 1, 7, 6800, 768, 5, 3, 128, 5, 18, 24},
285 {AIC32X4_FREQ_24000000, 8000, 2, 7, 6800, 768, 15, 1, 64, 45, 4, 24}, 285 {24000000, 8000, 2, 7, 6800, 768, 15, 1, 64, 45, 4, 24},
286 {AIC32X4_FREQ_25000000, 8000, 2, 7, 3728, 768, 15, 1, 64, 45, 4, 24}, 286 {25000000, 8000, 2, 7, 3728, 768, 15, 1, 64, 45, 4, 24},
287 /* 11.025k rate */ 287 /* 11.025k rate */
288 {AIC32X4_FREQ_12000000, 11025, 1, 7, 5264, 512, 8, 2, 128, 8, 8, 16}, 288 {12000000, 11025, 1, 7, 5264, 512, 8, 2, 128, 8, 8, 16},
289 {AIC32X4_FREQ_24000000, 11025, 2, 7, 5264, 512, 16, 1, 64, 32, 4, 16}, 289 {24000000, 11025, 2, 7, 5264, 512, 16, 1, 64, 32, 4, 16},
290 /* 16k rate */ 290 /* 16k rate */
291 {AIC32X4_FREQ_12000000, 16000, 1, 7, 6800, 384, 5, 3, 128, 5, 9, 12}, 291 {12000000, 16000, 1, 7, 6800, 384, 5, 3, 128, 5, 9, 12},
292 {AIC32X4_FREQ_24000000, 16000, 2, 7, 6800, 384, 15, 1, 64, 18, 5, 12}, 292 {24000000, 16000, 2, 7, 6800, 384, 15, 1, 64, 18, 5, 12},
293 {AIC32X4_FREQ_25000000, 16000, 2, 7, 3728, 384, 15, 1, 64, 18, 5, 12}, 293 {25000000, 16000, 2, 7, 3728, 384, 15, 1, 64, 18, 5, 12},
294 /* 22.05k rate */ 294 /* 22.05k rate */
295 {AIC32X4_FREQ_12000000, 22050, 1, 7, 5264, 256, 4, 4, 128, 4, 8, 8}, 295 {12000000, 22050, 1, 7, 5264, 256, 4, 4, 128, 4, 8, 8},
296 {AIC32X4_FREQ_24000000, 22050, 2, 7, 5264, 256, 16, 1, 64, 16, 4, 8}, 296 {24000000, 22050, 2, 7, 5264, 256, 16, 1, 64, 16, 4, 8},
297 {AIC32X4_FREQ_25000000, 22050, 2, 7, 2253, 256, 16, 1, 64, 16, 4, 8}, 297 {25000000, 22050, 2, 7, 2253, 256, 16, 1, 64, 16, 4, 8},
298 /* 32k rate */ 298 /* 32k rate */
299 {AIC32X4_FREQ_12000000, 32000, 1, 7, 1680, 192, 2, 7, 64, 2, 21, 6}, 299 {12000000, 32000, 1, 7, 1680, 192, 2, 7, 64, 2, 21, 6},
300 {AIC32X4_FREQ_24000000, 32000, 2, 7, 1680, 192, 7, 2, 64, 7, 6, 6}, 300 {24000000, 32000, 2, 7, 1680, 192, 7, 2, 64, 7, 6, 6},
301 /* 44.1k rate */ 301 /* 44.1k rate */
302 {AIC32X4_FREQ_12000000, 44100, 1, 7, 5264, 128, 2, 8, 128, 2, 8, 4}, 302 {12000000, 44100, 1, 7, 5264, 128, 2, 8, 128, 2, 8, 4},
303 {AIC32X4_FREQ_24000000, 44100, 2, 7, 5264, 128, 8, 2, 64, 8, 4, 4}, 303 {24000000, 44100, 2, 7, 5264, 128, 8, 2, 64, 8, 4, 4},
304 {AIC32X4_FREQ_25000000, 44100, 2, 7, 2253, 128, 8, 2, 64, 8, 4, 4}, 304 {25000000, 44100, 2, 7, 2253, 128, 8, 2, 64, 8, 4, 4},
305 /* 48k rate */ 305 /* 48k rate */
306 {AIC32X4_FREQ_12000000, 48000, 1, 8, 1920, 128, 2, 8, 128, 2, 8, 4}, 306 {12000000, 48000, 1, 8, 1920, 128, 2, 8, 128, 2, 8, 4},
307 {AIC32X4_FREQ_24000000, 48000, 2, 8, 1920, 128, 8, 2, 64, 8, 4, 4}, 307 {24000000, 48000, 2, 8, 1920, 128, 8, 2, 64, 8, 4, 4},
308 {AIC32X4_FREQ_25000000, 48000, 2, 7, 8643, 128, 8, 2, 64, 8, 4, 4}, 308 {25000000, 48000, 2, 7, 8643, 128, 8, 2, 64, 8, 4, 4},
309 309
310 /* 96k rate */ 310 /* 96k rate */
311 {AIC32X4_FREQ_25000000, 96000, 2, 7, 8643, 64, 4, 4, 64, 4, 4, 1}, 311 {25000000, 96000, 2, 7, 8643, 64, 4, 4, 64, 4, 4, 1},
312}; 312};
313 313
314static const struct snd_kcontrol_new hpl_output_mixer_controls[] = { 314static const struct snd_kcontrol_new hpl_output_mixer_controls[] = {
@@ -601,9 +601,9 @@ static int aic32x4_set_dai_sysclk(struct snd_soc_dai *codec_dai,
601 struct aic32x4_priv *aic32x4 = snd_soc_codec_get_drvdata(codec); 601 struct aic32x4_priv *aic32x4 = snd_soc_codec_get_drvdata(codec);
602 602
603 switch (freq) { 603 switch (freq) {
604 case AIC32X4_FREQ_12000000: 604 case 12000000:
605 case AIC32X4_FREQ_24000000: 605 case 24000000:
606 case AIC32X4_FREQ_25000000: 606 case 25000000:
607 aic32x4->sysclk = freq; 607 aic32x4->sysclk = freq;
608 return 0; 608 return 0;
609 } 609 }
diff --git a/sound/soc/codecs/tlv320aic32x4.h b/sound/soc/codecs/tlv320aic32x4.h
index 936bb7a1b5c8..b017211f83eb 100644
--- a/sound/soc/codecs/tlv320aic32x4.h
+++ b/sound/soc/codecs/tlv320aic32x4.h
@@ -97,10 +97,6 @@ int aic32x4_remove(struct device *dev);
97#define AIC32X4_LMICPGAVOL AIC32X4_REG(1, 59) 97#define AIC32X4_LMICPGAVOL AIC32X4_REG(1, 59)
98#define AIC32X4_RMICPGAVOL AIC32X4_REG(1, 60) 98#define AIC32X4_RMICPGAVOL AIC32X4_REG(1, 60)
99 99
100#define AIC32X4_FREQ_12000000 12000000
101#define AIC32X4_FREQ_24000000 24000000
102#define AIC32X4_FREQ_25000000 25000000
103
104#define AIC32X4_WORD_LEN_16BITS 0x00 100#define AIC32X4_WORD_LEN_16BITS 0x00
105#define AIC32X4_WORD_LEN_20BITS 0x01 101#define AIC32X4_WORD_LEN_20BITS 0x01
106#define AIC32X4_WORD_LEN_24BITS 0x02 102#define AIC32X4_WORD_LEN_24BITS 0x02