diff options
| -rw-r--r-- | sound/soc/codecs/wm8904.c | 73 |
1 files changed, 37 insertions, 36 deletions
diff --git a/sound/soc/codecs/wm8904.c b/sound/soc/codecs/wm8904.c index 53bbfac6a83a..cf12a9023bae 100644 --- a/sound/soc/codecs/wm8904.c +++ b/sound/soc/codecs/wm8904.c | |||
| @@ -552,18 +552,20 @@ static const char *input_mode_text[] = { | |||
| 552 | "Single-Ended", "Differential Line", "Differential Mic" | 552 | "Single-Ended", "Differential Line", "Differential Mic" |
| 553 | }; | 553 | }; |
| 554 | 554 | ||
| 555 | static const struct soc_enum lin_mode = | 555 | static SOC_ENUM_SINGLE_DECL(lin_mode, |
| 556 | SOC_ENUM_SINGLE(WM8904_ANALOGUE_LEFT_INPUT_1, 0, 3, input_mode_text); | 556 | WM8904_ANALOGUE_LEFT_INPUT_1, 0, |
| 557 | input_mode_text); | ||
| 557 | 558 | ||
| 558 | static const struct soc_enum rin_mode = | 559 | static SOC_ENUM_SINGLE_DECL(rin_mode, |
| 559 | SOC_ENUM_SINGLE(WM8904_ANALOGUE_RIGHT_INPUT_1, 0, 3, input_mode_text); | 560 | WM8904_ANALOGUE_RIGHT_INPUT_1, 0, |
| 561 | input_mode_text); | ||
| 560 | 562 | ||
| 561 | static const char *hpf_mode_text[] = { | 563 | static const char *hpf_mode_text[] = { |
| 562 | "Hi-fi", "Voice 1", "Voice 2", "Voice 3" | 564 | "Hi-fi", "Voice 1", "Voice 2", "Voice 3" |
| 563 | }; | 565 | }; |
| 564 | 566 | ||
| 565 | static const struct soc_enum hpf_mode = | 567 | static SOC_ENUM_SINGLE_DECL(hpf_mode, WM8904_ADC_DIGITAL_0, 5, |
| 566 | SOC_ENUM_SINGLE(WM8904_ADC_DIGITAL_0, 5, 4, hpf_mode_text); | 568 | hpf_mode_text); |
| 567 | 569 | ||
| 568 | static int wm8904_adc_osr_put(struct snd_kcontrol *kcontrol, | 570 | static int wm8904_adc_osr_put(struct snd_kcontrol *kcontrol, |
| 569 | struct snd_ctl_elem_value *ucontrol) | 571 | struct snd_ctl_elem_value *ucontrol) |
| @@ -611,8 +613,7 @@ static const char *drc_path_text[] = { | |||
| 611 | "ADC", "DAC" | 613 | "ADC", "DAC" |
| 612 | }; | 614 | }; |
| 613 | 615 | ||
| 614 | static const struct soc_enum drc_path = | 616 | static SOC_ENUM_SINGLE_DECL(drc_path, WM8904_DRC_0, 14, drc_path_text); |
| 615 | SOC_ENUM_SINGLE(WM8904_DRC_0, 14, 2, drc_path_text); | ||
| 616 | 617 | ||
| 617 | static const struct snd_kcontrol_new wm8904_dac_snd_controls[] = { | 618 | static const struct snd_kcontrol_new wm8904_dac_snd_controls[] = { |
| 618 | SOC_SINGLE_TLV("Digital Playback Boost Volume", | 619 | SOC_SINGLE_TLV("Digital Playback Boost Volume", |
| @@ -858,14 +859,14 @@ static const char *lin_text[] = { | |||
| 858 | "IN1L", "IN2L", "IN3L" | 859 | "IN1L", "IN2L", "IN3L" |
| 859 | }; | 860 | }; |
| 860 | 861 | ||
| 861 | static const struct soc_enum lin_enum = | 862 | static SOC_ENUM_SINGLE_DECL(lin_enum, WM8904_ANALOGUE_LEFT_INPUT_1, 2, |
| 862 | SOC_ENUM_SINGLE(WM8904_ANALOGUE_LEFT_INPUT_1, 2, 3, lin_text); | 863 | lin_text); |
| 863 | 864 | ||
| 864 | static const struct snd_kcontrol_new lin_mux = | 865 | static const struct snd_kcontrol_new lin_mux = |
| 865 | SOC_DAPM_ENUM("Left Capture Mux", lin_enum); | 866 | SOC_DAPM_ENUM("Left Capture Mux", lin_enum); |
| 866 | 867 | ||
| 867 | static const struct soc_enum lin_inv_enum = | 868 | static SOC_ENUM_SINGLE_DECL(lin_inv_enum, WM8904_ANALOGUE_LEFT_INPUT_1, 4, |
| 868 | SOC_ENUM_SINGLE(WM8904_ANALOGUE_LEFT_INPUT_1, 4, 3, lin_text); | 869 | lin_text); |
| 869 | 870 | ||
| 870 | static const struct snd_kcontrol_new lin_inv_mux = | 871 | static const struct snd_kcontrol_new lin_inv_mux = |
| 871 | SOC_DAPM_ENUM("Left Capture Inveting Mux", lin_inv_enum); | 872 | SOC_DAPM_ENUM("Left Capture Inveting Mux", lin_inv_enum); |
| @@ -874,14 +875,14 @@ static const char *rin_text[] = { | |||
| 874 | "IN1R", "IN2R", "IN3R" | 875 | "IN1R", "IN2R", "IN3R" |
| 875 | }; | 876 | }; |
| 876 | 877 | ||
| 877 | static const struct soc_enum rin_enum = | 878 | static SOC_ENUM_SINGLE_DECL(rin_enum, WM8904_ANALOGUE_RIGHT_INPUT_1, 2, |
| 878 | SOC_ENUM_SINGLE(WM8904_ANALOGUE_RIGHT_INPUT_1, 2, 3, rin_text); | 879 | rin_text); |
| 879 | 880 | ||
| 880 | static const struct snd_kcontrol_new rin_mux = | 881 | static const struct snd_kcontrol_new rin_mux = |
| 881 | SOC_DAPM_ENUM("Right Capture Mux", rin_enum); | 882 | SOC_DAPM_ENUM("Right Capture Mux", rin_enum); |
| 882 | 883 | ||
| 883 | static const struct soc_enum rin_inv_enum = | 884 | static SOC_ENUM_SINGLE_DECL(rin_inv_enum, WM8904_ANALOGUE_RIGHT_INPUT_1, 4, |
| 884 | SOC_ENUM_SINGLE(WM8904_ANALOGUE_RIGHT_INPUT_1, 4, 3, rin_text); | 885 | rin_text); |
| 885 | 886 | ||
| 886 | static const struct snd_kcontrol_new rin_inv_mux = | 887 | static const struct snd_kcontrol_new rin_inv_mux = |
| 887 | SOC_DAPM_ENUM("Right Capture Inveting Mux", rin_inv_enum); | 888 | SOC_DAPM_ENUM("Right Capture Inveting Mux", rin_inv_enum); |
| @@ -890,26 +891,26 @@ static const char *aif_text[] = { | |||
| 890 | "Left", "Right" | 891 | "Left", "Right" |
| 891 | }; | 892 | }; |
| 892 | 893 | ||
| 893 | static const struct soc_enum aifoutl_enum = | 894 | static SOC_ENUM_SINGLE_DECL(aifoutl_enum, WM8904_AUDIO_INTERFACE_0, 7, |
| 894 | SOC_ENUM_SINGLE(WM8904_AUDIO_INTERFACE_0, 7, 2, aif_text); | 895 | aif_text); |
| 895 | 896 | ||
| 896 | static const struct snd_kcontrol_new aifoutl_mux = | 897 | static const struct snd_kcontrol_new aifoutl_mux = |
| 897 | SOC_DAPM_ENUM("AIFOUTL Mux", aifoutl_enum); | 898 | SOC_DAPM_ENUM("AIFOUTL Mux", aifoutl_enum); |
| 898 | 899 | ||
| 899 | static const struct soc_enum aifoutr_enum = | 900 | static SOC_ENUM_SINGLE_DECL(aifoutr_enum, WM8904_AUDIO_INTERFACE_0, 6, |
| 900 | SOC_ENUM_SINGLE(WM8904_AUDIO_INTERFACE_0, 6, 2, aif_text); | 901 | aif_text); |
| 901 | 902 | ||
| 902 | static const struct snd_kcontrol_new aifoutr_mux = | 903 | static const struct snd_kcontrol_new aifoutr_mux = |
| 903 | SOC_DAPM_ENUM("AIFOUTR Mux", aifoutr_enum); | 904 | SOC_DAPM_ENUM("AIFOUTR Mux", aifoutr_enum); |
| 904 | 905 | ||
| 905 | static const struct soc_enum aifinl_enum = | 906 | static SOC_ENUM_SINGLE_DECL(aifinl_enum, WM8904_AUDIO_INTERFACE_0, 5, |
| 906 | SOC_ENUM_SINGLE(WM8904_AUDIO_INTERFACE_0, 5, 2, aif_text); | 907 | aif_text); |
| 907 | 908 | ||
| 908 | static const struct snd_kcontrol_new aifinl_mux = | 909 | static const struct snd_kcontrol_new aifinl_mux = |
| 909 | SOC_DAPM_ENUM("AIFINL Mux", aifinl_enum); | 910 | SOC_DAPM_ENUM("AIFINL Mux", aifinl_enum); |
| 910 | 911 | ||
| 911 | static const struct soc_enum aifinr_enum = | 912 | static SOC_ENUM_SINGLE_DECL(aifinr_enum, WM8904_AUDIO_INTERFACE_0, 4, |
| 912 | SOC_ENUM_SINGLE(WM8904_AUDIO_INTERFACE_0, 4, 2, aif_text); | 913 | aif_text); |
| 913 | 914 | ||
| 914 | static const struct snd_kcontrol_new aifinr_mux = | 915 | static const struct snd_kcontrol_new aifinr_mux = |
| 915 | SOC_DAPM_ENUM("AIFINR Mux", aifinr_enum); | 916 | SOC_DAPM_ENUM("AIFINR Mux", aifinr_enum); |
| @@ -991,26 +992,26 @@ static const char *out_mux_text[] = { | |||
| 991 | "DAC", "Bypass" | 992 | "DAC", "Bypass" |
| 992 | }; | 993 | }; |
| 993 | 994 | ||
| 994 | static const struct soc_enum hpl_enum = | 995 | static SOC_ENUM_SINGLE_DECL(hpl_enum, WM8904_ANALOGUE_OUT12_ZC, 3, |
| 995 | SOC_ENUM_SINGLE(WM8904_ANALOGUE_OUT12_ZC, 3, 2, out_mux_text); | 996 | out_mux_text); |
| 996 | 997 | ||
| 997 | static const struct snd_kcontrol_new hpl_mux = | 998 | static const struct snd_kcontrol_new hpl_mux = |
| 998 | SOC_DAPM_ENUM("HPL Mux", hpl_enum); | 999 | SOC_DAPM_ENUM("HPL Mux", hpl_enum); |
| 999 | 1000 | ||
| 1000 | static const struct soc_enum hpr_enum = | 1001 | static SOC_ENUM_SINGLE_DECL(hpr_enum, WM8904_ANALOGUE_OUT12_ZC, 2, |
| 1001 | SOC_ENUM_SINGLE(WM8904_ANALOGUE_OUT12_ZC, 2, 2, out_mux_text); | 1002 | out_mux_text); |
| 1002 | 1003 | ||
| 1003 | static const struct snd_kcontrol_new hpr_mux = | 1004 | static const struct snd_kcontrol_new hpr_mux = |
| 1004 | SOC_DAPM_ENUM("HPR Mux", hpr_enum); | 1005 | SOC_DAPM_ENUM("HPR Mux", hpr_enum); |
| 1005 | 1006 | ||
| 1006 | static const struct soc_enum linel_enum = | 1007 | static SOC_ENUM_SINGLE_DECL(linel_enum, WM8904_ANALOGUE_OUT12_ZC, 1, |
| 1007 | SOC_ENUM_SINGLE(WM8904_ANALOGUE_OUT12_ZC, 1, 2, out_mux_text); | 1008 | out_mux_text); |
| 1008 | 1009 | ||
| 1009 | static const struct snd_kcontrol_new linel_mux = | 1010 | static const struct snd_kcontrol_new linel_mux = |
| 1010 | SOC_DAPM_ENUM("LINEL Mux", linel_enum); | 1011 | SOC_DAPM_ENUM("LINEL Mux", linel_enum); |
| 1011 | 1012 | ||
| 1012 | static const struct soc_enum liner_enum = | 1013 | static SOC_ENUM_SINGLE_DECL(liner_enum, WM8904_ANALOGUE_OUT12_ZC, 0, |
| 1013 | SOC_ENUM_SINGLE(WM8904_ANALOGUE_OUT12_ZC, 0, 2, out_mux_text); | 1014 | out_mux_text); |
| 1014 | 1015 | ||
| 1015 | static const struct snd_kcontrol_new liner_mux = | 1016 | static const struct snd_kcontrol_new liner_mux = |
| 1016 | SOC_DAPM_ENUM("LINER Mux", liner_enum); | 1017 | SOC_DAPM_ENUM("LINER Mux", liner_enum); |
| @@ -1019,14 +1020,14 @@ static const char *sidetone_text[] = { | |||
| 1019 | "None", "Left", "Right" | 1020 | "None", "Left", "Right" |
| 1020 | }; | 1021 | }; |
| 1021 | 1022 | ||
| 1022 | static const struct soc_enum dacl_sidetone_enum = | 1023 | static SOC_ENUM_SINGLE_DECL(dacl_sidetone_enum, WM8904_DAC_DIGITAL_0, 2, |
| 1023 | SOC_ENUM_SINGLE(WM8904_DAC_DIGITAL_0, 2, 3, sidetone_text); | 1024 | sidetone_text); |
| 1024 | 1025 | ||
| 1025 | static const struct snd_kcontrol_new dacl_sidetone_mux = | 1026 | static const struct snd_kcontrol_new dacl_sidetone_mux = |
| 1026 | SOC_DAPM_ENUM("Left Sidetone Mux", dacl_sidetone_enum); | 1027 | SOC_DAPM_ENUM("Left Sidetone Mux", dacl_sidetone_enum); |
| 1027 | 1028 | ||
| 1028 | static const struct soc_enum dacr_sidetone_enum = | 1029 | static SOC_ENUM_SINGLE_DECL(dacr_sidetone_enum, WM8904_DAC_DIGITAL_0, 0, |
| 1029 | SOC_ENUM_SINGLE(WM8904_DAC_DIGITAL_0, 0, 3, sidetone_text); | 1030 | sidetone_text); |
| 1030 | 1031 | ||
| 1031 | static const struct snd_kcontrol_new dacr_sidetone_mux = | 1032 | static const struct snd_kcontrol_new dacr_sidetone_mux = |
| 1032 | SOC_DAPM_ENUM("Right Sidetone Mux", dacr_sidetone_enum); | 1033 | SOC_DAPM_ENUM("Right Sidetone Mux", dacr_sidetone_enum); |
