diff options
author | Takashi Iwai <tiwai@suse.de> | 2014-02-18 04:28:25 -0500 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2014-02-22 21:29:27 -0500 |
commit | 9f04fba79781fb3ba39eac631f4bd6762f9717db (patch) | |
tree | 9594cb0519a967cae3879d263501ad82e20378c9 /sound/soc/codecs | |
parent | 38dbfb59d1175ef458d006556061adeaa8751b72 (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.c | 84 |
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[] = { | |||
415 | static const char *twl4030_handsfreel_texts[] = | 415 | static const char *twl4030_handsfreel_texts[] = |
416 | {"Voice", "AudioL1", "AudioL2", "AudioR2"}; | 416 | {"Voice", "AudioL1", "AudioL2", "AudioR2"}; |
417 | 417 | ||
418 | static const struct soc_enum twl4030_handsfreel_enum = | 418 | static 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 | ||
423 | static const struct snd_kcontrol_new twl4030_dapm_handsfreel_control = | 422 | static const struct snd_kcontrol_new twl4030_dapm_handsfreel_control = |
424 | SOC_DAPM_ENUM("Route", twl4030_handsfreel_enum); | 423 | SOC_DAPM_ENUM("Route", twl4030_handsfreel_enum); |
@@ -431,10 +430,9 @@ static const struct snd_kcontrol_new twl4030_dapm_handsfreelmute_control = | |||
431 | static const char *twl4030_handsfreer_texts[] = | 430 | static const char *twl4030_handsfreer_texts[] = |
432 | {"Voice", "AudioR1", "AudioR2", "AudioL2"}; | 431 | {"Voice", "AudioR1", "AudioR2", "AudioL2"}; |
433 | 432 | ||
434 | static const struct soc_enum twl4030_handsfreer_enum = | 433 | static 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 | ||
439 | static const struct snd_kcontrol_new twl4030_dapm_handsfreer_control = | 437 | static const struct snd_kcontrol_new twl4030_dapm_handsfreer_control = |
440 | SOC_DAPM_ENUM("Route", twl4030_handsfreer_enum); | 438 | SOC_DAPM_ENUM("Route", twl4030_handsfreer_enum); |
@@ -448,10 +446,9 @@ static const struct snd_kcontrol_new twl4030_dapm_handsfreermute_control = | |||
448 | static const char *twl4030_vibra_texts[] = | 446 | static const char *twl4030_vibra_texts[] = |
449 | {"AudioL1", "AudioR1", "AudioL2", "AudioR2"}; | 447 | {"AudioL1", "AudioR1", "AudioL2", "AudioR2"}; |
450 | 448 | ||
451 | static const struct soc_enum twl4030_vibra_enum = | 449 | static 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 | ||
456 | static const struct snd_kcontrol_new twl4030_dapm_vibra_control = | 453 | static const struct snd_kcontrol_new twl4030_dapm_vibra_control = |
457 | SOC_DAPM_ENUM("Route", twl4030_vibra_enum); | 454 | SOC_DAPM_ENUM("Route", twl4030_vibra_enum); |
@@ -460,10 +457,9 @@ SOC_DAPM_ENUM("Route", twl4030_vibra_enum); | |||
460 | static const char *twl4030_vibrapath_texts[] = | 457 | static const char *twl4030_vibrapath_texts[] = |
461 | {"Local vibrator", "Audio"}; | 458 | {"Local vibrator", "Audio"}; |
462 | 459 | ||
463 | static const struct soc_enum twl4030_vibrapath_enum = | 460 | static 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 | ||
468 | static const struct snd_kcontrol_new twl4030_dapm_vibrapath_control = | 464 | static const struct snd_kcontrol_new twl4030_dapm_vibrapath_control = |
469 | SOC_DAPM_ENUM("Route", twl4030_vibrapath_enum); | 465 | SOC_DAPM_ENUM("Route", twl4030_vibrapath_enum); |
@@ -490,10 +486,9 @@ static const struct snd_kcontrol_new twl4030_dapm_analogrmic_controls[] = { | |||
490 | static const char *twl4030_micpathtx1_texts[] = | 486 | static const char *twl4030_micpathtx1_texts[] = |
491 | {"Analog", "Digimic0"}; | 487 | {"Analog", "Digimic0"}; |
492 | 488 | ||
493 | static const struct soc_enum twl4030_micpathtx1_enum = | 489 | static 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 | ||
498 | static const struct snd_kcontrol_new twl4030_dapm_micpathtx1_control = | 493 | static const struct snd_kcontrol_new twl4030_dapm_micpathtx1_control = |
499 | SOC_DAPM_ENUM("Route", twl4030_micpathtx1_enum); | 494 | SOC_DAPM_ENUM("Route", twl4030_micpathtx1_enum); |
@@ -502,10 +497,9 @@ SOC_DAPM_ENUM("Route", twl4030_micpathtx1_enum); | |||
502 | static const char *twl4030_micpathtx2_texts[] = | 497 | static const char *twl4030_micpathtx2_texts[] = |
503 | {"Analog", "Digimic1"}; | 498 | {"Analog", "Digimic1"}; |
504 | 499 | ||
505 | static const struct soc_enum twl4030_micpathtx2_enum = | 500 | static 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 | ||
510 | static const struct snd_kcontrol_new twl4030_dapm_micpathtx2_control = | 504 | static const struct snd_kcontrol_new twl4030_dapm_micpathtx2_control = |
511 | SOC_DAPM_ENUM("Route", twl4030_micpathtx2_enum); | 505 | SOC_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 | ||
958 | static const struct soc_enum twl4030_op_modes_enum = | 952 | static 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 | ||
963 | static int snd_soc_put_twl4030_opmode_enum_double(struct snd_kcontrol *kcontrol, | 956 | static 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 | ||
1047 | static const struct soc_enum twl4030_avadc_clk_priority_enum = | 1040 | static 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 | ||
1052 | static const char *twl4030_rampdelay_texts[] = { | 1044 | static 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 | ||
1058 | static const struct soc_enum twl4030_rampdelay_enum = | 1050 | static 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 */ |
1064 | static const char *twl4030_vibradirmode_texts[] = { | 1055 | static 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 | ||
1068 | static const struct soc_enum twl4030_vibradirmode_enum = | 1059 | static 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 */ |
1074 | static const char *twl4030_vibradir_texts[] = { | 1064 | static const char *twl4030_vibradir_texts[] = { |
1075 | "Positive polarity", "Negative polarity", | 1065 | "Positive polarity", "Negative polarity", |
1076 | }; | 1066 | }; |
1077 | 1067 | ||
1078 | static const struct soc_enum twl4030_vibradir_enum = | 1068 | static 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 */ |
1084 | static const char *twl4030_digimicswap_texts[] = { | 1073 | static const char *twl4030_digimicswap_texts[] = { |
1085 | "Not swapped", "Swapped", | 1074 | "Not swapped", "Swapped", |
1086 | }; | 1075 | }; |
1087 | 1076 | ||
1088 | static const struct soc_enum twl4030_digimicswap_enum = | 1077 | static 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 | ||
1093 | static const struct snd_kcontrol_new twl4030_snd_controls[] = { | 1081 | static const struct snd_kcontrol_new twl4030_snd_controls[] = { |
1094 | /* Codec operation mode control */ | 1082 | /* Codec operation mode control */ |