diff options
-rw-r--r-- | sound/soc/codecs/wm8996.c | 64 | ||||
-rw-r--r-- | sound/soc/codecs/wm9081.c | 23 | ||||
-rw-r--r-- | sound/soc/codecs/wm9705.c | 12 |
3 files changed, 47 insertions, 52 deletions
diff --git a/sound/soc/codecs/wm8996.c b/sound/soc/codecs/wm8996.c index 0330165079a4..c8244af7d56a 100644 --- a/sound/soc/codecs/wm8996.c +++ b/sound/soc/codecs/wm8996.c | |||
@@ -311,28 +311,28 @@ static const char *sidetone_hpf_text[] = { | |||
311 | "2.9kHz", "1.5kHz", "735Hz", "403Hz", "196Hz", "98Hz", "49Hz" | 311 | "2.9kHz", "1.5kHz", "735Hz", "403Hz", "196Hz", "98Hz", "49Hz" |
312 | }; | 312 | }; |
313 | 313 | ||
314 | static const struct soc_enum sidetone_hpf = | 314 | static SOC_ENUM_SINGLE_DECL(sidetone_hpf, |
315 | SOC_ENUM_SINGLE(WM8996_SIDETONE, 7, 7, sidetone_hpf_text); | 315 | WM8996_SIDETONE, 7, sidetone_hpf_text); |
316 | 316 | ||
317 | static const char *hpf_mode_text[] = { | 317 | static const char *hpf_mode_text[] = { |
318 | "HiFi", "Custom", "Voice" | 318 | "HiFi", "Custom", "Voice" |
319 | }; | 319 | }; |
320 | 320 | ||
321 | static const struct soc_enum dsp1tx_hpf_mode = | 321 | static SOC_ENUM_SINGLE_DECL(dsp1tx_hpf_mode, |
322 | SOC_ENUM_SINGLE(WM8996_DSP1_TX_FILTERS, 3, 3, hpf_mode_text); | 322 | WM8996_DSP1_TX_FILTERS, 3, hpf_mode_text); |
323 | 323 | ||
324 | static const struct soc_enum dsp2tx_hpf_mode = | 324 | static SOC_ENUM_SINGLE_DECL(dsp2tx_hpf_mode, |
325 | SOC_ENUM_SINGLE(WM8996_DSP2_TX_FILTERS, 3, 3, hpf_mode_text); | 325 | WM8996_DSP2_TX_FILTERS, 3, hpf_mode_text); |
326 | 326 | ||
327 | static const char *hpf_cutoff_text[] = { | 327 | static const char *hpf_cutoff_text[] = { |
328 | "50Hz", "75Hz", "100Hz", "150Hz", "200Hz", "300Hz", "400Hz" | 328 | "50Hz", "75Hz", "100Hz", "150Hz", "200Hz", "300Hz", "400Hz" |
329 | }; | 329 | }; |
330 | 330 | ||
331 | static const struct soc_enum dsp1tx_hpf_cutoff = | 331 | static SOC_ENUM_SINGLE_DECL(dsp1tx_hpf_cutoff, |
332 | SOC_ENUM_SINGLE(WM8996_DSP1_TX_FILTERS, 0, 7, hpf_cutoff_text); | 332 | WM8996_DSP1_TX_FILTERS, 0, hpf_cutoff_text); |
333 | 333 | ||
334 | static const struct soc_enum dsp2tx_hpf_cutoff = | 334 | static SOC_ENUM_SINGLE_DECL(dsp2tx_hpf_cutoff, |
335 | SOC_ENUM_SINGLE(WM8996_DSP2_TX_FILTERS, 0, 7, hpf_cutoff_text); | 335 | WM8996_DSP2_TX_FILTERS, 0, hpf_cutoff_text); |
336 | 336 | ||
337 | static void wm8996_set_retune_mobile(struct snd_soc_codec *codec, int block) | 337 | static void wm8996_set_retune_mobile(struct snd_soc_codec *codec, int block) |
338 | { | 338 | { |
@@ -780,14 +780,14 @@ static const char *sidetone_text[] = { | |||
780 | "IN1", "IN2", | 780 | "IN1", "IN2", |
781 | }; | 781 | }; |
782 | 782 | ||
783 | static const struct soc_enum left_sidetone_enum = | 783 | static SOC_ENUM_SINGLE_DECL(left_sidetone_enum, |
784 | SOC_ENUM_SINGLE(WM8996_SIDETONE, 0, 2, sidetone_text); | 784 | WM8996_SIDETONE, 0, sidetone_text); |
785 | 785 | ||
786 | static const struct snd_kcontrol_new left_sidetone = | 786 | static const struct snd_kcontrol_new left_sidetone = |
787 | SOC_DAPM_ENUM("Left Sidetone", left_sidetone_enum); | 787 | SOC_DAPM_ENUM("Left Sidetone", left_sidetone_enum); |
788 | 788 | ||
789 | static const struct soc_enum right_sidetone_enum = | 789 | static SOC_ENUM_SINGLE_DECL(right_sidetone_enum, |
790 | SOC_ENUM_SINGLE(WM8996_SIDETONE, 1, 2, sidetone_text); | 790 | WM8996_SIDETONE, 1, sidetone_text); |
791 | 791 | ||
792 | static const struct snd_kcontrol_new right_sidetone = | 792 | static const struct snd_kcontrol_new right_sidetone = |
793 | SOC_DAPM_ENUM("Right Sidetone", right_sidetone_enum); | 793 | SOC_DAPM_ENUM("Right Sidetone", right_sidetone_enum); |
@@ -796,14 +796,14 @@ static const char *spk_text[] = { | |||
796 | "DAC1L", "DAC1R", "DAC2L", "DAC2R" | 796 | "DAC1L", "DAC1R", "DAC2L", "DAC2R" |
797 | }; | 797 | }; |
798 | 798 | ||
799 | static const struct soc_enum spkl_enum = | 799 | static SOC_ENUM_SINGLE_DECL(spkl_enum, |
800 | SOC_ENUM_SINGLE(WM8996_LEFT_PDM_SPEAKER, 0, 4, spk_text); | 800 | WM8996_LEFT_PDM_SPEAKER, 0, spk_text); |
801 | 801 | ||
802 | static const struct snd_kcontrol_new spkl_mux = | 802 | static const struct snd_kcontrol_new spkl_mux = |
803 | SOC_DAPM_ENUM("SPKL", spkl_enum); | 803 | SOC_DAPM_ENUM("SPKL", spkl_enum); |
804 | 804 | ||
805 | static const struct soc_enum spkr_enum = | 805 | static SOC_ENUM_SINGLE_DECL(spkr_enum, |
806 | SOC_ENUM_SINGLE(WM8996_RIGHT_PDM_SPEAKER, 0, 4, spk_text); | 806 | WM8996_RIGHT_PDM_SPEAKER, 0, spk_text); |
807 | 807 | ||
808 | static const struct snd_kcontrol_new spkr_mux = | 808 | static const struct snd_kcontrol_new spkr_mux = |
809 | SOC_DAPM_ENUM("SPKR", spkr_enum); | 809 | SOC_DAPM_ENUM("SPKR", spkr_enum); |
@@ -812,8 +812,8 @@ static const char *dsp1rx_text[] = { | |||
812 | "AIF1", "AIF2" | 812 | "AIF1", "AIF2" |
813 | }; | 813 | }; |
814 | 814 | ||
815 | static const struct soc_enum dsp1rx_enum = | 815 | static SOC_ENUM_SINGLE_DECL(dsp1rx_enum, |
816 | SOC_ENUM_SINGLE(WM8996_POWER_MANAGEMENT_8, 0, 2, dsp1rx_text); | 816 | WM8996_POWER_MANAGEMENT_8, 0, dsp1rx_text); |
817 | 817 | ||
818 | static const struct snd_kcontrol_new dsp1rx = | 818 | static const struct snd_kcontrol_new dsp1rx = |
819 | SOC_DAPM_ENUM("DSP1RX", dsp1rx_enum); | 819 | SOC_DAPM_ENUM("DSP1RX", dsp1rx_enum); |
@@ -822,8 +822,8 @@ static const char *dsp2rx_text[] = { | |||
822 | "AIF2", "AIF1" | 822 | "AIF2", "AIF1" |
823 | }; | 823 | }; |
824 | 824 | ||
825 | static const struct soc_enum dsp2rx_enum = | 825 | static SOC_ENUM_SINGLE_DECL(dsp2rx_enum, |
826 | SOC_ENUM_SINGLE(WM8996_POWER_MANAGEMENT_8, 4, 2, dsp2rx_text); | 826 | WM8996_POWER_MANAGEMENT_8, 4, dsp2rx_text); |
827 | 827 | ||
828 | static const struct snd_kcontrol_new dsp2rx = | 828 | static const struct snd_kcontrol_new dsp2rx = |
829 | SOC_DAPM_ENUM("DSP2RX", dsp2rx_enum); | 829 | SOC_DAPM_ENUM("DSP2RX", dsp2rx_enum); |
@@ -832,8 +832,8 @@ static const char *aif2tx_text[] = { | |||
832 | "DSP2", "DSP1", "AIF1" | 832 | "DSP2", "DSP1", "AIF1" |
833 | }; | 833 | }; |
834 | 834 | ||
835 | static const struct soc_enum aif2tx_enum = | 835 | static SOC_ENUM_SINGLE_DECL(aif2tx_enum, |
836 | SOC_ENUM_SINGLE(WM8996_POWER_MANAGEMENT_8, 6, 3, aif2tx_text); | 836 | WM8996_POWER_MANAGEMENT_8, 6, aif2tx_text); |
837 | 837 | ||
838 | static const struct snd_kcontrol_new aif2tx = | 838 | static const struct snd_kcontrol_new aif2tx = |
839 | SOC_DAPM_ENUM("AIF2TX", aif2tx_enum); | 839 | SOC_DAPM_ENUM("AIF2TX", aif2tx_enum); |
@@ -842,14 +842,14 @@ static const char *inmux_text[] = { | |||
842 | "ADC", "DMIC1", "DMIC2" | 842 | "ADC", "DMIC1", "DMIC2" |
843 | }; | 843 | }; |
844 | 844 | ||
845 | static const struct soc_enum in1_enum = | 845 | static SOC_ENUM_SINGLE_DECL(in1_enum, |
846 | SOC_ENUM_SINGLE(WM8996_POWER_MANAGEMENT_7, 0, 3, inmux_text); | 846 | WM8996_POWER_MANAGEMENT_7, 0, inmux_text); |
847 | 847 | ||
848 | static const struct snd_kcontrol_new in1_mux = | 848 | static const struct snd_kcontrol_new in1_mux = |
849 | SOC_DAPM_ENUM("IN1 Mux", in1_enum); | 849 | SOC_DAPM_ENUM("IN1 Mux", in1_enum); |
850 | 850 | ||
851 | static const struct soc_enum in2_enum = | 851 | static SOC_ENUM_SINGLE_DECL(in2_enum, |
852 | SOC_ENUM_SINGLE(WM8996_POWER_MANAGEMENT_7, 4, 3, inmux_text); | 852 | WM8996_POWER_MANAGEMENT_7, 4, inmux_text); |
853 | 853 | ||
854 | static const struct snd_kcontrol_new in2_mux = | 854 | static const struct snd_kcontrol_new in2_mux = |
855 | SOC_DAPM_ENUM("IN2 Mux", in2_enum); | 855 | SOC_DAPM_ENUM("IN2 Mux", in2_enum); |
@@ -1608,8 +1608,8 @@ static int wm8996_set_bias_level(struct snd_soc_codec *codec, | |||
1608 | msleep(5); | 1608 | msleep(5); |
1609 | } | 1609 | } |
1610 | 1610 | ||
1611 | regcache_cache_only(codec->control_data, false); | 1611 | regcache_cache_only(wm8996->regmap, false); |
1612 | regcache_sync(codec->control_data); | 1612 | regcache_sync(wm8996->regmap); |
1613 | } | 1613 | } |
1614 | 1614 | ||
1615 | /* Bypass the MICBIASes for lowest power */ | 1615 | /* Bypass the MICBIASes for lowest power */ |
@@ -1620,10 +1620,10 @@ static int wm8996_set_bias_level(struct snd_soc_codec *codec, | |||
1620 | break; | 1620 | break; |
1621 | 1621 | ||
1622 | case SND_SOC_BIAS_OFF: | 1622 | case SND_SOC_BIAS_OFF: |
1623 | regcache_cache_only(codec->control_data, true); | 1623 | regcache_cache_only(wm8996->regmap, true); |
1624 | if (wm8996->pdata.ldo_ena >= 0) { | 1624 | if (wm8996->pdata.ldo_ena >= 0) { |
1625 | gpio_set_value_cansleep(wm8996->pdata.ldo_ena, 0); | 1625 | gpio_set_value_cansleep(wm8996->pdata.ldo_ena, 0); |
1626 | regcache_cache_only(codec->control_data, true); | 1626 | regcache_cache_only(wm8996->regmap, true); |
1627 | } | 1627 | } |
1628 | regulator_bulk_disable(ARRAY_SIZE(wm8996->supplies), | 1628 | regulator_bulk_disable(ARRAY_SIZE(wm8996->supplies), |
1629 | wm8996->supplies); | 1629 | wm8996->supplies); |
diff --git a/sound/soc/codecs/wm9081.c b/sound/soc/codecs/wm9081.c index 0982c1d38ec4..721cee71d5fc 100644 --- a/sound/soc/codecs/wm9081.c +++ b/sound/soc/codecs/wm9081.c | |||
@@ -268,8 +268,7 @@ static const char *drc_high_text[] = { | |||
268 | "0", | 268 | "0", |
269 | }; | 269 | }; |
270 | 270 | ||
271 | static const struct soc_enum drc_high = | 271 | static SOC_ENUM_SINGLE_DECL(drc_high, WM9081_DRC_3, 3, drc_high_text); |
272 | SOC_ENUM_SINGLE(WM9081_DRC_3, 3, 6, drc_high_text); | ||
273 | 272 | ||
274 | static const char *drc_low_text[] = { | 273 | static const char *drc_low_text[] = { |
275 | "1", | 274 | "1", |
@@ -279,8 +278,7 @@ static const char *drc_low_text[] = { | |||
279 | "0", | 278 | "0", |
280 | }; | 279 | }; |
281 | 280 | ||
282 | static const struct soc_enum drc_low = | 281 | static SOC_ENUM_SINGLE_DECL(drc_low, WM9081_DRC_3, 0, drc_low_text); |
283 | SOC_ENUM_SINGLE(WM9081_DRC_3, 0, 5, drc_low_text); | ||
284 | 282 | ||
285 | static const char *drc_atk_text[] = { | 283 | static const char *drc_atk_text[] = { |
286 | "181us", | 284 | "181us", |
@@ -297,8 +295,7 @@ static const char *drc_atk_text[] = { | |||
297 | "185.6ms", | 295 | "185.6ms", |
298 | }; | 296 | }; |
299 | 297 | ||
300 | static const struct soc_enum drc_atk = | 298 | static SOC_ENUM_SINGLE_DECL(drc_atk, WM9081_DRC_2, 12, drc_atk_text); |
301 | SOC_ENUM_SINGLE(WM9081_DRC_2, 12, 12, drc_atk_text); | ||
302 | 299 | ||
303 | static const char *drc_dcy_text[] = { | 300 | static const char *drc_dcy_text[] = { |
304 | "186ms", | 301 | "186ms", |
@@ -312,8 +309,7 @@ static const char *drc_dcy_text[] = { | |||
312 | "47.56s", | 309 | "47.56s", |
313 | }; | 310 | }; |
314 | 311 | ||
315 | static const struct soc_enum drc_dcy = | 312 | static SOC_ENUM_SINGLE_DECL(drc_dcy, WM9081_DRC_2, 8, drc_dcy_text); |
316 | SOC_ENUM_SINGLE(WM9081_DRC_2, 8, 9, drc_dcy_text); | ||
317 | 313 | ||
318 | static const char *drc_qr_dcy_text[] = { | 314 | static const char *drc_qr_dcy_text[] = { |
319 | "0.725ms", | 315 | "0.725ms", |
@@ -321,8 +317,7 @@ static const char *drc_qr_dcy_text[] = { | |||
321 | "5.8ms", | 317 | "5.8ms", |
322 | }; | 318 | }; |
323 | 319 | ||
324 | static const struct soc_enum drc_qr_dcy = | 320 | static SOC_ENUM_SINGLE_DECL(drc_qr_dcy, WM9081_DRC_2, 4, drc_qr_dcy_text); |
325 | SOC_ENUM_SINGLE(WM9081_DRC_2, 4, 3, drc_qr_dcy_text); | ||
326 | 321 | ||
327 | static const char *dac_deemph_text[] = { | 322 | static const char *dac_deemph_text[] = { |
328 | "None", | 323 | "None", |
@@ -331,16 +326,16 @@ static const char *dac_deemph_text[] = { | |||
331 | "48kHz", | 326 | "48kHz", |
332 | }; | 327 | }; |
333 | 328 | ||
334 | static const struct soc_enum dac_deemph = | 329 | static SOC_ENUM_SINGLE_DECL(dac_deemph, WM9081_DAC_DIGITAL_2, 1, |
335 | SOC_ENUM_SINGLE(WM9081_DAC_DIGITAL_2, 1, 4, dac_deemph_text); | 330 | dac_deemph_text); |
336 | 331 | ||
337 | static const char *speaker_mode_text[] = { | 332 | static const char *speaker_mode_text[] = { |
338 | "Class D", | 333 | "Class D", |
339 | "Class AB", | 334 | "Class AB", |
340 | }; | 335 | }; |
341 | 336 | ||
342 | static const struct soc_enum speaker_mode = | 337 | static SOC_ENUM_SINGLE_DECL(speaker_mode, WM9081_ANALOGUE_SPEAKER_2, 6, |
343 | SOC_ENUM_SINGLE(WM9081_ANALOGUE_SPEAKER_2, 6, 2, speaker_mode_text); | 338 | speaker_mode_text); |
344 | 339 | ||
345 | static int speaker_mode_get(struct snd_kcontrol *kcontrol, | 340 | static int speaker_mode_get(struct snd_kcontrol *kcontrol, |
346 | struct snd_ctl_elem_value *ucontrol) | 341 | struct snd_ctl_elem_value *ucontrol) |
diff --git a/sound/soc/codecs/wm9705.c b/sound/soc/codecs/wm9705.c index 70ce6793c5bd..c0b7f45dfa37 100644 --- a/sound/soc/codecs/wm9705.c +++ b/sound/soc/codecs/wm9705.c | |||
@@ -67,12 +67,12 @@ static const char *wm9705_mic[] = {"Mic 1", "Mic 2"}; | |||
67 | static const char *wm9705_rec_sel[] = {"Mic", "CD", "NC", "NC", | 67 | static const char *wm9705_rec_sel[] = {"Mic", "CD", "NC", "NC", |
68 | "Line", "Stereo Mix", "Mono Mix", "Phone"}; | 68 | "Line", "Stereo Mix", "Mono Mix", "Phone"}; |
69 | 69 | ||
70 | static const struct soc_enum wm9705_enum_mic = | 70 | static SOC_ENUM_SINGLE_DECL(wm9705_enum_mic, |
71 | SOC_ENUM_SINGLE(AC97_GENERAL_PURPOSE, 8, 2, wm9705_mic); | 71 | AC97_GENERAL_PURPOSE, 8, wm9705_mic); |
72 | static const struct soc_enum wm9705_enum_rec_l = | 72 | static SOC_ENUM_SINGLE_DECL(wm9705_enum_rec_l, |
73 | SOC_ENUM_SINGLE(AC97_REC_SEL, 8, 8, wm9705_rec_sel); | 73 | AC97_REC_SEL, 8, wm9705_rec_sel); |
74 | static const struct soc_enum wm9705_enum_rec_r = | 74 | static SOC_ENUM_SINGLE_DECL(wm9705_enum_rec_r, |
75 | SOC_ENUM_SINGLE(AC97_REC_SEL, 0, 8, wm9705_rec_sel); | 75 | AC97_REC_SEL, 0, wm9705_rec_sel); |
76 | 76 | ||
77 | /* Headphone Mixer */ | 77 | /* Headphone Mixer */ |
78 | static const struct snd_kcontrol_new wm9705_hp_mixer_controls[] = { | 78 | static const struct snd_kcontrol_new wm9705_hp_mixer_controls[] = { |