diff options
author | Takashi Iwai <tiwai@suse.de> | 2014-02-18 04:45:17 -0500 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2014-02-22 21:54:32 -0500 |
commit | 7e5091087246b620dfbfed2ce4f17c53898b66d4 (patch) | |
tree | 44b9eaba10eb5d2fd52e3159ac39a9820342c09c /sound/soc/codecs/da732x.c | |
parent | 7ec02609739d82f7786e5a169e5a900dbaf0d1a1 (diff) |
ASoC: da732x: 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/da732x.c')
-rw-r--r-- | sound/soc/codecs/da732x.c | 160 |
1 files changed, 72 insertions, 88 deletions
diff --git a/sound/soc/codecs/da732x.c b/sound/soc/codecs/da732x.c index f295b6569910..3219fa1f3cf5 100644 --- a/sound/soc/codecs/da732x.c +++ b/sound/soc/codecs/da732x.c | |||
@@ -269,81 +269,65 @@ static const char *da732x_hpf_voice[] = { | |||
269 | "150Hz", "200Hz", "300Hz", "400Hz" | 269 | "150Hz", "200Hz", "300Hz", "400Hz" |
270 | }; | 270 | }; |
271 | 271 | ||
272 | static const struct soc_enum da732x_dac1_hpf_mode_enum[] = { | 272 | static SOC_ENUM_SINGLE_DECL(da732x_dac1_hpf_mode_enum, |
273 | SOC_ENUM_SINGLE(DA732X_REG_DAC1_HPF, DA732X_HPF_MODE_SHIFT, | 273 | DA732X_REG_DAC1_HPF, DA732X_HPF_MODE_SHIFT, |
274 | DA732X_HPF_MODE_MAX, da732x_hpf_mode) | 274 | da732x_hpf_mode); |
275 | }; | ||
276 | |||
277 | static const struct soc_enum da732x_dac2_hpf_mode_enum[] = { | ||
278 | SOC_ENUM_SINGLE(DA732X_REG_DAC2_HPF, DA732X_HPF_MODE_SHIFT, | ||
279 | DA732X_HPF_MODE_MAX, da732x_hpf_mode) | ||
280 | }; | ||
281 | 275 | ||
282 | static const struct soc_enum da732x_dac3_hpf_mode_enum[] = { | 276 | static SOC_ENUM_SINGLE_DECL(da732x_dac2_hpf_mode_enum, |
283 | SOC_ENUM_SINGLE(DA732X_REG_DAC3_HPF, DA732X_HPF_MODE_SHIFT, | 277 | DA732X_REG_DAC2_HPF, DA732X_HPF_MODE_SHIFT, |
284 | DA732X_HPF_MODE_MAX, da732x_hpf_mode) | 278 | da732x_hpf_mode); |
285 | }; | ||
286 | 279 | ||
287 | static const struct soc_enum da732x_adc1_hpf_mode_enum[] = { | 280 | static SOC_ENUM_SINGLE_DECL(da732x_dac3_hpf_mode_enum, |
288 | SOC_ENUM_SINGLE(DA732X_REG_ADC1_HPF, DA732X_HPF_MODE_SHIFT, | 281 | DA732X_REG_DAC3_HPF, DA732X_HPF_MODE_SHIFT, |
289 | DA732X_HPF_MODE_MAX, da732x_hpf_mode) | 282 | da732x_hpf_mode); |
290 | }; | ||
291 | 283 | ||
292 | static const struct soc_enum da732x_adc2_hpf_mode_enum[] = { | 284 | static SOC_ENUM_SINGLE_DECL(da732x_adc1_hpf_mode_enum, |
293 | SOC_ENUM_SINGLE(DA732X_REG_ADC2_HPF, DA732X_HPF_MODE_SHIFT, | 285 | DA732X_REG_ADC1_HPF, DA732X_HPF_MODE_SHIFT, |
294 | DA732X_HPF_MODE_MAX, da732x_hpf_mode) | 286 | da732x_hpf_mode); |
295 | }; | ||
296 | 287 | ||
297 | static const struct soc_enum da732x_dac1_hp_filter_enum[] = { | 288 | static SOC_ENUM_SINGLE_DECL(da732x_adc2_hpf_mode_enum, |
298 | SOC_ENUM_SINGLE(DA732X_REG_DAC1_HPF, DA732X_HPF_MUSIC_SHIFT, | 289 | DA732X_REG_ADC2_HPF, DA732X_HPF_MODE_SHIFT, |
299 | DA732X_HPF_MUSIC_MAX, da732x_hpf_music) | 290 | da732x_hpf_mode); |
300 | }; | ||
301 | 291 | ||
302 | static const struct soc_enum da732x_dac2_hp_filter_enum[] = { | 292 | static SOC_ENUM_SINGLE_DECL(da732x_dac1_hp_filter_enum, |
303 | SOC_ENUM_SINGLE(DA732X_REG_DAC2_HPF, DA732X_HPF_MUSIC_SHIFT, | 293 | DA732X_REG_DAC1_HPF, DA732X_HPF_MUSIC_SHIFT, |
304 | DA732X_HPF_MUSIC_MAX, da732x_hpf_music) | 294 | da732x_hpf_music); |
305 | }; | ||
306 | 295 | ||
307 | static const struct soc_enum da732x_dac3_hp_filter_enum[] = { | 296 | static SOC_ENUM_SINGLE_DECL(da732x_dac2_hp_filter_enum, |
308 | SOC_ENUM_SINGLE(DA732X_REG_DAC3_HPF, DA732X_HPF_MUSIC_SHIFT, | 297 | DA732X_REG_DAC2_HPF, DA732X_HPF_MUSIC_SHIFT, |
309 | DA732X_HPF_MUSIC_MAX, da732x_hpf_music) | 298 | da732x_hpf_music); |
310 | }; | ||
311 | 299 | ||
312 | static const struct soc_enum da732x_adc1_hp_filter_enum[] = { | 300 | static SOC_ENUM_SINGLE_DECL(da732x_dac3_hp_filter_enum, |
313 | SOC_ENUM_SINGLE(DA732X_REG_ADC1_HPF, DA732X_HPF_MUSIC_SHIFT, | 301 | DA732X_REG_DAC3_HPF, DA732X_HPF_MUSIC_SHIFT, |
314 | DA732X_HPF_MUSIC_MAX, da732x_hpf_music) | 302 | da732x_hpf_music); |
315 | }; | ||
316 | 303 | ||
317 | static const struct soc_enum da732x_adc2_hp_filter_enum[] = { | 304 | static SOC_ENUM_SINGLE_DECL(da732x_adc1_hp_filter_enum, |
318 | SOC_ENUM_SINGLE(DA732X_REG_ADC2_HPF, DA732X_HPF_MUSIC_SHIFT, | 305 | DA732X_REG_ADC1_HPF, DA732X_HPF_MUSIC_SHIFT, |
319 | DA732X_HPF_MUSIC_MAX, da732x_hpf_music) | 306 | da732x_hpf_music); |
320 | }; | ||
321 | 307 | ||
322 | static const struct soc_enum da732x_dac1_voice_filter_enum[] = { | 308 | static SOC_ENUM_SINGLE_DECL(da732x_adc2_hp_filter_enum, |
323 | SOC_ENUM_SINGLE(DA732X_REG_DAC1_HPF, DA732X_HPF_VOICE_SHIFT, | 309 | DA732X_REG_ADC2_HPF, DA732X_HPF_MUSIC_SHIFT, |
324 | DA732X_HPF_VOICE_MAX, da732x_hpf_voice) | 310 | da732x_hpf_music); |
325 | }; | ||
326 | 311 | ||
327 | static const struct soc_enum da732x_dac2_voice_filter_enum[] = { | 312 | static SOC_ENUM_SINGLE_DECL(da732x_dac1_voice_filter_enum, |
328 | SOC_ENUM_SINGLE(DA732X_REG_DAC2_HPF, DA732X_HPF_VOICE_SHIFT, | 313 | DA732X_REG_DAC1_HPF, DA732X_HPF_VOICE_SHIFT, |
329 | DA732X_HPF_VOICE_MAX, da732x_hpf_voice) | 314 | da732x_hpf_voice); |
330 | }; | ||
331 | 315 | ||
332 | static const struct soc_enum da732x_dac3_voice_filter_enum[] = { | 316 | static SOC_ENUM_SINGLE_DECL(da732x_dac2_voice_filter_enum, |
333 | SOC_ENUM_SINGLE(DA732X_REG_DAC3_HPF, DA732X_HPF_VOICE_SHIFT, | 317 | DA732X_REG_DAC2_HPF, DA732X_HPF_VOICE_SHIFT, |
334 | DA732X_HPF_VOICE_MAX, da732x_hpf_voice) | 318 | da732x_hpf_voice); |
335 | }; | ||
336 | 319 | ||
337 | static const struct soc_enum da732x_adc1_voice_filter_enum[] = { | 320 | static SOC_ENUM_SINGLE_DECL(da732x_dac3_voice_filter_enum, |
338 | SOC_ENUM_SINGLE(DA732X_REG_ADC1_HPF, DA732X_HPF_VOICE_SHIFT, | 321 | DA732X_REG_DAC3_HPF, DA732X_HPF_VOICE_SHIFT, |
339 | DA732X_HPF_VOICE_MAX, da732x_hpf_voice) | 322 | da732x_hpf_voice); |
340 | }; | ||
341 | 323 | ||
342 | static const struct soc_enum da732x_adc2_voice_filter_enum[] = { | 324 | static SOC_ENUM_SINGLE_DECL(da732x_adc1_voice_filter_enum, |
343 | SOC_ENUM_SINGLE(DA732X_REG_ADC2_HPF, DA732X_HPF_VOICE_SHIFT, | 325 | DA732X_REG_ADC1_HPF, DA732X_HPF_VOICE_SHIFT, |
344 | DA732X_HPF_VOICE_MAX, da732x_hpf_voice) | 326 | da732x_hpf_voice); |
345 | }; | ||
346 | 327 | ||
328 | static SOC_ENUM_SINGLE_DECL(da732x_adc2_voice_filter_enum, | ||
329 | DA732X_REG_ADC2_HPF, DA732X_HPF_VOICE_SHIFT, | ||
330 | da732x_hpf_voice); | ||
347 | 331 | ||
348 | static int da732x_hpf_set(struct snd_kcontrol *kcontrol, | 332 | static int da732x_hpf_set(struct snd_kcontrol *kcontrol, |
349 | struct snd_ctl_elem_value *ucontrol) | 333 | struct snd_ctl_elem_value *ucontrol) |
@@ -714,65 +698,65 @@ static const char *enable_text[] = { | |||
714 | }; | 698 | }; |
715 | 699 | ||
716 | /* ADC1LMUX */ | 700 | /* ADC1LMUX */ |
717 | static const struct soc_enum adc1l_enum = | 701 | static SOC_ENUM_SINGLE_DECL(adc1l_enum, |
718 | SOC_ENUM_SINGLE(DA732X_REG_INP_MUX, DA732X_ADC1L_MUX_SEL_SHIFT, | 702 | DA732X_REG_INP_MUX, DA732X_ADC1L_MUX_SEL_SHIFT, |
719 | DA732X_ADCL_MUX_MAX, adcl_text); | 703 | adcl_text); |
720 | static const struct snd_kcontrol_new adc1l_mux = | 704 | static const struct snd_kcontrol_new adc1l_mux = |
721 | SOC_DAPM_ENUM("ADC Route", adc1l_enum); | 705 | SOC_DAPM_ENUM("ADC Route", adc1l_enum); |
722 | 706 | ||
723 | /* ADC1RMUX */ | 707 | /* ADC1RMUX */ |
724 | static const struct soc_enum adc1r_enum = | 708 | static SOC_ENUM_SINGLE_DECL(adc1r_enum, |
725 | SOC_ENUM_SINGLE(DA732X_REG_INP_MUX, DA732X_ADC1R_MUX_SEL_SHIFT, | 709 | DA732X_REG_INP_MUX, DA732X_ADC1R_MUX_SEL_SHIFT, |
726 | DA732X_ADCR_MUX_MAX, adcr_text); | 710 | adcr_text); |
727 | static const struct snd_kcontrol_new adc1r_mux = | 711 | static const struct snd_kcontrol_new adc1r_mux = |
728 | SOC_DAPM_ENUM("ADC Route", adc1r_enum); | 712 | SOC_DAPM_ENUM("ADC Route", adc1r_enum); |
729 | 713 | ||
730 | /* ADC2LMUX */ | 714 | /* ADC2LMUX */ |
731 | static const struct soc_enum adc2l_enum = | 715 | static SOC_ENUM_SINGLE_DECL(adc2l_enum, |
732 | SOC_ENUM_SINGLE(DA732X_REG_INP_MUX, DA732X_ADC2L_MUX_SEL_SHIFT, | 716 | DA732X_REG_INP_MUX, DA732X_ADC2L_MUX_SEL_SHIFT, |
733 | DA732X_ADCL_MUX_MAX, adcl_text); | 717 | adcl_text); |
734 | static const struct snd_kcontrol_new adc2l_mux = | 718 | static const struct snd_kcontrol_new adc2l_mux = |
735 | SOC_DAPM_ENUM("ADC Route", adc2l_enum); | 719 | SOC_DAPM_ENUM("ADC Route", adc2l_enum); |
736 | 720 | ||
737 | /* ADC2RMUX */ | 721 | /* ADC2RMUX */ |
738 | static const struct soc_enum adc2r_enum = | 722 | static SOC_ENUM_SINGLE_DECL(adc2r_enum, |
739 | SOC_ENUM_SINGLE(DA732X_REG_INP_MUX, DA732X_ADC2R_MUX_SEL_SHIFT, | 723 | DA732X_REG_INP_MUX, DA732X_ADC2R_MUX_SEL_SHIFT, |
740 | DA732X_ADCR_MUX_MAX, adcr_text); | 724 | adcr_text); |
741 | 725 | ||
742 | static const struct snd_kcontrol_new adc2r_mux = | 726 | static const struct snd_kcontrol_new adc2r_mux = |
743 | SOC_DAPM_ENUM("ADC Route", adc2r_enum); | 727 | SOC_DAPM_ENUM("ADC Route", adc2r_enum); |
744 | 728 | ||
745 | static const struct soc_enum da732x_hp_left_output = | 729 | static SOC_ENUM_SINGLE_DECL(da732x_hp_left_output, |
746 | SOC_ENUM_SINGLE(DA732X_REG_HPL, DA732X_HP_OUT_DAC_EN_SHIFT, | 730 | DA732X_REG_HPL, DA732X_HP_OUT_DAC_EN_SHIFT, |
747 | DA732X_DAC_EN_MAX, enable_text); | 731 | enable_text); |
748 | 732 | ||
749 | static const struct snd_kcontrol_new hpl_mux = | 733 | static const struct snd_kcontrol_new hpl_mux = |
750 | SOC_DAPM_ENUM("HPL Switch", da732x_hp_left_output); | 734 | SOC_DAPM_ENUM("HPL Switch", da732x_hp_left_output); |
751 | 735 | ||
752 | static const struct soc_enum da732x_hp_right_output = | 736 | static SOC_ENUM_SINGLE_DECL(da732x_hp_right_output, |
753 | SOC_ENUM_SINGLE(DA732X_REG_HPR, DA732X_HP_OUT_DAC_EN_SHIFT, | 737 | DA732X_REG_HPR, DA732X_HP_OUT_DAC_EN_SHIFT, |
754 | DA732X_DAC_EN_MAX, enable_text); | 738 | enable_text); |
755 | 739 | ||
756 | static const struct snd_kcontrol_new hpr_mux = | 740 | static const struct snd_kcontrol_new hpr_mux = |
757 | SOC_DAPM_ENUM("HPR Switch", da732x_hp_right_output); | 741 | SOC_DAPM_ENUM("HPR Switch", da732x_hp_right_output); |
758 | 742 | ||
759 | static const struct soc_enum da732x_speaker_output = | 743 | static SOC_ENUM_SINGLE_DECL(da732x_speaker_output, |
760 | SOC_ENUM_SINGLE(DA732X_REG_LIN3, DA732X_LOUT_DAC_EN_SHIFT, | 744 | DA732X_REG_LIN3, DA732X_LOUT_DAC_EN_SHIFT, |
761 | DA732X_DAC_EN_MAX, enable_text); | 745 | enable_text); |
762 | 746 | ||
763 | static const struct snd_kcontrol_new spk_mux = | 747 | static const struct snd_kcontrol_new spk_mux = |
764 | SOC_DAPM_ENUM("SPK Switch", da732x_speaker_output); | 748 | SOC_DAPM_ENUM("SPK Switch", da732x_speaker_output); |
765 | 749 | ||
766 | static const struct soc_enum da732x_lout4_output = | 750 | static SOC_ENUM_SINGLE_DECL(da732x_lout4_output, |
767 | SOC_ENUM_SINGLE(DA732X_REG_LIN4, DA732X_LOUT_DAC_EN_SHIFT, | 751 | DA732X_REG_LIN4, DA732X_LOUT_DAC_EN_SHIFT, |
768 | DA732X_DAC_EN_MAX, enable_text); | 752 | enable_text); |
769 | 753 | ||
770 | static const struct snd_kcontrol_new lout4_mux = | 754 | static const struct snd_kcontrol_new lout4_mux = |
771 | SOC_DAPM_ENUM("LOUT4 Switch", da732x_lout4_output); | 755 | SOC_DAPM_ENUM("LOUT4 Switch", da732x_lout4_output); |
772 | 756 | ||
773 | static const struct soc_enum da732x_lout2_output = | 757 | static SOC_ENUM_SINGLE_DECL(da732x_lout2_output, |
774 | SOC_ENUM_SINGLE(DA732X_REG_LIN2, DA732X_LOUT_DAC_EN_SHIFT, | 758 | DA732X_REG_LIN2, DA732X_LOUT_DAC_EN_SHIFT, |
775 | DA732X_DAC_EN_MAX, enable_text); | 759 | enable_text); |
776 | 760 | ||
777 | static const struct snd_kcontrol_new lout2_mux = | 761 | static const struct snd_kcontrol_new lout2_mux = |
778 | SOC_DAPM_ENUM("LOUT2 Switch", da732x_lout2_output); | 762 | SOC_DAPM_ENUM("LOUT2 Switch", da732x_lout2_output); |