aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2014-02-18 04:28:25 -0500
committerMark Brown <broonie@linaro.org>2014-02-22 21:29:27 -0500
commit9f04fba79781fb3ba39eac631f4bd6762f9717db (patch)
tree9594cb0519a967cae3879d263501ad82e20378c9 /sound/soc/codecs
parent38dbfb59d1175ef458d006556061adeaa8751b72 (diff)
ASoC: twl4030: Use SOC_ENUM_SINGLE_DECL()
Just replace with the helper macro. No functional change at all. Signed-off-by: Takashi Iwai <tiwai@suse.de> Acked-by: Liam Girdwood <liam.r.girdwood@linux.intel.com> Acked-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'sound/soc/codecs')
-rw-r--r--sound/soc/codecs/twl4030.c84
1 files changed, 36 insertions, 48 deletions
diff --git a/sound/soc/codecs/twl4030.c b/sound/soc/codecs/twl4030.c
index 00665ada23e2..e084df7e27a5 100644
--- a/sound/soc/codecs/twl4030.c
+++ b/sound/soc/codecs/twl4030.c
@@ -415,10 +415,9 @@ static const struct snd_kcontrol_new twl4030_dapm_carkitr_controls[] = {
415static const char *twl4030_handsfreel_texts[] = 415static const char *twl4030_handsfreel_texts[] =
416 {"Voice", "AudioL1", "AudioL2", "AudioR2"}; 416 {"Voice", "AudioL1", "AudioL2", "AudioR2"};
417 417
418static const struct soc_enum twl4030_handsfreel_enum = 418static SOC_ENUM_SINGLE_DECL(twl4030_handsfreel_enum,
419 SOC_ENUM_SINGLE(TWL4030_REG_HFL_CTL, 0, 419 TWL4030_REG_HFL_CTL, 0,
420 ARRAY_SIZE(twl4030_handsfreel_texts), 420 twl4030_handsfreel_texts);
421 twl4030_handsfreel_texts);
422 421
423static const struct snd_kcontrol_new twl4030_dapm_handsfreel_control = 422static const struct snd_kcontrol_new twl4030_dapm_handsfreel_control =
424SOC_DAPM_ENUM("Route", twl4030_handsfreel_enum); 423SOC_DAPM_ENUM("Route", twl4030_handsfreel_enum);
@@ -431,10 +430,9 @@ static const struct snd_kcontrol_new twl4030_dapm_handsfreelmute_control =
431static const char *twl4030_handsfreer_texts[] = 430static const char *twl4030_handsfreer_texts[] =
432 {"Voice", "AudioR1", "AudioR2", "AudioL2"}; 431 {"Voice", "AudioR1", "AudioR2", "AudioL2"};
433 432
434static const struct soc_enum twl4030_handsfreer_enum = 433static SOC_ENUM_SINGLE_DECL(twl4030_handsfreer_enum,
435 SOC_ENUM_SINGLE(TWL4030_REG_HFR_CTL, 0, 434 TWL4030_REG_HFR_CTL, 0,
436 ARRAY_SIZE(twl4030_handsfreer_texts), 435 twl4030_handsfreer_texts);
437 twl4030_handsfreer_texts);
438 436
439static const struct snd_kcontrol_new twl4030_dapm_handsfreer_control = 437static const struct snd_kcontrol_new twl4030_dapm_handsfreer_control =
440SOC_DAPM_ENUM("Route", twl4030_handsfreer_enum); 438SOC_DAPM_ENUM("Route", twl4030_handsfreer_enum);
@@ -448,10 +446,9 @@ static const struct snd_kcontrol_new twl4030_dapm_handsfreermute_control =
448static const char *twl4030_vibra_texts[] = 446static const char *twl4030_vibra_texts[] =
449 {"AudioL1", "AudioR1", "AudioL2", "AudioR2"}; 447 {"AudioL1", "AudioR1", "AudioL2", "AudioR2"};
450 448
451static const struct soc_enum twl4030_vibra_enum = 449static SOC_ENUM_SINGLE_DECL(twl4030_vibra_enum,
452 SOC_ENUM_SINGLE(TWL4030_REG_VIBRA_CTL, 2, 450 TWL4030_REG_VIBRA_CTL, 2,
453 ARRAY_SIZE(twl4030_vibra_texts), 451 twl4030_vibra_texts);
454 twl4030_vibra_texts);
455 452
456static const struct snd_kcontrol_new twl4030_dapm_vibra_control = 453static const struct snd_kcontrol_new twl4030_dapm_vibra_control =
457SOC_DAPM_ENUM("Route", twl4030_vibra_enum); 454SOC_DAPM_ENUM("Route", twl4030_vibra_enum);
@@ -460,10 +457,9 @@ SOC_DAPM_ENUM("Route", twl4030_vibra_enum);
460static const char *twl4030_vibrapath_texts[] = 457static const char *twl4030_vibrapath_texts[] =
461 {"Local vibrator", "Audio"}; 458 {"Local vibrator", "Audio"};
462 459
463static const struct soc_enum twl4030_vibrapath_enum = 460static SOC_ENUM_SINGLE_DECL(twl4030_vibrapath_enum,
464 SOC_ENUM_SINGLE(TWL4030_REG_VIBRA_CTL, 4, 461 TWL4030_REG_VIBRA_CTL, 4,
465 ARRAY_SIZE(twl4030_vibrapath_texts), 462 twl4030_vibrapath_texts);
466 twl4030_vibrapath_texts);
467 463
468static const struct snd_kcontrol_new twl4030_dapm_vibrapath_control = 464static const struct snd_kcontrol_new twl4030_dapm_vibrapath_control =
469SOC_DAPM_ENUM("Route", twl4030_vibrapath_enum); 465SOC_DAPM_ENUM("Route", twl4030_vibrapath_enum);
@@ -490,10 +486,9 @@ static const struct snd_kcontrol_new twl4030_dapm_analogrmic_controls[] = {
490static const char *twl4030_micpathtx1_texts[] = 486static const char *twl4030_micpathtx1_texts[] =
491 {"Analog", "Digimic0"}; 487 {"Analog", "Digimic0"};
492 488
493static const struct soc_enum twl4030_micpathtx1_enum = 489static SOC_ENUM_SINGLE_DECL(twl4030_micpathtx1_enum,
494 SOC_ENUM_SINGLE(TWL4030_REG_ADCMICSEL, 0, 490 TWL4030_REG_ADCMICSEL, 0,
495 ARRAY_SIZE(twl4030_micpathtx1_texts), 491 twl4030_micpathtx1_texts);
496 twl4030_micpathtx1_texts);
497 492
498static const struct snd_kcontrol_new twl4030_dapm_micpathtx1_control = 493static const struct snd_kcontrol_new twl4030_dapm_micpathtx1_control =
499SOC_DAPM_ENUM("Route", twl4030_micpathtx1_enum); 494SOC_DAPM_ENUM("Route", twl4030_micpathtx1_enum);
@@ -502,10 +497,9 @@ SOC_DAPM_ENUM("Route", twl4030_micpathtx1_enum);
502static const char *twl4030_micpathtx2_texts[] = 497static const char *twl4030_micpathtx2_texts[] =
503 {"Analog", "Digimic1"}; 498 {"Analog", "Digimic1"};
504 499
505static const struct soc_enum twl4030_micpathtx2_enum = 500static SOC_ENUM_SINGLE_DECL(twl4030_micpathtx2_enum,
506 SOC_ENUM_SINGLE(TWL4030_REG_ADCMICSEL, 2, 501 TWL4030_REG_ADCMICSEL, 2,
507 ARRAY_SIZE(twl4030_micpathtx2_texts), 502 twl4030_micpathtx2_texts);
508 twl4030_micpathtx2_texts);
509 503
510static const struct snd_kcontrol_new twl4030_dapm_micpathtx2_control = 504static const struct snd_kcontrol_new twl4030_dapm_micpathtx2_control =
511SOC_DAPM_ENUM("Route", twl4030_micpathtx2_enum); 505SOC_DAPM_ENUM("Route", twl4030_micpathtx2_enum);
@@ -955,10 +949,9 @@ static const char *twl4030_op_modes_texts[] = {
955 "Option 2 (voice/audio)", "Option 1 (audio)" 949 "Option 2 (voice/audio)", "Option 1 (audio)"
956}; 950};
957 951
958static const struct soc_enum twl4030_op_modes_enum = 952static SOC_ENUM_SINGLE_DECL(twl4030_op_modes_enum,
959 SOC_ENUM_SINGLE(TWL4030_REG_CODEC_MODE, 0, 953 TWL4030_REG_CODEC_MODE, 0,
960 ARRAY_SIZE(twl4030_op_modes_texts), 954 twl4030_op_modes_texts);
961 twl4030_op_modes_texts);
962 955
963static int snd_soc_put_twl4030_opmode_enum_double(struct snd_kcontrol *kcontrol, 956static int snd_soc_put_twl4030_opmode_enum_double(struct snd_kcontrol *kcontrol,
964 struct snd_ctl_elem_value *ucontrol) 957 struct snd_ctl_elem_value *ucontrol)
@@ -1044,10 +1037,9 @@ static const char *twl4030_avadc_clk_priority_texts[] = {
1044 "Voice high priority", "HiFi high priority" 1037 "Voice high priority", "HiFi high priority"
1045}; 1038};
1046 1039
1047static const struct soc_enum twl4030_avadc_clk_priority_enum = 1040static SOC_ENUM_SINGLE_DECL(twl4030_avadc_clk_priority_enum,
1048 SOC_ENUM_SINGLE(TWL4030_REG_AVADC_CTL, 2, 1041 TWL4030_REG_AVADC_CTL, 2,
1049 ARRAY_SIZE(twl4030_avadc_clk_priority_texts), 1042 twl4030_avadc_clk_priority_texts);
1050 twl4030_avadc_clk_priority_texts);
1051 1043
1052static const char *twl4030_rampdelay_texts[] = { 1044static const char *twl4030_rampdelay_texts[] = {
1053 "27/20/14 ms", "55/40/27 ms", "109/81/55 ms", "218/161/109 ms", 1045 "27/20/14 ms", "55/40/27 ms", "109/81/55 ms", "218/161/109 ms",
@@ -1055,40 +1047,36 @@ static const char *twl4030_rampdelay_texts[] = {
1055 "3495/2581/1748 ms" 1047 "3495/2581/1748 ms"
1056}; 1048};
1057 1049
1058static const struct soc_enum twl4030_rampdelay_enum = 1050static SOC_ENUM_SINGLE_DECL(twl4030_rampdelay_enum,
1059 SOC_ENUM_SINGLE(TWL4030_REG_HS_POPN_SET, 2, 1051 TWL4030_REG_HS_POPN_SET, 2,
1060 ARRAY_SIZE(twl4030_rampdelay_texts), 1052 twl4030_rampdelay_texts);
1061 twl4030_rampdelay_texts);
1062 1053
1063/* Vibra H-bridge direction mode */ 1054/* Vibra H-bridge direction mode */
1064static const char *twl4030_vibradirmode_texts[] = { 1055static const char *twl4030_vibradirmode_texts[] = {
1065 "Vibra H-bridge direction", "Audio data MSB", 1056 "Vibra H-bridge direction", "Audio data MSB",
1066}; 1057};
1067 1058
1068static const struct soc_enum twl4030_vibradirmode_enum = 1059static SOC_ENUM_SINGLE_DECL(twl4030_vibradirmode_enum,
1069 SOC_ENUM_SINGLE(TWL4030_REG_VIBRA_CTL, 5, 1060 TWL4030_REG_VIBRA_CTL, 5,
1070 ARRAY_SIZE(twl4030_vibradirmode_texts), 1061 twl4030_vibradirmode_texts);
1071 twl4030_vibradirmode_texts);
1072 1062
1073/* Vibra H-bridge direction */ 1063/* Vibra H-bridge direction */
1074static const char *twl4030_vibradir_texts[] = { 1064static const char *twl4030_vibradir_texts[] = {
1075 "Positive polarity", "Negative polarity", 1065 "Positive polarity", "Negative polarity",
1076}; 1066};
1077 1067
1078static const struct soc_enum twl4030_vibradir_enum = 1068static SOC_ENUM_SINGLE_DECL(twl4030_vibradir_enum,
1079 SOC_ENUM_SINGLE(TWL4030_REG_VIBRA_CTL, 1, 1069 TWL4030_REG_VIBRA_CTL, 1,
1080 ARRAY_SIZE(twl4030_vibradir_texts), 1070 twl4030_vibradir_texts);
1081 twl4030_vibradir_texts);
1082 1071
1083/* Digimic Left and right swapping */ 1072/* Digimic Left and right swapping */
1084static const char *twl4030_digimicswap_texts[] = { 1073static const char *twl4030_digimicswap_texts[] = {
1085 "Not swapped", "Swapped", 1074 "Not swapped", "Swapped",
1086}; 1075};
1087 1076
1088static const struct soc_enum twl4030_digimicswap_enum = 1077static SOC_ENUM_SINGLE_DECL(twl4030_digimicswap_enum,
1089 SOC_ENUM_SINGLE(TWL4030_REG_MISC_SET_1, 0, 1078 TWL4030_REG_MISC_SET_1, 0,
1090 ARRAY_SIZE(twl4030_digimicswap_texts), 1079 twl4030_digimicswap_texts);
1091 twl4030_digimicswap_texts);
1092 1080
1093static const struct snd_kcontrol_new twl4030_snd_controls[] = { 1081static const struct snd_kcontrol_new twl4030_snd_controls[] = {
1094 /* Codec operation mode control */ 1082 /* Codec operation mode control */