aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2011-05-02 05:33:15 -0400
committerTakashi Iwai <tiwai@suse.de>2011-05-02 06:20:27 -0400
commit498f5b175b90597608e48390183933d3875d5429 (patch)
tree532be2a06b5a9898a1cff713ac0fa0440223ff08 /sound/pci
parent4c6d72d1380f2f4056635592c07bc50f5d08296c (diff)
ALSA: hda - Constify fixup and other array data in patch_analog.c
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci')
-rw-r--r--sound/pci/hda/patch_analog.c328
1 files changed, 164 insertions, 164 deletions
diff --git a/sound/pci/hda/patch_analog.c b/sound/pci/hda/patch_analog.c
index 6df9943bbf6..981c631624d 100644
--- a/sound/pci/hda/patch_analog.c
+++ b/sound/pci/hda/patch_analog.c
@@ -30,7 +30,7 @@
30#include "hda_beep.h" 30#include "hda_beep.h"
31 31
32struct ad198x_spec { 32struct ad198x_spec {
33 struct snd_kcontrol_new *mixers[6]; 33 const struct snd_kcontrol_new *mixers[6];
34 int num_mixers; 34 int num_mixers;
35 unsigned int beep_amp; /* beep amp value, set via set_beep_amp() */ 35 unsigned int beep_amp; /* beep amp value, set via set_beep_amp() */
36 const struct hda_verb *init_verbs[6]; /* initialization verbs 36 const struct hda_verb *init_verbs[6]; /* initialization verbs
@@ -46,17 +46,17 @@ struct ad198x_spec {
46 unsigned int cur_eapd; 46 unsigned int cur_eapd;
47 unsigned int need_dac_fix; 47 unsigned int need_dac_fix;
48 48
49 hda_nid_t *alt_dac_nid; 49 const hda_nid_t *alt_dac_nid;
50 struct hda_pcm_stream *stream_analog_alt_playback; 50 const struct hda_pcm_stream *stream_analog_alt_playback;
51 51
52 /* capture */ 52 /* capture */
53 unsigned int num_adc_nids; 53 unsigned int num_adc_nids;
54 hda_nid_t *adc_nids; 54 const hda_nid_t *adc_nids;
55 hda_nid_t dig_in_nid; /* digital-in NID; optional */ 55 hda_nid_t dig_in_nid; /* digital-in NID; optional */
56 56
57 /* capture source */ 57 /* capture source */
58 const struct hda_input_mux *input_mux; 58 const struct hda_input_mux *input_mux;
59 hda_nid_t *capsrc_nids; 59 const hda_nid_t *capsrc_nids;
60 unsigned int cur_mux[3]; 60 unsigned int cur_mux[3];
61 61
62 /* channel model */ 62 /* channel model */
@@ -182,13 +182,13 @@ static void ad198x_free_kctls(struct hda_codec *codec);
182 182
183#ifdef CONFIG_SND_HDA_INPUT_BEEP 183#ifdef CONFIG_SND_HDA_INPUT_BEEP
184/* additional beep mixers; the actual parameters are overwritten at build */ 184/* additional beep mixers; the actual parameters are overwritten at build */
185static struct snd_kcontrol_new ad_beep_mixer[] = { 185static const struct snd_kcontrol_new ad_beep_mixer[] = {
186 HDA_CODEC_VOLUME("Beep Playback Volume", 0, 0, HDA_OUTPUT), 186 HDA_CODEC_VOLUME("Beep Playback Volume", 0, 0, HDA_OUTPUT),
187 HDA_CODEC_MUTE_BEEP("Beep Playback Switch", 0, 0, HDA_OUTPUT), 187 HDA_CODEC_MUTE_BEEP("Beep Playback Switch", 0, 0, HDA_OUTPUT),
188 { } /* end */ 188 { } /* end */
189}; 189};
190 190
191static struct snd_kcontrol_new ad_beep2_mixer[] = { 191static const struct snd_kcontrol_new ad_beep2_mixer[] = {
192 HDA_CODEC_VOLUME("Digital Beep Playback Volume", 0, 0, HDA_OUTPUT), 192 HDA_CODEC_VOLUME("Digital Beep Playback Volume", 0, 0, HDA_OUTPUT),
193 HDA_CODEC_MUTE_BEEP("Digital Beep Playback Switch", 0, 0, HDA_OUTPUT), 193 HDA_CODEC_MUTE_BEEP("Digital Beep Playback Switch", 0, 0, HDA_OUTPUT),
194 { } /* end */ 194 { } /* end */
@@ -231,7 +231,7 @@ static int ad198x_build_controls(struct hda_codec *codec)
231 /* create beep controls if needed */ 231 /* create beep controls if needed */
232#ifdef CONFIG_SND_HDA_INPUT_BEEP 232#ifdef CONFIG_SND_HDA_INPUT_BEEP
233 if (spec->beep_amp) { 233 if (spec->beep_amp) {
234 struct snd_kcontrol_new *knew; 234 const struct snd_kcontrol_new *knew;
235 knew = spec->analog_beep ? ad_beep2_mixer : ad_beep_mixer; 235 knew = spec->analog_beep ? ad_beep2_mixer : ad_beep_mixer;
236 for ( ; knew->name; knew++) { 236 for ( ; knew->name; knew++) {
237 struct snd_kcontrol *kctl; 237 struct snd_kcontrol *kctl;
@@ -331,7 +331,7 @@ static int ad198x_playback_pcm_cleanup(struct hda_pcm_stream *hinfo,
331 return snd_hda_multi_out_analog_cleanup(codec, &spec->multiout); 331 return snd_hda_multi_out_analog_cleanup(codec, &spec->multiout);
332} 332}
333 333
334static struct hda_pcm_stream ad198x_pcm_analog_alt_playback = { 334static const struct hda_pcm_stream ad198x_pcm_analog_alt_playback = {
335 .substreams = 1, 335 .substreams = 1,
336 .channels_min = 2, 336 .channels_min = 2,
337 .channels_max = 2, 337 .channels_max = 2,
@@ -403,7 +403,7 @@ static int ad198x_capture_pcm_cleanup(struct hda_pcm_stream *hinfo,
403 403
404/* 404/*
405 */ 405 */
406static struct hda_pcm_stream ad198x_pcm_analog_playback = { 406static const struct hda_pcm_stream ad198x_pcm_analog_playback = {
407 .substreams = 1, 407 .substreams = 1,
408 .channels_min = 2, 408 .channels_min = 2,
409 .channels_max = 6, /* changed later */ 409 .channels_max = 6, /* changed later */
@@ -415,7 +415,7 @@ static struct hda_pcm_stream ad198x_pcm_analog_playback = {
415 }, 415 },
416}; 416};
417 417
418static struct hda_pcm_stream ad198x_pcm_analog_capture = { 418static const struct hda_pcm_stream ad198x_pcm_analog_capture = {
419 .substreams = 1, 419 .substreams = 1,
420 .channels_min = 2, 420 .channels_min = 2,
421 .channels_max = 2, 421 .channels_max = 2,
@@ -426,7 +426,7 @@ static struct hda_pcm_stream ad198x_pcm_analog_capture = {
426 }, 426 },
427}; 427};
428 428
429static struct hda_pcm_stream ad198x_pcm_digital_playback = { 429static const struct hda_pcm_stream ad198x_pcm_digital_playback = {
430 .substreams = 1, 430 .substreams = 1,
431 .channels_min = 2, 431 .channels_min = 2,
432 .channels_max = 2, 432 .channels_max = 2,
@@ -439,7 +439,7 @@ static struct hda_pcm_stream ad198x_pcm_digital_playback = {
439 }, 439 },
440}; 440};
441 441
442static struct hda_pcm_stream ad198x_pcm_digital_capture = { 442static const struct hda_pcm_stream ad198x_pcm_digital_capture = {
443 .substreams = 1, 443 .substreams = 1,
444 .channels_min = 2, 444 .channels_min = 2,
445 .channels_max = 2, 445 .channels_max = 2,
@@ -569,7 +569,7 @@ static int ad198x_suspend(struct hda_codec *codec, pm_message_t state)
569} 569}
570#endif 570#endif
571 571
572static struct hda_codec_ops ad198x_patch_ops = { 572static const struct hda_codec_ops ad198x_patch_ops = {
573 .build_controls = ad198x_build_controls, 573 .build_controls = ad198x_build_controls,
574 .build_pcms = ad198x_build_pcms, 574 .build_pcms = ad198x_build_pcms,
575 .init = ad198x_init, 575 .init = ad198x_init,
@@ -639,13 +639,13 @@ static int ad198x_ch_mode_put(struct snd_kcontrol *kcontrol,
639#define AD1986A_CLFE_DAC 0x05 639#define AD1986A_CLFE_DAC 0x05
640#define AD1986A_ADC 0x06 640#define AD1986A_ADC 0x06
641 641
642static hda_nid_t ad1986a_dac_nids[3] = { 642static const hda_nid_t ad1986a_dac_nids[3] = {
643 AD1986A_FRONT_DAC, AD1986A_SURR_DAC, AD1986A_CLFE_DAC 643 AD1986A_FRONT_DAC, AD1986A_SURR_DAC, AD1986A_CLFE_DAC
644}; 644};
645static hda_nid_t ad1986a_adc_nids[1] = { AD1986A_ADC }; 645static const hda_nid_t ad1986a_adc_nids[1] = { AD1986A_ADC };
646static hda_nid_t ad1986a_capsrc_nids[1] = { 0x12 }; 646static const hda_nid_t ad1986a_capsrc_nids[1] = { 0x12 };
647 647
648static struct hda_input_mux ad1986a_capture_source = { 648static const struct hda_input_mux ad1986a_capture_source = {
649 .num_items = 7, 649 .num_items = 7,
650 .items = { 650 .items = {
651 { "Mic", 0x0 }, 651 { "Mic", 0x0 },
@@ -659,7 +659,7 @@ static struct hda_input_mux ad1986a_capture_source = {
659}; 659};
660 660
661 661
662static struct hda_bind_ctls ad1986a_bind_pcm_vol = { 662static const struct hda_bind_ctls ad1986a_bind_pcm_vol = {
663 .ops = &snd_hda_bind_vol, 663 .ops = &snd_hda_bind_vol,
664 .values = { 664 .values = {
665 HDA_COMPOSE_AMP_VAL(AD1986A_FRONT_DAC, 3, 0, HDA_OUTPUT), 665 HDA_COMPOSE_AMP_VAL(AD1986A_FRONT_DAC, 3, 0, HDA_OUTPUT),
@@ -669,7 +669,7 @@ static struct hda_bind_ctls ad1986a_bind_pcm_vol = {
669 }, 669 },
670}; 670};
671 671
672static struct hda_bind_ctls ad1986a_bind_pcm_sw = { 672static const struct hda_bind_ctls ad1986a_bind_pcm_sw = {
673 .ops = &snd_hda_bind_sw, 673 .ops = &snd_hda_bind_sw,
674 .values = { 674 .values = {
675 HDA_COMPOSE_AMP_VAL(AD1986A_FRONT_DAC, 3, 0, HDA_OUTPUT), 675 HDA_COMPOSE_AMP_VAL(AD1986A_FRONT_DAC, 3, 0, HDA_OUTPUT),
@@ -682,7 +682,7 @@ static struct hda_bind_ctls ad1986a_bind_pcm_sw = {
682/* 682/*
683 * mixers 683 * mixers
684 */ 684 */
685static struct snd_kcontrol_new ad1986a_mixers[] = { 685static const struct snd_kcontrol_new ad1986a_mixers[] = {
686 /* 686 /*
687 * bind volumes/mutes of 3 DACs as a single PCM control for simplicity 687 * bind volumes/mutes of 3 DACs as a single PCM control for simplicity
688 */ 688 */
@@ -723,7 +723,7 @@ static struct snd_kcontrol_new ad1986a_mixers[] = {
723}; 723};
724 724
725/* additional mixers for 3stack mode */ 725/* additional mixers for 3stack mode */
726static struct snd_kcontrol_new ad1986a_3st_mixers[] = { 726static const struct snd_kcontrol_new ad1986a_3st_mixers[] = {
727 { 727 {
728 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 728 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
729 .name = "Channel Mode", 729 .name = "Channel Mode",
@@ -735,10 +735,10 @@ static struct snd_kcontrol_new ad1986a_3st_mixers[] = {
735}; 735};
736 736
737/* laptop model - 2ch only */ 737/* laptop model - 2ch only */
738static hda_nid_t ad1986a_laptop_dac_nids[1] = { AD1986A_FRONT_DAC }; 738static const hda_nid_t ad1986a_laptop_dac_nids[1] = { AD1986A_FRONT_DAC };
739 739
740/* master controls both pins 0x1a and 0x1b */ 740/* master controls both pins 0x1a and 0x1b */
741static struct hda_bind_ctls ad1986a_laptop_master_vol = { 741static const struct hda_bind_ctls ad1986a_laptop_master_vol = {
742 .ops = &snd_hda_bind_vol, 742 .ops = &snd_hda_bind_vol,
743 .values = { 743 .values = {
744 HDA_COMPOSE_AMP_VAL(0x1a, 3, 0, HDA_OUTPUT), 744 HDA_COMPOSE_AMP_VAL(0x1a, 3, 0, HDA_OUTPUT),
@@ -747,7 +747,7 @@ static struct hda_bind_ctls ad1986a_laptop_master_vol = {
747 }, 747 },
748}; 748};
749 749
750static struct hda_bind_ctls ad1986a_laptop_master_sw = { 750static const struct hda_bind_ctls ad1986a_laptop_master_sw = {
751 .ops = &snd_hda_bind_sw, 751 .ops = &snd_hda_bind_sw,
752 .values = { 752 .values = {
753 HDA_COMPOSE_AMP_VAL(0x1a, 3, 0, HDA_OUTPUT), 753 HDA_COMPOSE_AMP_VAL(0x1a, 3, 0, HDA_OUTPUT),
@@ -756,7 +756,7 @@ static struct hda_bind_ctls ad1986a_laptop_master_sw = {
756 }, 756 },
757}; 757};
758 758
759static struct snd_kcontrol_new ad1986a_laptop_mixers[] = { 759static const struct snd_kcontrol_new ad1986a_laptop_mixers[] = {
760 HDA_CODEC_VOLUME("PCM Playback Volume", 0x03, 0x0, HDA_OUTPUT), 760 HDA_CODEC_VOLUME("PCM Playback Volume", 0x03, 0x0, HDA_OUTPUT),
761 HDA_CODEC_MUTE("PCM Playback Switch", 0x03, 0x0, HDA_OUTPUT), 761 HDA_CODEC_MUTE("PCM Playback Switch", 0x03, 0x0, HDA_OUTPUT),
762 HDA_BIND_VOL("Master Playback Volume", &ad1986a_laptop_master_vol), 762 HDA_BIND_VOL("Master Playback Volume", &ad1986a_laptop_master_vol),
@@ -787,7 +787,7 @@ static struct snd_kcontrol_new ad1986a_laptop_mixers[] = {
787 787
788/* laptop-eapd model - 2ch only */ 788/* laptop-eapd model - 2ch only */
789 789
790static struct hda_input_mux ad1986a_laptop_eapd_capture_source = { 790static const struct hda_input_mux ad1986a_laptop_eapd_capture_source = {
791 .num_items = 3, 791 .num_items = 3,
792 .items = { 792 .items = {
793 { "Mic", 0x0 }, 793 { "Mic", 0x0 },
@@ -796,7 +796,7 @@ static struct hda_input_mux ad1986a_laptop_eapd_capture_source = {
796 }, 796 },
797}; 797};
798 798
799static struct hda_input_mux ad1986a_automic_capture_source = { 799static const struct hda_input_mux ad1986a_automic_capture_source = {
800 .num_items = 2, 800 .num_items = 2,
801 .items = { 801 .items = {
802 { "Mic", 0x0 }, 802 { "Mic", 0x0 },
@@ -804,13 +804,13 @@ static struct hda_input_mux ad1986a_automic_capture_source = {
804 }, 804 },
805}; 805};
806 806
807static struct snd_kcontrol_new ad1986a_laptop_master_mixers[] = { 807static const struct snd_kcontrol_new ad1986a_laptop_master_mixers[] = {
808 HDA_BIND_VOL("Master Playback Volume", &ad1986a_laptop_master_vol), 808 HDA_BIND_VOL("Master Playback Volume", &ad1986a_laptop_master_vol),
809 HDA_BIND_SW("Master Playback Switch", &ad1986a_laptop_master_sw), 809 HDA_BIND_SW("Master Playback Switch", &ad1986a_laptop_master_sw),
810 { } /* end */ 810 { } /* end */
811}; 811};
812 812
813static struct snd_kcontrol_new ad1986a_laptop_eapd_mixers[] = { 813static const struct snd_kcontrol_new ad1986a_laptop_eapd_mixers[] = {
814 HDA_CODEC_VOLUME("PCM Playback Volume", 0x03, 0x0, HDA_OUTPUT), 814 HDA_CODEC_VOLUME("PCM Playback Volume", 0x03, 0x0, HDA_OUTPUT),
815 HDA_CODEC_MUTE("PCM Playback Switch", 0x03, 0x0, HDA_OUTPUT), 815 HDA_CODEC_MUTE("PCM Playback Switch", 0x03, 0x0, HDA_OUTPUT),
816 HDA_CODEC_VOLUME("Mic Playback Volume", 0x13, 0x0, HDA_OUTPUT), 816 HDA_CODEC_VOLUME("Mic Playback Volume", 0x13, 0x0, HDA_OUTPUT),
@@ -837,7 +837,7 @@ static struct snd_kcontrol_new ad1986a_laptop_eapd_mixers[] = {
837 { } /* end */ 837 { } /* end */
838}; 838};
839 839
840static struct snd_kcontrol_new ad1986a_laptop_intmic_mixers[] = { 840static const struct snd_kcontrol_new ad1986a_laptop_intmic_mixers[] = {
841 HDA_CODEC_VOLUME("Internal Mic Playback Volume", 0x17, 0, HDA_OUTPUT), 841 HDA_CODEC_VOLUME("Internal Mic Playback Volume", 0x17, 0, HDA_OUTPUT),
842 HDA_CODEC_MUTE("Internal Mic Playback Switch", 0x17, 0, HDA_OUTPUT), 842 HDA_CODEC_MUTE("Internal Mic Playback Switch", 0x17, 0, HDA_OUTPUT),
843 { } /* end */ 843 { } /* end */
@@ -931,7 +931,7 @@ static int ad1986a_hp_master_sw_put(struct snd_kcontrol *kcontrol,
931 return change; 931 return change;
932} 932}
933 933
934static struct snd_kcontrol_new ad1986a_automute_master_mixers[] = { 934static const struct snd_kcontrol_new ad1986a_automute_master_mixers[] = {
935 HDA_BIND_VOL("Master Playback Volume", &ad1986a_laptop_master_vol), 935 HDA_BIND_VOL("Master Playback Volume", &ad1986a_laptop_master_vol),
936 { 936 {
937 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 937 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
@@ -949,7 +949,7 @@ static struct snd_kcontrol_new ad1986a_automute_master_mixers[] = {
949/* 949/*
950 * initialization verbs 950 * initialization verbs
951 */ 951 */
952static struct hda_verb ad1986a_init_verbs[] = { 952static const struct hda_verb ad1986a_init_verbs[] = {
953 /* Front, Surround, CLFE DAC; mute as default */ 953 /* Front, Surround, CLFE DAC; mute as default */
954 {0x03, AC_VERB_SET_AMP_GAIN_MUTE, 0xb080}, 954 {0x03, AC_VERB_SET_AMP_GAIN_MUTE, 0xb080},
955 {0x04, AC_VERB_SET_AMP_GAIN_MUTE, 0xb080}, 955 {0x04, AC_VERB_SET_AMP_GAIN_MUTE, 0xb080},
@@ -1004,7 +1004,7 @@ static struct hda_verb ad1986a_init_verbs[] = {
1004 { } /* end */ 1004 { } /* end */
1005}; 1005};
1006 1006
1007static struct hda_verb ad1986a_ch2_init[] = { 1007static const struct hda_verb ad1986a_ch2_init[] = {
1008 /* Surround out -> Line In */ 1008 /* Surround out -> Line In */
1009 { 0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN }, 1009 { 0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN },
1010 /* Line-in selectors */ 1010 /* Line-in selectors */
@@ -1016,7 +1016,7 @@ static struct hda_verb ad1986a_ch2_init[] = {
1016 { } /* end */ 1016 { } /* end */
1017}; 1017};
1018 1018
1019static struct hda_verb ad1986a_ch4_init[] = { 1019static const struct hda_verb ad1986a_ch4_init[] = {
1020 /* Surround out -> Surround */ 1020 /* Surround out -> Surround */
1021 { 0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT }, 1021 { 0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
1022 { 0x10, AC_VERB_SET_CONNECT_SEL, 0x0 }, 1022 { 0x10, AC_VERB_SET_CONNECT_SEL, 0x0 },
@@ -1026,7 +1026,7 @@ static struct hda_verb ad1986a_ch4_init[] = {
1026 { } /* end */ 1026 { } /* end */
1027}; 1027};
1028 1028
1029static struct hda_verb ad1986a_ch6_init[] = { 1029static const struct hda_verb ad1986a_ch6_init[] = {
1030 /* Surround out -> Surround out */ 1030 /* Surround out -> Surround out */
1031 { 0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT }, 1031 { 0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
1032 { 0x10, AC_VERB_SET_CONNECT_SEL, 0x0 }, 1032 { 0x10, AC_VERB_SET_CONNECT_SEL, 0x0 },
@@ -1036,19 +1036,19 @@ static struct hda_verb ad1986a_ch6_init[] = {
1036 { } /* end */ 1036 { } /* end */
1037}; 1037};
1038 1038
1039static struct hda_channel_mode ad1986a_modes[3] = { 1039static const struct hda_channel_mode ad1986a_modes[3] = {
1040 { 2, ad1986a_ch2_init }, 1040 { 2, ad1986a_ch2_init },
1041 { 4, ad1986a_ch4_init }, 1041 { 4, ad1986a_ch4_init },
1042 { 6, ad1986a_ch6_init }, 1042 { 6, ad1986a_ch6_init },
1043}; 1043};
1044 1044
1045/* eapd initialization */ 1045/* eapd initialization */
1046static struct hda_verb ad1986a_eapd_init_verbs[] = { 1046static const struct hda_verb ad1986a_eapd_init_verbs[] = {
1047 {0x1b, AC_VERB_SET_EAPD_BTLENABLE, 0x00 }, 1047 {0x1b, AC_VERB_SET_EAPD_BTLENABLE, 0x00 },
1048 {} 1048 {}
1049}; 1049};
1050 1050
1051static struct hda_verb ad1986a_automic_verbs[] = { 1051static const struct hda_verb ad1986a_automic_verbs[] = {
1052 {0x1d, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80}, 1052 {0x1d, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
1053 {0x1f, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80}, 1053 {0x1f, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
1054 /*{0x20, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},*/ 1054 /*{0x20, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},*/
@@ -1058,7 +1058,7 @@ static struct hda_verb ad1986a_automic_verbs[] = {
1058}; 1058};
1059 1059
1060/* Ultra initialization */ 1060/* Ultra initialization */
1061static struct hda_verb ad1986a_ultra_init[] = { 1061static const struct hda_verb ad1986a_ultra_init[] = {
1062 /* eapd initialization */ 1062 /* eapd initialization */
1063 { 0x1b, AC_VERB_SET_EAPD_BTLENABLE, 0x00 }, 1063 { 0x1b, AC_VERB_SET_EAPD_BTLENABLE, 0x00 },
1064 /* CLFE -> Mic in */ 1064 /* CLFE -> Mic in */
@@ -1069,7 +1069,7 @@ static struct hda_verb ad1986a_ultra_init[] = {
1069}; 1069};
1070 1070
1071/* pin sensing on HP jack */ 1071/* pin sensing on HP jack */
1072static struct hda_verb ad1986a_hp_init_verbs[] = { 1072static const struct hda_verb ad1986a_hp_init_verbs[] = {
1073 {0x1a, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | AD1986A_HP_EVENT}, 1073 {0x1a, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | AD1986A_HP_EVENT},
1074 {} 1074 {}
1075}; 1075};
@@ -1120,7 +1120,7 @@ static const char * const ad1986a_models[AD1986A_MODELS] = {
1120 [AD1986A_SAMSUNG_P50] = "samsung-p50", 1120 [AD1986A_SAMSUNG_P50] = "samsung-p50",
1121}; 1121};
1122 1122
1123static struct snd_pci_quirk ad1986a_cfg_tbl[] = { 1123static const struct snd_pci_quirk ad1986a_cfg_tbl[] = {
1124 SND_PCI_QUIRK(0x103c, 0x30af, "HP B2800", AD1986A_LAPTOP_EAPD), 1124 SND_PCI_QUIRK(0x103c, 0x30af, "HP B2800", AD1986A_LAPTOP_EAPD),
1125 SND_PCI_QUIRK(0x1043, 0x1153, "ASUS M9", AD1986A_LAPTOP_EAPD), 1125 SND_PCI_QUIRK(0x1043, 0x1153, "ASUS M9", AD1986A_LAPTOP_EAPD),
1126 SND_PCI_QUIRK(0x1043, 0x11f7, "ASUS U5A", AD1986A_LAPTOP_EAPD), 1126 SND_PCI_QUIRK(0x1043, 0x11f7, "ASUS U5A", AD1986A_LAPTOP_EAPD),
@@ -1152,7 +1152,7 @@ static struct snd_pci_quirk ad1986a_cfg_tbl[] = {
1152}; 1152};
1153 1153
1154#ifdef CONFIG_SND_HDA_POWER_SAVE 1154#ifdef CONFIG_SND_HDA_POWER_SAVE
1155static struct hda_amp_list ad1986a_loopbacks[] = { 1155static const struct hda_amp_list ad1986a_loopbacks[] = {
1156 { 0x13, HDA_OUTPUT, 0 }, /* Mic */ 1156 { 0x13, HDA_OUTPUT, 0 }, /* Mic */
1157 { 0x14, HDA_OUTPUT, 0 }, /* Phone */ 1157 { 0x14, HDA_OUTPUT, 0 }, /* Phone */
1158 { 0x15, HDA_OUTPUT, 0 }, /* CD */ 1158 { 0x15, HDA_OUTPUT, 0 }, /* CD */
@@ -1329,11 +1329,11 @@ static int patch_ad1986a(struct hda_codec *codec)
1329#define AD1983_DAC 0x03 1329#define AD1983_DAC 0x03
1330#define AD1983_ADC 0x04 1330#define AD1983_ADC 0x04
1331 1331
1332static hda_nid_t ad1983_dac_nids[1] = { AD1983_DAC }; 1332static const hda_nid_t ad1983_dac_nids[1] = { AD1983_DAC };
1333static hda_nid_t ad1983_adc_nids[1] = { AD1983_ADC }; 1333static const hda_nid_t ad1983_adc_nids[1] = { AD1983_ADC };
1334static hda_nid_t ad1983_capsrc_nids[1] = { 0x15 }; 1334static const hda_nid_t ad1983_capsrc_nids[1] = { 0x15 };
1335 1335
1336static struct hda_input_mux ad1983_capture_source = { 1336static const struct hda_input_mux ad1983_capture_source = {
1337 .num_items = 4, 1337 .num_items = 4,
1338 .items = { 1338 .items = {
1339 { "Mic", 0x0 }, 1339 { "Mic", 0x0 },
@@ -1348,7 +1348,7 @@ static struct hda_input_mux ad1983_capture_source = {
1348 */ 1348 */
1349static int ad1983_spdif_route_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) 1349static int ad1983_spdif_route_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
1350{ 1350{
1351 static char *texts[] = { "PCM", "ADC" }; 1351 static const char * const texts[] = { "PCM", "ADC" };
1352 1352
1353 uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; 1353 uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
1354 uinfo->count = 1; 1354 uinfo->count = 1;
@@ -1385,7 +1385,7 @@ static int ad1983_spdif_route_put(struct snd_kcontrol *kcontrol, struct snd_ctl_
1385 return 0; 1385 return 0;
1386} 1386}
1387 1387
1388static struct snd_kcontrol_new ad1983_mixers[] = { 1388static const struct snd_kcontrol_new ad1983_mixers[] = {
1389 HDA_CODEC_VOLUME("Front Playback Volume", 0x05, 0x0, HDA_OUTPUT), 1389 HDA_CODEC_VOLUME("Front Playback Volume", 0x05, 0x0, HDA_OUTPUT),
1390 HDA_CODEC_MUTE("Front Playback Switch", 0x05, 0x0, HDA_OUTPUT), 1390 HDA_CODEC_MUTE("Front Playback Switch", 0x05, 0x0, HDA_OUTPUT),
1391 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x06, 0x0, HDA_OUTPUT), 1391 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x06, 0x0, HDA_OUTPUT),
@@ -1418,7 +1418,7 @@ static struct snd_kcontrol_new ad1983_mixers[] = {
1418 { } /* end */ 1418 { } /* end */
1419}; 1419};
1420 1420
1421static struct hda_verb ad1983_init_verbs[] = { 1421static const struct hda_verb ad1983_init_verbs[] = {
1422 /* Front, HP, Mono; mute as default */ 1422 /* Front, HP, Mono; mute as default */
1423 {0x05, AC_VERB_SET_AMP_GAIN_MUTE, 0xb080}, 1423 {0x05, AC_VERB_SET_AMP_GAIN_MUTE, 0xb080},
1424 {0x06, AC_VERB_SET_AMP_GAIN_MUTE, 0xb080}, 1424 {0x06, AC_VERB_SET_AMP_GAIN_MUTE, 0xb080},
@@ -1458,7 +1458,7 @@ static struct hda_verb ad1983_init_verbs[] = {
1458}; 1458};
1459 1459
1460#ifdef CONFIG_SND_HDA_POWER_SAVE 1460#ifdef CONFIG_SND_HDA_POWER_SAVE
1461static struct hda_amp_list ad1983_loopbacks[] = { 1461static const struct hda_amp_list ad1983_loopbacks[] = {
1462 { 0x12, HDA_OUTPUT, 0 }, /* Mic */ 1462 { 0x12, HDA_OUTPUT, 0 }, /* Mic */
1463 { 0x13, HDA_OUTPUT, 0 }, /* Line */ 1463 { 0x13, HDA_OUTPUT, 0 }, /* Line */
1464 { } /* end */ 1464 { } /* end */
@@ -1518,12 +1518,12 @@ static int patch_ad1983(struct hda_codec *codec)
1518#define AD1981_DAC 0x03 1518#define AD1981_DAC 0x03
1519#define AD1981_ADC 0x04 1519#define AD1981_ADC 0x04
1520 1520
1521static hda_nid_t ad1981_dac_nids[1] = { AD1981_DAC }; 1521static const hda_nid_t ad1981_dac_nids[1] = { AD1981_DAC };
1522static hda_nid_t ad1981_adc_nids[1] = { AD1981_ADC }; 1522static const hda_nid_t ad1981_adc_nids[1] = { AD1981_ADC };
1523static hda_nid_t ad1981_capsrc_nids[1] = { 0x15 }; 1523static const hda_nid_t ad1981_capsrc_nids[1] = { 0x15 };
1524 1524
1525/* 0x0c, 0x09, 0x0e, 0x0f, 0x19, 0x05, 0x18, 0x17 */ 1525/* 0x0c, 0x09, 0x0e, 0x0f, 0x19, 0x05, 0x18, 0x17 */
1526static struct hda_input_mux ad1981_capture_source = { 1526static const struct hda_input_mux ad1981_capture_source = {
1527 .num_items = 7, 1527 .num_items = 7,
1528 .items = { 1528 .items = {
1529 { "Front Mic", 0x0 }, 1529 { "Front Mic", 0x0 },
@@ -1536,7 +1536,7 @@ static struct hda_input_mux ad1981_capture_source = {
1536 }, 1536 },
1537}; 1537};
1538 1538
1539static struct snd_kcontrol_new ad1981_mixers[] = { 1539static const struct snd_kcontrol_new ad1981_mixers[] = {
1540 HDA_CODEC_VOLUME("Front Playback Volume", 0x05, 0x0, HDA_OUTPUT), 1540 HDA_CODEC_VOLUME("Front Playback Volume", 0x05, 0x0, HDA_OUTPUT),
1541 HDA_CODEC_MUTE("Front Playback Switch", 0x05, 0x0, HDA_OUTPUT), 1541 HDA_CODEC_MUTE("Front Playback Switch", 0x05, 0x0, HDA_OUTPUT),
1542 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x06, 0x0, HDA_OUTPUT), 1542 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x06, 0x0, HDA_OUTPUT),
@@ -1577,7 +1577,7 @@ static struct snd_kcontrol_new ad1981_mixers[] = {
1577 { } /* end */ 1577 { } /* end */
1578}; 1578};
1579 1579
1580static struct hda_verb ad1981_init_verbs[] = { 1580static const struct hda_verb ad1981_init_verbs[] = {
1581 /* Front, HP, Mono; mute as default */ 1581 /* Front, HP, Mono; mute as default */
1582 {0x05, AC_VERB_SET_AMP_GAIN_MUTE, 0xb080}, 1582 {0x05, AC_VERB_SET_AMP_GAIN_MUTE, 0xb080},
1583 {0x06, AC_VERB_SET_AMP_GAIN_MUTE, 0xb080}, 1583 {0x06, AC_VERB_SET_AMP_GAIN_MUTE, 0xb080},
@@ -1625,7 +1625,7 @@ static struct hda_verb ad1981_init_verbs[] = {
1625}; 1625};
1626 1626
1627#ifdef CONFIG_SND_HDA_POWER_SAVE 1627#ifdef CONFIG_SND_HDA_POWER_SAVE
1628static struct hda_amp_list ad1981_loopbacks[] = { 1628static const struct hda_amp_list ad1981_loopbacks[] = {
1629 { 0x12, HDA_OUTPUT, 0 }, /* Front Mic */ 1629 { 0x12, HDA_OUTPUT, 0 }, /* Front Mic */
1630 { 0x13, HDA_OUTPUT, 0 }, /* Line */ 1630 { 0x13, HDA_OUTPUT, 0 }, /* Line */
1631 { 0x1b, HDA_OUTPUT, 0 }, /* Aux */ 1631 { 0x1b, HDA_OUTPUT, 0 }, /* Aux */
@@ -1645,7 +1645,7 @@ static struct hda_amp_list ad1981_loopbacks[] = {
1645#define AD1981_HP_EVENT 0x37 1645#define AD1981_HP_EVENT 0x37
1646#define AD1981_MIC_EVENT 0x38 1646#define AD1981_MIC_EVENT 0x38
1647 1647
1648static struct hda_verb ad1981_hp_init_verbs[] = { 1648static const struct hda_verb ad1981_hp_init_verbs[] = {
1649 {0x05, AC_VERB_SET_EAPD_BTLENABLE, 0x00 }, /* default off */ 1649 {0x05, AC_VERB_SET_EAPD_BTLENABLE, 0x00 }, /* default off */
1650 /* pin sensing on HP and Mic jacks */ 1650 /* pin sensing on HP and Mic jacks */
1651 {0x06, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | AD1981_HP_EVENT}, 1651 {0x06, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | AD1981_HP_EVENT},
@@ -1674,7 +1674,7 @@ static int ad1981_hp_master_sw_put(struct snd_kcontrol *kcontrol,
1674} 1674}
1675 1675
1676/* bind volumes of both NID 0x05 and 0x06 */ 1676/* bind volumes of both NID 0x05 and 0x06 */
1677static struct hda_bind_ctls ad1981_hp_bind_master_vol = { 1677static const struct hda_bind_ctls ad1981_hp_bind_master_vol = {
1678 .ops = &snd_hda_bind_vol, 1678 .ops = &snd_hda_bind_vol,
1679 .values = { 1679 .values = {
1680 HDA_COMPOSE_AMP_VAL(0x05, 3, 0, HDA_OUTPUT), 1680 HDA_COMPOSE_AMP_VAL(0x05, 3, 0, HDA_OUTPUT),
@@ -1696,12 +1696,12 @@ static void ad1981_hp_automute(struct hda_codec *codec)
1696/* toggle input of built-in and mic jack appropriately */ 1696/* toggle input of built-in and mic jack appropriately */
1697static void ad1981_hp_automic(struct hda_codec *codec) 1697static void ad1981_hp_automic(struct hda_codec *codec)
1698{ 1698{
1699 static struct hda_verb mic_jack_on[] = { 1699 static const struct hda_verb mic_jack_on[] = {
1700 {0x1f, AC_VERB_SET_AMP_GAIN_MUTE, 0xb080}, 1700 {0x1f, AC_VERB_SET_AMP_GAIN_MUTE, 0xb080},
1701 {0x1e, AC_VERB_SET_AMP_GAIN_MUTE, 0xb000}, 1701 {0x1e, AC_VERB_SET_AMP_GAIN_MUTE, 0xb000},
1702 {} 1702 {}
1703 }; 1703 };
1704 static struct hda_verb mic_jack_off[] = { 1704 static const struct hda_verb mic_jack_off[] = {
1705 {0x1e, AC_VERB_SET_AMP_GAIN_MUTE, 0xb080}, 1705 {0x1e, AC_VERB_SET_AMP_GAIN_MUTE, 0xb080},
1706 {0x1f, AC_VERB_SET_AMP_GAIN_MUTE, 0xb000}, 1706 {0x1f, AC_VERB_SET_AMP_GAIN_MUTE, 0xb000},
1707 {} 1707 {}
@@ -1730,7 +1730,7 @@ static void ad1981_hp_unsol_event(struct hda_codec *codec,
1730 } 1730 }
1731} 1731}
1732 1732
1733static struct hda_input_mux ad1981_hp_capture_source = { 1733static const struct hda_input_mux ad1981_hp_capture_source = {
1734 .num_items = 3, 1734 .num_items = 3,
1735 .items = { 1735 .items = {
1736 { "Mic", 0x0 }, 1736 { "Mic", 0x0 },
@@ -1739,7 +1739,7 @@ static struct hda_input_mux ad1981_hp_capture_source = {
1739 }, 1739 },
1740}; 1740};
1741 1741
1742static struct snd_kcontrol_new ad1981_hp_mixers[] = { 1742static const struct snd_kcontrol_new ad1981_hp_mixers[] = {
1743 HDA_BIND_VOL("Master Playback Volume", &ad1981_hp_bind_master_vol), 1743 HDA_BIND_VOL("Master Playback Volume", &ad1981_hp_bind_master_vol),
1744 { 1744 {
1745 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1745 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
@@ -1790,7 +1790,7 @@ static int ad1981_hp_init(struct hda_codec *codec)
1790} 1790}
1791 1791
1792/* configuration for Toshiba Laptops */ 1792/* configuration for Toshiba Laptops */
1793static struct hda_verb ad1981_toshiba_init_verbs[] = { 1793static const struct hda_verb ad1981_toshiba_init_verbs[] = {
1794 {0x05, AC_VERB_SET_EAPD_BTLENABLE, 0x01 }, /* default on */ 1794 {0x05, AC_VERB_SET_EAPD_BTLENABLE, 0x01 }, /* default on */
1795 /* pin sensing on HP and Mic jacks */ 1795 /* pin sensing on HP and Mic jacks */
1796 {0x06, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | AD1981_HP_EVENT}, 1796 {0x06, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | AD1981_HP_EVENT},
@@ -1798,14 +1798,14 @@ static struct hda_verb ad1981_toshiba_init_verbs[] = {
1798 {} 1798 {}
1799}; 1799};
1800 1800
1801static struct snd_kcontrol_new ad1981_toshiba_mixers[] = { 1801static const struct snd_kcontrol_new ad1981_toshiba_mixers[] = {
1802 HDA_CODEC_VOLUME("Amp Volume", 0x1a, 0x0, HDA_OUTPUT), 1802 HDA_CODEC_VOLUME("Amp Volume", 0x1a, 0x0, HDA_OUTPUT),
1803 HDA_CODEC_MUTE("Amp Switch", 0x1a, 0x0, HDA_OUTPUT), 1803 HDA_CODEC_MUTE("Amp Switch", 0x1a, 0x0, HDA_OUTPUT),
1804 { } 1804 { }
1805}; 1805};
1806 1806
1807/* configuration for Lenovo Thinkpad T60 */ 1807/* configuration for Lenovo Thinkpad T60 */
1808static struct snd_kcontrol_new ad1981_thinkpad_mixers[] = { 1808static const struct snd_kcontrol_new ad1981_thinkpad_mixers[] = {
1809 HDA_CODEC_VOLUME("Master Playback Volume", 0x05, 0x0, HDA_OUTPUT), 1809 HDA_CODEC_VOLUME("Master Playback Volume", 0x05, 0x0, HDA_OUTPUT),
1810 HDA_CODEC_MUTE("Master Playback Switch", 0x05, 0x0, HDA_OUTPUT), 1810 HDA_CODEC_MUTE("Master Playback Switch", 0x05, 0x0, HDA_OUTPUT),
1811 HDA_CODEC_VOLUME("PCM Playback Volume", 0x11, 0x0, HDA_OUTPUT), 1811 HDA_CODEC_VOLUME("PCM Playback Volume", 0x11, 0x0, HDA_OUTPUT),
@@ -1835,7 +1835,7 @@ static struct snd_kcontrol_new ad1981_thinkpad_mixers[] = {
1835 { } /* end */ 1835 { } /* end */
1836}; 1836};
1837 1837
1838static struct hda_input_mux ad1981_thinkpad_capture_source = { 1838static const struct hda_input_mux ad1981_thinkpad_capture_source = {
1839 .num_items = 3, 1839 .num_items = 3,
1840 .items = { 1840 .items = {
1841 { "Mic", 0x0 }, 1841 { "Mic", 0x0 },
@@ -1860,7 +1860,7 @@ static const char * const ad1981_models[AD1981_MODELS] = {
1860 [AD1981_TOSHIBA] = "toshiba" 1860 [AD1981_TOSHIBA] = "toshiba"
1861}; 1861};
1862 1862
1863static struct snd_pci_quirk ad1981_cfg_tbl[] = { 1863static const struct snd_pci_quirk ad1981_cfg_tbl[] = {
1864 SND_PCI_QUIRK(0x1014, 0x0597, "Lenovo Z60", AD1981_THINKPAD), 1864 SND_PCI_QUIRK(0x1014, 0x0597, "Lenovo Z60", AD1981_THINKPAD),
1865 SND_PCI_QUIRK(0x1014, 0x05b7, "Lenovo Z60m", AD1981_THINKPAD), 1865 SND_PCI_QUIRK(0x1014, 0x05b7, "Lenovo Z60m", AD1981_THINKPAD),
1866 /* All HP models */ 1866 /* All HP models */
@@ -2075,32 +2075,32 @@ enum {
2075 * mixers 2075 * mixers
2076 */ 2076 */
2077 2077
2078static hda_nid_t ad1988_6stack_dac_nids[4] = { 2078static const hda_nid_t ad1988_6stack_dac_nids[4] = {
2079 0x04, 0x06, 0x05, 0x0a 2079 0x04, 0x06, 0x05, 0x0a
2080}; 2080};
2081 2081
2082static hda_nid_t ad1988_3stack_dac_nids[3] = { 2082static const hda_nid_t ad1988_3stack_dac_nids[3] = {
2083 0x04, 0x05, 0x0a 2083 0x04, 0x05, 0x0a
2084}; 2084};
2085 2085
2086/* for AD1988A revision-2, DAC2-4 are swapped */ 2086/* for AD1988A revision-2, DAC2-4 are swapped */
2087static hda_nid_t ad1988_6stack_dac_nids_rev2[4] = { 2087static const hda_nid_t ad1988_6stack_dac_nids_rev2[4] = {
2088 0x04, 0x05, 0x0a, 0x06 2088 0x04, 0x05, 0x0a, 0x06
2089}; 2089};
2090 2090
2091static hda_nid_t ad1988_alt_dac_nid[1] = { 2091static const hda_nid_t ad1988_alt_dac_nid[1] = {
2092 0x03 2092 0x03
2093}; 2093};
2094 2094
2095static hda_nid_t ad1988_3stack_dac_nids_rev2[3] = { 2095static const hda_nid_t ad1988_3stack_dac_nids_rev2[3] = {
2096 0x04, 0x0a, 0x06 2096 0x04, 0x0a, 0x06
2097}; 2097};
2098 2098
2099static hda_nid_t ad1988_adc_nids[3] = { 2099static const hda_nid_t ad1988_adc_nids[3] = {
2100 0x08, 0x09, 0x0f 2100 0x08, 0x09, 0x0f
2101}; 2101};
2102 2102
2103static hda_nid_t ad1988_capsrc_nids[3] = { 2103static const hda_nid_t ad1988_capsrc_nids[3] = {
2104 0x0c, 0x0d, 0x0e 2104 0x0c, 0x0d, 0x0e
2105}; 2105};
2106 2106
@@ -2108,11 +2108,11 @@ static hda_nid_t ad1988_capsrc_nids[3] = {
2108#define AD1988_SPDIF_OUT_HDMI 0x0b 2108#define AD1988_SPDIF_OUT_HDMI 0x0b
2109#define AD1988_SPDIF_IN 0x07 2109#define AD1988_SPDIF_IN 0x07
2110 2110
2111static hda_nid_t ad1989b_slave_dig_outs[] = { 2111static const hda_nid_t ad1989b_slave_dig_outs[] = {
2112 AD1988_SPDIF_OUT, AD1988_SPDIF_OUT_HDMI, 0 2112 AD1988_SPDIF_OUT, AD1988_SPDIF_OUT_HDMI, 0
2113}; 2113};
2114 2114
2115static struct hda_input_mux ad1988_6stack_capture_source = { 2115static const struct hda_input_mux ad1988_6stack_capture_source = {
2116 .num_items = 5, 2116 .num_items = 5,
2117 .items = { 2117 .items = {
2118 { "Front Mic", 0x1 }, /* port-B */ 2118 { "Front Mic", 0x1 }, /* port-B */
@@ -2123,7 +2123,7 @@ static struct hda_input_mux ad1988_6stack_capture_source = {
2123 }, 2123 },
2124}; 2124};
2125 2125
2126static struct hda_input_mux ad1988_laptop_capture_source = { 2126static const struct hda_input_mux ad1988_laptop_capture_source = {
2127 .num_items = 3, 2127 .num_items = 3,
2128 .items = { 2128 .items = {
2129 { "Mic/Line", 0x1 }, /* port-B */ 2129 { "Mic/Line", 0x1 }, /* port-B */
@@ -2166,7 +2166,7 @@ static int ad198x_ch_mode_put(struct snd_kcontrol *kcontrol,
2166} 2166}
2167 2167
2168/* 6-stack mode */ 2168/* 6-stack mode */
2169static struct snd_kcontrol_new ad1988_6stack_mixers1[] = { 2169static const struct snd_kcontrol_new ad1988_6stack_mixers1[] = {
2170 HDA_CODEC_VOLUME("Front Playback Volume", 0x04, 0x0, HDA_OUTPUT), 2170 HDA_CODEC_VOLUME("Front Playback Volume", 0x04, 0x0, HDA_OUTPUT),
2171 HDA_CODEC_VOLUME("Surround Playback Volume", 0x06, 0x0, HDA_OUTPUT), 2171 HDA_CODEC_VOLUME("Surround Playback Volume", 0x06, 0x0, HDA_OUTPUT),
2172 HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x05, 1, 0x0, HDA_OUTPUT), 2172 HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x05, 1, 0x0, HDA_OUTPUT),
@@ -2175,7 +2175,7 @@ static struct snd_kcontrol_new ad1988_6stack_mixers1[] = {
2175 { } /* end */ 2175 { } /* end */
2176}; 2176};
2177 2177
2178static struct snd_kcontrol_new ad1988_6stack_mixers1_rev2[] = { 2178static const struct snd_kcontrol_new ad1988_6stack_mixers1_rev2[] = {
2179 HDA_CODEC_VOLUME("Front Playback Volume", 0x04, 0x0, HDA_OUTPUT), 2179 HDA_CODEC_VOLUME("Front Playback Volume", 0x04, 0x0, HDA_OUTPUT),
2180 HDA_CODEC_VOLUME("Surround Playback Volume", 0x05, 0x0, HDA_OUTPUT), 2180 HDA_CODEC_VOLUME("Surround Playback Volume", 0x05, 0x0, HDA_OUTPUT),
2181 HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0a, 1, 0x0, HDA_OUTPUT), 2181 HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0a, 1, 0x0, HDA_OUTPUT),
@@ -2184,7 +2184,7 @@ static struct snd_kcontrol_new ad1988_6stack_mixers1_rev2[] = {
2184 { } /* end */ 2184 { } /* end */
2185}; 2185};
2186 2186
2187static struct snd_kcontrol_new ad1988_6stack_mixers2[] = { 2187static const struct snd_kcontrol_new ad1988_6stack_mixers2[] = {
2188 HDA_BIND_MUTE("Front Playback Switch", 0x29, 2, HDA_INPUT), 2188 HDA_BIND_MUTE("Front Playback Switch", 0x29, 2, HDA_INPUT),
2189 HDA_BIND_MUTE("Surround Playback Switch", 0x2a, 2, HDA_INPUT), 2189 HDA_BIND_MUTE("Surround Playback Switch", 0x2a, 2, HDA_INPUT),
2190 HDA_BIND_MUTE_MONO("Center Playback Switch", 0x27, 1, 2, HDA_INPUT), 2190 HDA_BIND_MUTE_MONO("Center Playback Switch", 0x27, 1, 2, HDA_INPUT),
@@ -2211,14 +2211,14 @@ static struct snd_kcontrol_new ad1988_6stack_mixers2[] = {
2211 { } /* end */ 2211 { } /* end */
2212}; 2212};
2213 2213
2214static struct snd_kcontrol_new ad1988_6stack_fp_mixers[] = { 2214static const struct snd_kcontrol_new ad1988_6stack_fp_mixers[] = {
2215 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x03, 0x0, HDA_OUTPUT), 2215 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x03, 0x0, HDA_OUTPUT),
2216 2216
2217 { } /* end */ 2217 { } /* end */
2218}; 2218};
2219 2219
2220/* 3-stack mode */ 2220/* 3-stack mode */
2221static struct snd_kcontrol_new ad1988_3stack_mixers1[] = { 2221static const struct snd_kcontrol_new ad1988_3stack_mixers1[] = {
2222 HDA_CODEC_VOLUME("Front Playback Volume", 0x04, 0x0, HDA_OUTPUT), 2222 HDA_CODEC_VOLUME("Front Playback Volume", 0x04, 0x0, HDA_OUTPUT),
2223 HDA_CODEC_VOLUME("Surround Playback Volume", 0x0a, 0x0, HDA_OUTPUT), 2223 HDA_CODEC_VOLUME("Surround Playback Volume", 0x0a, 0x0, HDA_OUTPUT),
2224 HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x05, 1, 0x0, HDA_OUTPUT), 2224 HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x05, 1, 0x0, HDA_OUTPUT),
@@ -2226,7 +2226,7 @@ static struct snd_kcontrol_new ad1988_3stack_mixers1[] = {
2226 { } /* end */ 2226 { } /* end */
2227}; 2227};
2228 2228
2229static struct snd_kcontrol_new ad1988_3stack_mixers1_rev2[] = { 2229static const struct snd_kcontrol_new ad1988_3stack_mixers1_rev2[] = {
2230 HDA_CODEC_VOLUME("Front Playback Volume", 0x04, 0x0, HDA_OUTPUT), 2230 HDA_CODEC_VOLUME("Front Playback Volume", 0x04, 0x0, HDA_OUTPUT),
2231 HDA_CODEC_VOLUME("Surround Playback Volume", 0x0a, 0x0, HDA_OUTPUT), 2231 HDA_CODEC_VOLUME("Surround Playback Volume", 0x0a, 0x0, HDA_OUTPUT),
2232 HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x06, 1, 0x0, HDA_OUTPUT), 2232 HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x06, 1, 0x0, HDA_OUTPUT),
@@ -2234,7 +2234,7 @@ static struct snd_kcontrol_new ad1988_3stack_mixers1_rev2[] = {
2234 { } /* end */ 2234 { } /* end */
2235}; 2235};
2236 2236
2237static struct snd_kcontrol_new ad1988_3stack_mixers2[] = { 2237static const struct snd_kcontrol_new ad1988_3stack_mixers2[] = {
2238 HDA_BIND_MUTE("Front Playback Switch", 0x29, 2, HDA_INPUT), 2238 HDA_BIND_MUTE("Front Playback Switch", 0x29, 2, HDA_INPUT),
2239 HDA_BIND_MUTE("Surround Playback Switch", 0x2c, 2, HDA_INPUT), 2239 HDA_BIND_MUTE("Surround Playback Switch", 0x2c, 2, HDA_INPUT),
2240 HDA_BIND_MUTE_MONO("Center Playback Switch", 0x26, 1, 2, HDA_INPUT), 2240 HDA_BIND_MUTE_MONO("Center Playback Switch", 0x26, 1, 2, HDA_INPUT),
@@ -2268,7 +2268,7 @@ static struct snd_kcontrol_new ad1988_3stack_mixers2[] = {
2268}; 2268};
2269 2269
2270/* laptop mode */ 2270/* laptop mode */
2271static struct snd_kcontrol_new ad1988_laptop_mixers[] = { 2271static const struct snd_kcontrol_new ad1988_laptop_mixers[] = {
2272 HDA_CODEC_VOLUME("PCM Playback Volume", 0x04, 0x0, HDA_OUTPUT), 2272 HDA_CODEC_VOLUME("PCM Playback Volume", 0x04, 0x0, HDA_OUTPUT),
2273 HDA_CODEC_MUTE("PCM Playback Switch", 0x29, 0x0, HDA_INPUT), 2273 HDA_CODEC_MUTE("PCM Playback Switch", 0x29, 0x0, HDA_INPUT),
2274 HDA_BIND_MUTE("Mono Playback Switch", 0x1e, 2, HDA_INPUT), 2274 HDA_BIND_MUTE("Mono Playback Switch", 0x1e, 2, HDA_INPUT),
@@ -2299,7 +2299,7 @@ static struct snd_kcontrol_new ad1988_laptop_mixers[] = {
2299}; 2299};
2300 2300
2301/* capture */ 2301/* capture */
2302static struct snd_kcontrol_new ad1988_capture_mixers[] = { 2302static const struct snd_kcontrol_new ad1988_capture_mixers[] = {
2303 HDA_CODEC_VOLUME("Capture Volume", 0x0c, 0x0, HDA_OUTPUT), 2303 HDA_CODEC_VOLUME("Capture Volume", 0x0c, 0x0, HDA_OUTPUT),
2304 HDA_CODEC_MUTE("Capture Switch", 0x0c, 0x0, HDA_OUTPUT), 2304 HDA_CODEC_MUTE("Capture Switch", 0x0c, 0x0, HDA_OUTPUT),
2305 HDA_CODEC_VOLUME_IDX("Capture Volume", 1, 0x0d, 0x0, HDA_OUTPUT), 2305 HDA_CODEC_VOLUME_IDX("Capture Volume", 1, 0x0d, 0x0, HDA_OUTPUT),
@@ -2324,7 +2324,7 @@ static struct snd_kcontrol_new ad1988_capture_mixers[] = {
2324static int ad1988_spdif_playback_source_info(struct snd_kcontrol *kcontrol, 2324static int ad1988_spdif_playback_source_info(struct snd_kcontrol *kcontrol,
2325 struct snd_ctl_elem_info *uinfo) 2325 struct snd_ctl_elem_info *uinfo)
2326{ 2326{
2327 static char *texts[] = { 2327 static const char * const texts[] = {
2328 "PCM", "ADC1", "ADC2", "ADC3" 2328 "PCM", "ADC1", "ADC2", "ADC3"
2329 }; 2329 };
2330 uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; 2330 uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
@@ -2405,7 +2405,7 @@ static int ad1988_spdif_playback_source_put(struct snd_kcontrol *kcontrol,
2405 return change; 2405 return change;
2406} 2406}
2407 2407
2408static struct snd_kcontrol_new ad1988_spdif_out_mixers[] = { 2408static const struct snd_kcontrol_new ad1988_spdif_out_mixers[] = {
2409 HDA_CODEC_VOLUME("IEC958 Playback Volume", 0x1b, 0x0, HDA_OUTPUT), 2409 HDA_CODEC_VOLUME("IEC958 Playback Volume", 0x1b, 0x0, HDA_OUTPUT),
2410 { 2410 {
2411 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 2411 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
@@ -2418,12 +2418,12 @@ static struct snd_kcontrol_new ad1988_spdif_out_mixers[] = {
2418 { } /* end */ 2418 { } /* end */
2419}; 2419};
2420 2420
2421static struct snd_kcontrol_new ad1988_spdif_in_mixers[] = { 2421static const struct snd_kcontrol_new ad1988_spdif_in_mixers[] = {
2422 HDA_CODEC_VOLUME("IEC958 Capture Volume", 0x1c, 0x0, HDA_INPUT), 2422 HDA_CODEC_VOLUME("IEC958 Capture Volume", 0x1c, 0x0, HDA_INPUT),
2423 { } /* end */ 2423 { } /* end */
2424}; 2424};
2425 2425
2426static struct snd_kcontrol_new ad1989_spdif_out_mixers[] = { 2426static const struct snd_kcontrol_new ad1989_spdif_out_mixers[] = {
2427 HDA_CODEC_VOLUME("IEC958 Playback Volume", 0x1b, 0x0, HDA_OUTPUT), 2427 HDA_CODEC_VOLUME("IEC958 Playback Volume", 0x1b, 0x0, HDA_OUTPUT),
2428 HDA_CODEC_VOLUME("HDMI Playback Volume", 0x1d, 0x0, HDA_OUTPUT), 2428 HDA_CODEC_VOLUME("HDMI Playback Volume", 0x1d, 0x0, HDA_OUTPUT),
2429 { } /* end */ 2429 { } /* end */
@@ -2436,7 +2436,7 @@ static struct snd_kcontrol_new ad1989_spdif_out_mixers[] = {
2436/* 2436/*
2437 * for 6-stack (+dig) 2437 * for 6-stack (+dig)
2438 */ 2438 */
2439static struct hda_verb ad1988_6stack_init_verbs[] = { 2439static const struct hda_verb ad1988_6stack_init_verbs[] = {
2440 /* Front, Surround, CLFE, side DAC; unmute as default */ 2440 /* Front, Surround, CLFE, side DAC; unmute as default */
2441 {0x04, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, 2441 {0x04, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
2442 {0x06, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, 2442 {0x06, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
@@ -2496,7 +2496,7 @@ static struct hda_verb ad1988_6stack_init_verbs[] = {
2496 { } 2496 { }
2497}; 2497};
2498 2498
2499static struct hda_verb ad1988_6stack_fp_init_verbs[] = { 2499static const struct hda_verb ad1988_6stack_fp_init_verbs[] = {
2500 /* Headphone; unmute as default */ 2500 /* Headphone; unmute as default */
2501 {0x03, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, 2501 {0x03, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
2502 /* Port-A front headphon path */ 2502 /* Port-A front headphon path */
@@ -2509,7 +2509,7 @@ static struct hda_verb ad1988_6stack_fp_init_verbs[] = {
2509 { } 2509 { }
2510}; 2510};
2511 2511
2512static struct hda_verb ad1988_capture_init_verbs[] = { 2512static const struct hda_verb ad1988_capture_init_verbs[] = {
2513 /* mute analog mix */ 2513 /* mute analog mix */
2514 {0x20, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, 2514 {0x20, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
2515 {0x20, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, 2515 {0x20, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
@@ -2527,7 +2527,7 @@ static struct hda_verb ad1988_capture_init_verbs[] = {
2527 { } 2527 { }
2528}; 2528};
2529 2529
2530static struct hda_verb ad1988_spdif_init_verbs[] = { 2530static const struct hda_verb ad1988_spdif_init_verbs[] = {
2531 /* SPDIF out sel */ 2531 /* SPDIF out sel */
2532 {0x02, AC_VERB_SET_CONNECT_SEL, 0x0}, /* PCM */ 2532 {0x02, AC_VERB_SET_CONNECT_SEL, 0x0}, /* PCM */
2533 {0x0b, AC_VERB_SET_CONNECT_SEL, 0x0}, /* ADC1 */ 2533 {0x0b, AC_VERB_SET_CONNECT_SEL, 0x0}, /* ADC1 */
@@ -2539,14 +2539,14 @@ static struct hda_verb ad1988_spdif_init_verbs[] = {
2539 { } 2539 { }
2540}; 2540};
2541 2541
2542static struct hda_verb ad1988_spdif_in_init_verbs[] = { 2542static const struct hda_verb ad1988_spdif_in_init_verbs[] = {
2543 /* unmute SPDIF input pin */ 2543 /* unmute SPDIF input pin */
2544 {0x1c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, 2544 {0x1c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
2545 { } 2545 { }
2546}; 2546};
2547 2547
2548/* AD1989 has no ADC -> SPDIF route */ 2548/* AD1989 has no ADC -> SPDIF route */
2549static struct hda_verb ad1989_spdif_init_verbs[] = { 2549static const struct hda_verb ad1989_spdif_init_verbs[] = {
2550 /* SPDIF-1 out pin */ 2550 /* SPDIF-1 out pin */
2551 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT }, 2551 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
2552 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE | 0x27}, /* 0dB */ 2552 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE | 0x27}, /* 0dB */
@@ -2559,7 +2559,7 @@ static struct hda_verb ad1989_spdif_init_verbs[] = {
2559/* 2559/*
2560 * verbs for 3stack (+dig) 2560 * verbs for 3stack (+dig)
2561 */ 2561 */
2562static struct hda_verb ad1988_3stack_ch2_init[] = { 2562static const struct hda_verb ad1988_3stack_ch2_init[] = {
2563 /* set port-C to line-in */ 2563 /* set port-C to line-in */
2564 { 0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE }, 2564 { 0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE },
2565 { 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN }, 2565 { 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN },
@@ -2569,7 +2569,7 @@ static struct hda_verb ad1988_3stack_ch2_init[] = {
2569 { } /* end */ 2569 { } /* end */
2570}; 2570};
2571 2571
2572static struct hda_verb ad1988_3stack_ch6_init[] = { 2572static const struct hda_verb ad1988_3stack_ch6_init[] = {
2573 /* set port-C to surround out */ 2573 /* set port-C to surround out */
2574 { 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT }, 2574 { 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
2575 { 0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE }, 2575 { 0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
@@ -2579,12 +2579,12 @@ static struct hda_verb ad1988_3stack_ch6_init[] = {
2579 { } /* end */ 2579 { } /* end */
2580}; 2580};
2581 2581
2582static struct hda_channel_mode ad1988_3stack_modes[2] = { 2582static const struct hda_channel_mode ad1988_3stack_modes[2] = {
2583 { 2, ad1988_3stack_ch2_init }, 2583 { 2, ad1988_3stack_ch2_init },
2584 { 6, ad1988_3stack_ch6_init }, 2584 { 6, ad1988_3stack_ch6_init },
2585}; 2585};
2586 2586
2587static struct hda_verb ad1988_3stack_init_verbs[] = { 2587static const struct hda_verb ad1988_3stack_init_verbs[] = {
2588 /* Front, Surround, CLFE, side DAC; unmute as default */ 2588 /* Front, Surround, CLFE, side DAC; unmute as default */
2589 {0x04, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, 2589 {0x04, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
2590 {0x06, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, 2590 {0x06, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
@@ -2644,13 +2644,13 @@ static struct hda_verb ad1988_3stack_init_verbs[] = {
2644/* 2644/*
2645 * verbs for laptop mode (+dig) 2645 * verbs for laptop mode (+dig)
2646 */ 2646 */
2647static struct hda_verb ad1988_laptop_hp_on[] = { 2647static const struct hda_verb ad1988_laptop_hp_on[] = {
2648 /* unmute port-A and mute port-D */ 2648 /* unmute port-A and mute port-D */
2649 { 0x11, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE }, 2649 { 0x11, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
2650 { 0x12, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE }, 2650 { 0x12, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE },
2651 { } /* end */ 2651 { } /* end */
2652}; 2652};
2653static struct hda_verb ad1988_laptop_hp_off[] = { 2653static const struct hda_verb ad1988_laptop_hp_off[] = {
2654 /* mute port-A and unmute port-D */ 2654 /* mute port-A and unmute port-D */
2655 { 0x11, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE }, 2655 { 0x11, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE },
2656 { 0x12, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE }, 2656 { 0x12, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
@@ -2659,7 +2659,7 @@ static struct hda_verb ad1988_laptop_hp_off[] = {
2659 2659
2660#define AD1988_HP_EVENT 0x01 2660#define AD1988_HP_EVENT 0x01
2661 2661
2662static struct hda_verb ad1988_laptop_init_verbs[] = { 2662static const struct hda_verb ad1988_laptop_init_verbs[] = {
2663 /* Front, Surround, CLFE, side DAC; unmute as default */ 2663 /* Front, Surround, CLFE, side DAC; unmute as default */
2664 {0x04, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, 2664 {0x04, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
2665 {0x06, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, 2665 {0x06, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
@@ -2723,7 +2723,7 @@ static void ad1988_laptop_unsol_event(struct hda_codec *codec, unsigned int res)
2723} 2723}
2724 2724
2725#ifdef CONFIG_SND_HDA_POWER_SAVE 2725#ifdef CONFIG_SND_HDA_POWER_SAVE
2726static struct hda_amp_list ad1988_loopbacks[] = { 2726static const struct hda_amp_list ad1988_loopbacks[] = {
2727 { 0x20, HDA_INPUT, 0 }, /* Front Mic */ 2727 { 0x20, HDA_INPUT, 0 }, /* Front Mic */
2728 { 0x20, HDA_INPUT, 1 }, /* Line */ 2728 { 0x20, HDA_INPUT, 1 }, /* Line */
2729 { 0x20, HDA_INPUT, 4 }, /* Mic */ 2729 { 0x20, HDA_INPUT, 4 }, /* Mic */
@@ -2741,7 +2741,7 @@ enum {
2741 AD_CTL_WIDGET_MUTE, 2741 AD_CTL_WIDGET_MUTE,
2742 AD_CTL_BIND_MUTE, 2742 AD_CTL_BIND_MUTE,
2743}; 2743};
2744static struct snd_kcontrol_new ad1988_control_templates[] = { 2744static const struct snd_kcontrol_new ad1988_control_templates[] = {
2745 HDA_CODEC_VOLUME(NULL, 0, 0, 0), 2745 HDA_CODEC_VOLUME(NULL, 0, 0, 0),
2746 HDA_CODEC_MUTE(NULL, 0, 0, 0), 2746 HDA_CODEC_MUTE(NULL, 0, 0, 0),
2747 HDA_BIND_MUTE(NULL, 0, 0, 0), 2747 HDA_BIND_MUTE(NULL, 0, 0, 0),
@@ -2770,18 +2770,18 @@ static int add_control(struct ad198x_spec *spec, int type, const char *name,
2770#define AD1988_PIN_CD_NID 0x18 2770#define AD1988_PIN_CD_NID 0x18
2771#define AD1988_PIN_BEEP_NID 0x10 2771#define AD1988_PIN_BEEP_NID 0x10
2772 2772
2773static hda_nid_t ad1988_mixer_nids[8] = { 2773static const hda_nid_t ad1988_mixer_nids[8] = {
2774 /* A B C D E F G H */ 2774 /* A B C D E F G H */
2775 0x22, 0x2b, 0x2c, 0x29, 0x26, 0x2a, 0x27, 0x28 2775 0x22, 0x2b, 0x2c, 0x29, 0x26, 0x2a, 0x27, 0x28
2776}; 2776};
2777 2777
2778static inline hda_nid_t ad1988_idx_to_dac(struct hda_codec *codec, int idx) 2778static inline hda_nid_t ad1988_idx_to_dac(struct hda_codec *codec, int idx)
2779{ 2779{
2780 static hda_nid_t idx_to_dac[8] = { 2780 static const hda_nid_t idx_to_dac[8] = {
2781 /* A B C D E F G H */ 2781 /* A B C D E F G H */
2782 0x04, 0x06, 0x05, 0x04, 0x0a, 0x06, 0x05, 0x0a 2782 0x04, 0x06, 0x05, 0x04, 0x0a, 0x06, 0x05, 0x0a
2783 }; 2783 };
2784 static hda_nid_t idx_to_dac_rev2[8] = { 2784 static const hda_nid_t idx_to_dac_rev2[8] = {
2785 /* A B C D E F G H */ 2785 /* A B C D E F G H */
2786 0x04, 0x05, 0x0a, 0x04, 0x06, 0x05, 0x0a, 0x06 2786 0x04, 0x05, 0x0a, 0x04, 0x06, 0x05, 0x0a, 0x06
2787 }; 2787 };
@@ -2791,13 +2791,13 @@ static inline hda_nid_t ad1988_idx_to_dac(struct hda_codec *codec, int idx)
2791 return idx_to_dac[idx]; 2791 return idx_to_dac[idx];
2792} 2792}
2793 2793
2794static hda_nid_t ad1988_boost_nids[8] = { 2794static const hda_nid_t ad1988_boost_nids[8] = {
2795 0x38, 0x39, 0x3a, 0x3d, 0x3c, 0x3b, 0, 0 2795 0x38, 0x39, 0x3a, 0x3d, 0x3c, 0x3b, 0, 0
2796}; 2796};
2797 2797
2798static int ad1988_pin_idx(hda_nid_t nid) 2798static int ad1988_pin_idx(hda_nid_t nid)
2799{ 2799{
2800 static hda_nid_t ad1988_io_pins[8] = { 2800 static const hda_nid_t ad1988_io_pins[8] = {
2801 0x11, 0x14, 0x15, 0x12, 0x17, 0x16, 0x24, 0x25 2801 0x11, 0x14, 0x15, 0x12, 0x17, 0x16, 0x24, 0x25
2802 }; 2802 };
2803 int i; 2803 int i;
@@ -2809,7 +2809,7 @@ static int ad1988_pin_idx(hda_nid_t nid)
2809 2809
2810static int ad1988_pin_to_loopback_idx(hda_nid_t nid) 2810static int ad1988_pin_to_loopback_idx(hda_nid_t nid)
2811{ 2811{
2812 static int loopback_idx[8] = { 2812 static const int loopback_idx[8] = {
2813 2, 0, 1, 3, 4, 5, 1, 4 2813 2, 0, 1, 3, 4, 5, 1, 4
2814 }; 2814 };
2815 switch (nid) { 2815 switch (nid) {
@@ -2822,7 +2822,7 @@ static int ad1988_pin_to_loopback_idx(hda_nid_t nid)
2822 2822
2823static int ad1988_pin_to_adc_idx(hda_nid_t nid) 2823static int ad1988_pin_to_adc_idx(hda_nid_t nid)
2824{ 2824{
2825 static int adc_idx[8] = { 2825 static const int adc_idx[8] = {
2826 0, 1, 2, 8, 4, 3, 6, 7 2826 0, 1, 2, 8, 4, 3, 6, 7
2827 }; 2827 };
2828 switch (nid) { 2828 switch (nid) {
@@ -3154,7 +3154,7 @@ static const char * const ad1988_models[AD1988_MODEL_LAST] = {
3154 [AD1988_AUTO] = "auto", 3154 [AD1988_AUTO] = "auto",
3155}; 3155};
3156 3156
3157static struct snd_pci_quirk ad1988_cfg_tbl[] = { 3157static const struct snd_pci_quirk ad1988_cfg_tbl[] = {
3158 SND_PCI_QUIRK(0x1043, 0x81ec, "Asus P5B-DLX", AD1988_6STACK_DIG), 3158 SND_PCI_QUIRK(0x1043, 0x81ec, "Asus P5B-DLX", AD1988_6STACK_DIG),
3159 SND_PCI_QUIRK(0x1043, 0x81f6, "Asus M2N-SLI", AD1988_6STACK_DIG), 3159 SND_PCI_QUIRK(0x1043, 0x81f6, "Asus M2N-SLI", AD1988_6STACK_DIG),
3160 SND_PCI_QUIRK(0x1043, 0x8277, "Asus P5K-E/WIFI-AP", AD1988_6STACK_DIG), 3160 SND_PCI_QUIRK(0x1043, 0x8277, "Asus P5K-E/WIFI-AP", AD1988_6STACK_DIG),
@@ -3342,21 +3342,21 @@ static int patch_ad1988(struct hda_codec *codec)
3342 * but no build-up framework is given, so far. 3342 * but no build-up framework is given, so far.
3343 */ 3343 */
3344 3344
3345static hda_nid_t ad1884_dac_nids[1] = { 3345static const hda_nid_t ad1884_dac_nids[1] = {
3346 0x04, 3346 0x04,
3347}; 3347};
3348 3348
3349static hda_nid_t ad1884_adc_nids[2] = { 3349static const hda_nid_t ad1884_adc_nids[2] = {
3350 0x08, 0x09, 3350 0x08, 0x09,
3351}; 3351};
3352 3352
3353static hda_nid_t ad1884_capsrc_nids[2] = { 3353static const hda_nid_t ad1884_capsrc_nids[2] = {
3354 0x0c, 0x0d, 3354 0x0c, 0x0d,
3355}; 3355};
3356 3356
3357#define AD1884_SPDIF_OUT 0x02 3357#define AD1884_SPDIF_OUT 0x02
3358 3358
3359static struct hda_input_mux ad1884_capture_source = { 3359static const struct hda_input_mux ad1884_capture_source = {
3360 .num_items = 4, 3360 .num_items = 4,
3361 .items = { 3361 .items = {
3362 { "Front Mic", 0x0 }, 3362 { "Front Mic", 0x0 },
@@ -3366,7 +3366,7 @@ static struct hda_input_mux ad1884_capture_source = {
3366 }, 3366 },
3367}; 3367};
3368 3368
3369static struct snd_kcontrol_new ad1884_base_mixers[] = { 3369static const struct snd_kcontrol_new ad1884_base_mixers[] = {
3370 HDA_CODEC_VOLUME("PCM Playback Volume", 0x04, 0x0, HDA_OUTPUT), 3370 HDA_CODEC_VOLUME("PCM Playback Volume", 0x04, 0x0, HDA_OUTPUT),
3371 /* HDA_CODEC_VOLUME_IDX("PCM Playback Volume", 1, 0x03, 0x0, HDA_OUTPUT), */ 3371 /* HDA_CODEC_VOLUME_IDX("PCM Playback Volume", 1, 0x03, 0x0, HDA_OUTPUT), */
3372 HDA_CODEC_MUTE("Headphone Playback Switch", 0x11, 0x0, HDA_OUTPUT), 3372 HDA_CODEC_MUTE("Headphone Playback Switch", 0x11, 0x0, HDA_OUTPUT),
@@ -3410,7 +3410,7 @@ static struct snd_kcontrol_new ad1884_base_mixers[] = {
3410 { } /* end */ 3410 { } /* end */
3411}; 3411};
3412 3412
3413static struct snd_kcontrol_new ad1984_dmic_mixers[] = { 3413static const struct snd_kcontrol_new ad1984_dmic_mixers[] = {
3414 HDA_CODEC_VOLUME("Digital Mic Capture Volume", 0x05, 0x0, HDA_INPUT), 3414 HDA_CODEC_VOLUME("Digital Mic Capture Volume", 0x05, 0x0, HDA_INPUT),
3415 HDA_CODEC_MUTE("Digital Mic Capture Switch", 0x05, 0x0, HDA_INPUT), 3415 HDA_CODEC_MUTE("Digital Mic Capture Switch", 0x05, 0x0, HDA_INPUT),
3416 HDA_CODEC_VOLUME_IDX("Digital Mic Capture Volume", 1, 0x06, 0x0, 3416 HDA_CODEC_VOLUME_IDX("Digital Mic Capture Volume", 1, 0x06, 0x0,
@@ -3423,7 +3423,7 @@ static struct snd_kcontrol_new ad1984_dmic_mixers[] = {
3423/* 3423/*
3424 * initialization verbs 3424 * initialization verbs
3425 */ 3425 */
3426static struct hda_verb ad1884_init_verbs[] = { 3426static const struct hda_verb ad1884_init_verbs[] = {
3427 /* DACs; mute as default */ 3427 /* DACs; mute as default */
3428 {0x03, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO}, 3428 {0x03, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
3429 {0x04, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO}, 3429 {0x04, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
@@ -3469,7 +3469,7 @@ static struct hda_verb ad1884_init_verbs[] = {
3469}; 3469};
3470 3470
3471#ifdef CONFIG_SND_HDA_POWER_SAVE 3471#ifdef CONFIG_SND_HDA_POWER_SAVE
3472static struct hda_amp_list ad1884_loopbacks[] = { 3472static const struct hda_amp_list ad1884_loopbacks[] = {
3473 { 0x20, HDA_INPUT, 0 }, /* Front Mic */ 3473 { 0x20, HDA_INPUT, 0 }, /* Front Mic */
3474 { 0x20, HDA_INPUT, 1 }, /* Mic */ 3474 { 0x20, HDA_INPUT, 1 }, /* Mic */
3475 { 0x20, HDA_INPUT, 2 }, /* CD */ 3475 { 0x20, HDA_INPUT, 2 }, /* CD */
@@ -3541,7 +3541,7 @@ static int patch_ad1884(struct hda_codec *codec)
3541/* 3541/*
3542 * Lenovo Thinkpad T61/X61 3542 * Lenovo Thinkpad T61/X61
3543 */ 3543 */
3544static struct hda_input_mux ad1984_thinkpad_capture_source = { 3544static const struct hda_input_mux ad1984_thinkpad_capture_source = {
3545 .num_items = 4, 3545 .num_items = 4,
3546 .items = { 3546 .items = {
3547 { "Mic", 0x0 }, 3547 { "Mic", 0x0 },
@@ -3555,7 +3555,7 @@ static struct hda_input_mux ad1984_thinkpad_capture_source = {
3555/* 3555/*
3556 * Dell Precision T3400 3556 * Dell Precision T3400
3557 */ 3557 */
3558static struct hda_input_mux ad1984_dell_desktop_capture_source = { 3558static const struct hda_input_mux ad1984_dell_desktop_capture_source = {
3559 .num_items = 3, 3559 .num_items = 3,
3560 .items = { 3560 .items = {
3561 { "Front Mic", 0x0 }, 3561 { "Front Mic", 0x0 },
@@ -3565,7 +3565,7 @@ static struct hda_input_mux ad1984_dell_desktop_capture_source = {
3565}; 3565};
3566 3566
3567 3567
3568static struct snd_kcontrol_new ad1984_thinkpad_mixers[] = { 3568static const struct snd_kcontrol_new ad1984_thinkpad_mixers[] = {
3569 HDA_CODEC_VOLUME("PCM Playback Volume", 0x04, 0x0, HDA_OUTPUT), 3569 HDA_CODEC_VOLUME("PCM Playback Volume", 0x04, 0x0, HDA_OUTPUT),
3570 /* HDA_CODEC_VOLUME_IDX("PCM Playback Volume", 1, 0x03, 0x0, HDA_OUTPUT), */ 3570 /* HDA_CODEC_VOLUME_IDX("PCM Playback Volume", 1, 0x03, 0x0, HDA_OUTPUT), */
3571 HDA_CODEC_MUTE("Headphone Playback Switch", 0x11, 0x0, HDA_OUTPUT), 3571 HDA_CODEC_MUTE("Headphone Playback Switch", 0x11, 0x0, HDA_OUTPUT),
@@ -3611,7 +3611,7 @@ static struct snd_kcontrol_new ad1984_thinkpad_mixers[] = {
3611}; 3611};
3612 3612
3613/* additional verbs */ 3613/* additional verbs */
3614static struct hda_verb ad1984_thinkpad_init_verbs[] = { 3614static const struct hda_verb ad1984_thinkpad_init_verbs[] = {
3615 /* Port-E (docking station mic) pin */ 3615 /* Port-E (docking station mic) pin */
3616 {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80}, 3616 {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
3617 {0x1c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, 3617 {0x1c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
@@ -3629,7 +3629,7 @@ static struct hda_verb ad1984_thinkpad_init_verbs[] = {
3629/* 3629/*
3630 * Dell Precision T3400 3630 * Dell Precision T3400
3631 */ 3631 */
3632static struct snd_kcontrol_new ad1984_dell_desktop_mixers[] = { 3632static const struct snd_kcontrol_new ad1984_dell_desktop_mixers[] = {
3633 HDA_CODEC_VOLUME("PCM Playback Volume", 0x04, 0x0, HDA_OUTPUT), 3633 HDA_CODEC_VOLUME("PCM Playback Volume", 0x04, 0x0, HDA_OUTPUT),
3634 HDA_CODEC_MUTE("Headphone Playback Switch", 0x11, 0x0, HDA_OUTPUT), 3634 HDA_CODEC_MUTE("Headphone Playback Switch", 0x11, 0x0, HDA_OUTPUT),
3635 HDA_CODEC_MUTE("Speaker Playback Switch", 0x12, 0x0, HDA_OUTPUT), 3635 HDA_CODEC_MUTE("Speaker Playback Switch", 0x12, 0x0, HDA_OUTPUT),
@@ -3680,7 +3680,7 @@ static int ad1984_pcm_dmic_cleanup(struct hda_pcm_stream *hinfo,
3680 return 0; 3680 return 0;
3681} 3681}
3682 3682
3683static struct hda_pcm_stream ad1984_pcm_dmic_capture = { 3683static const struct hda_pcm_stream ad1984_pcm_dmic_capture = {
3684 .substreams = 2, 3684 .substreams = 2,
3685 .channels_min = 2, 3685 .channels_min = 2,
3686 .channels_max = 2, 3686 .channels_max = 2,
@@ -3722,7 +3722,7 @@ static const char * const ad1984_models[AD1984_MODELS] = {
3722 [AD1984_DELL_DESKTOP] = "dell_desktop", 3722 [AD1984_DELL_DESKTOP] = "dell_desktop",
3723}; 3723};
3724 3724
3725static struct snd_pci_quirk ad1984_cfg_tbl[] = { 3725static const struct snd_pci_quirk ad1984_cfg_tbl[] = {
3726 /* Lenovo Thinkpad T61/X61 */ 3726 /* Lenovo Thinkpad T61/X61 */
3727 SND_PCI_QUIRK_VENDOR(0x17aa, "Lenovo Thinkpad", AD1984_THINKPAD), 3727 SND_PCI_QUIRK_VENDOR(0x17aa, "Lenovo Thinkpad", AD1984_THINKPAD),
3728 SND_PCI_QUIRK(0x1028, 0x0214, "Dell T3400", AD1984_DELL_DESKTOP), 3728 SND_PCI_QUIRK(0x1028, 0x0214, "Dell T3400", AD1984_DELL_DESKTOP),
@@ -3787,7 +3787,7 @@ static int patch_ad1984(struct hda_codec *codec)
3787 * We share the single DAC for both HP and line-outs (see AD1884/1984). 3787 * We share the single DAC for both HP and line-outs (see AD1884/1984).
3788 */ 3788 */
3789 3789
3790static hda_nid_t ad1884a_dac_nids[1] = { 3790static const hda_nid_t ad1884a_dac_nids[1] = {
3791 0x03, 3791 0x03,
3792}; 3792};
3793 3793
@@ -3796,7 +3796,7 @@ static hda_nid_t ad1884a_dac_nids[1] = {
3796 3796
3797#define AD1884A_SPDIF_OUT 0x02 3797#define AD1884A_SPDIF_OUT 0x02
3798 3798
3799static struct hda_input_mux ad1884a_capture_source = { 3799static const struct hda_input_mux ad1884a_capture_source = {
3800 .num_items = 5, 3800 .num_items = 5,
3801 .items = { 3801 .items = {
3802 { "Front Mic", 0x0 }, 3802 { "Front Mic", 0x0 },
@@ -3807,7 +3807,7 @@ static struct hda_input_mux ad1884a_capture_source = {
3807 }, 3807 },
3808}; 3808};
3809 3809
3810static struct snd_kcontrol_new ad1884a_base_mixers[] = { 3810static const struct snd_kcontrol_new ad1884a_base_mixers[] = {
3811 HDA_CODEC_VOLUME("Master Playback Volume", 0x21, 0x0, HDA_OUTPUT), 3811 HDA_CODEC_VOLUME("Master Playback Volume", 0x21, 0x0, HDA_OUTPUT),
3812 HDA_CODEC_MUTE("Master Playback Switch", 0x21, 0x0, HDA_OUTPUT), 3812 HDA_CODEC_MUTE("Master Playback Switch", 0x21, 0x0, HDA_OUTPUT),
3813 HDA_CODEC_MUTE("Headphone Playback Switch", 0x11, 0x0, HDA_OUTPUT), 3813 HDA_CODEC_MUTE("Headphone Playback Switch", 0x11, 0x0, HDA_OUTPUT),
@@ -3859,7 +3859,7 @@ static struct snd_kcontrol_new ad1884a_base_mixers[] = {
3859/* 3859/*
3860 * initialization verbs 3860 * initialization verbs
3861 */ 3861 */
3862static struct hda_verb ad1884a_init_verbs[] = { 3862static const struct hda_verb ad1884a_init_verbs[] = {
3863 /* DACs; unmute as default */ 3863 /* DACs; unmute as default */
3864 {0x03, AC_VERB_SET_AMP_GAIN_MUTE, 0x27}, /* 0dB */ 3864 {0x03, AC_VERB_SET_AMP_GAIN_MUTE, 0x27}, /* 0dB */
3865 {0x04, AC_VERB_SET_AMP_GAIN_MUTE, 0x27}, /* 0dB */ 3865 {0x04, AC_VERB_SET_AMP_GAIN_MUTE, 0x27}, /* 0dB */
@@ -3914,7 +3914,7 @@ static struct hda_verb ad1884a_init_verbs[] = {
3914}; 3914};
3915 3915
3916#ifdef CONFIG_SND_HDA_POWER_SAVE 3916#ifdef CONFIG_SND_HDA_POWER_SAVE
3917static struct hda_amp_list ad1884a_loopbacks[] = { 3917static const struct hda_amp_list ad1884a_loopbacks[] = {
3918 { 0x20, HDA_INPUT, 0 }, /* Front Mic */ 3918 { 0x20, HDA_INPUT, 0 }, /* Front Mic */
3919 { 0x20, HDA_INPUT, 1 }, /* Mic */ 3919 { 0x20, HDA_INPUT, 1 }, /* Mic */
3920 { 0x20, HDA_INPUT, 2 }, /* CD */ 3920 { 0x20, HDA_INPUT, 2 }, /* CD */
@@ -3947,7 +3947,7 @@ static int ad1884a_mobile_master_sw_put(struct snd_kcontrol *kcontrol,
3947 return ret; 3947 return ret;
3948} 3948}
3949 3949
3950static struct snd_kcontrol_new ad1884a_laptop_mixers[] = { 3950static const struct snd_kcontrol_new ad1884a_laptop_mixers[] = {
3951 HDA_CODEC_VOLUME("Master Playback Volume", 0x21, 0x0, HDA_OUTPUT), 3951 HDA_CODEC_VOLUME("Master Playback Volume", 0x21, 0x0, HDA_OUTPUT),
3952 { 3952 {
3953 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 3953 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
@@ -3975,7 +3975,7 @@ static struct snd_kcontrol_new ad1884a_laptop_mixers[] = {
3975 { } /* end */ 3975 { } /* end */
3976}; 3976};
3977 3977
3978static struct snd_kcontrol_new ad1884a_mobile_mixers[] = { 3978static const struct snd_kcontrol_new ad1884a_mobile_mixers[] = {
3979 HDA_CODEC_VOLUME("Master Playback Volume", 0x21, 0x0, HDA_OUTPUT), 3979 HDA_CODEC_VOLUME("Master Playback Volume", 0x21, 0x0, HDA_OUTPUT),
3980 /*HDA_CODEC_MUTE("Master Playback Switch", 0x21, 0x0, HDA_OUTPUT),*/ 3980 /*HDA_CODEC_MUTE("Master Playback Switch", 0x21, 0x0, HDA_OUTPUT),*/
3981 { 3981 {
@@ -4095,7 +4095,7 @@ static int ad1884a_laptop_init(struct hda_codec *codec)
4095} 4095}
4096 4096
4097/* additional verbs for laptop model */ 4097/* additional verbs for laptop model */
4098static struct hda_verb ad1884a_laptop_verbs[] = { 4098static const struct hda_verb ad1884a_laptop_verbs[] = {
4099 /* Port-A (HP) pin - always unmuted */ 4099 /* Port-A (HP) pin - always unmuted */
4100 {0x11, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, 4100 {0x11, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
4101 /* Port-F (int speaker) mixer - route only from analog mixer */ 4101 /* Port-F (int speaker) mixer - route only from analog mixer */
@@ -4126,7 +4126,7 @@ static struct hda_verb ad1884a_laptop_verbs[] = {
4126 { } /* end */ 4126 { } /* end */
4127}; 4127};
4128 4128
4129static struct hda_verb ad1884a_mobile_verbs[] = { 4129static const struct hda_verb ad1884a_mobile_verbs[] = {
4130 /* DACs; unmute as default */ 4130 /* DACs; unmute as default */
4131 {0x03, AC_VERB_SET_AMP_GAIN_MUTE, 0x27}, /* 0dB */ 4131 {0x03, AC_VERB_SET_AMP_GAIN_MUTE, 0x27}, /* 0dB */
4132 {0x04, AC_VERB_SET_AMP_GAIN_MUTE, 0x27}, /* 0dB */ 4132 {0x04, AC_VERB_SET_AMP_GAIN_MUTE, 0x27}, /* 0dB */
@@ -4181,7 +4181,7 @@ static struct hda_verb ad1884a_mobile_verbs[] = {
4181 * 0x17 - built-in mic 4181 * 0x17 - built-in mic
4182 */ 4182 */
4183 4183
4184static struct hda_verb ad1984a_thinkpad_verbs[] = { 4184static const struct hda_verb ad1984a_thinkpad_verbs[] = {
4185 /* HP unmute */ 4185 /* HP unmute */
4186 {0x11, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, 4186 {0x11, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
4187 /* analog mix */ 4187 /* analog mix */
@@ -4198,7 +4198,7 @@ static struct hda_verb ad1984a_thinkpad_verbs[] = {
4198 { } /* end */ 4198 { } /* end */
4199}; 4199};
4200 4200
4201static struct snd_kcontrol_new ad1984a_thinkpad_mixers[] = { 4201static const struct snd_kcontrol_new ad1984a_thinkpad_mixers[] = {
4202 HDA_CODEC_VOLUME("Master Playback Volume", 0x21, 0x0, HDA_OUTPUT), 4202 HDA_CODEC_VOLUME("Master Playback Volume", 0x21, 0x0, HDA_OUTPUT),
4203 HDA_CODEC_MUTE("Master Playback Switch", 0x21, 0x0, HDA_OUTPUT), 4203 HDA_CODEC_MUTE("Master Playback Switch", 0x21, 0x0, HDA_OUTPUT),
4204 HDA_CODEC_VOLUME("PCM Playback Volume", 0x20, 0x5, HDA_INPUT), 4204 HDA_CODEC_VOLUME("PCM Playback Volume", 0x20, 0x5, HDA_INPUT),
@@ -4219,7 +4219,7 @@ static struct snd_kcontrol_new ad1984a_thinkpad_mixers[] = {
4219 { } /* end */ 4219 { } /* end */
4220}; 4220};
4221 4221
4222static struct hda_input_mux ad1984a_thinkpad_capture_source = { 4222static const struct hda_input_mux ad1984a_thinkpad_capture_source = {
4223 .num_items = 3, 4223 .num_items = 3,
4224 .items = { 4224 .items = {
4225 { "Mic", 0x0 }, 4225 { "Mic", 0x0 },
@@ -4262,7 +4262,7 @@ static int ad1984a_thinkpad_init(struct hda_codec *codec)
4262 * 0x15 - mic-in 4262 * 0x15 - mic-in
4263 */ 4263 */
4264 4264
4265static struct hda_verb ad1984a_precision_verbs[] = { 4265static const struct hda_verb ad1984a_precision_verbs[] = {
4266 /* Unmute main output path */ 4266 /* Unmute main output path */
4267 {0x03, AC_VERB_SET_AMP_GAIN_MUTE, 0x27}, /* 0dB */ 4267 {0x03, AC_VERB_SET_AMP_GAIN_MUTE, 0x27}, /* 0dB */
4268 {0x21, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE + 0x1f}, /* 0dB */ 4268 {0x21, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE + 0x1f}, /* 0dB */
@@ -4288,7 +4288,7 @@ static struct hda_verb ad1984a_precision_verbs[] = {
4288 { } /* end */ 4288 { } /* end */
4289}; 4289};
4290 4290
4291static struct snd_kcontrol_new ad1984a_precision_mixers[] = { 4291static const struct snd_kcontrol_new ad1984a_precision_mixers[] = {
4292 HDA_CODEC_VOLUME("Master Playback Volume", 0x21, 0x0, HDA_OUTPUT), 4292 HDA_CODEC_VOLUME("Master Playback Volume", 0x21, 0x0, HDA_OUTPUT),
4293 HDA_CODEC_MUTE("Master Playback Switch", 0x21, 0x0, HDA_OUTPUT), 4293 HDA_CODEC_MUTE("Master Playback Switch", 0x21, 0x0, HDA_OUTPUT),
4294 HDA_CODEC_VOLUME("PCM Playback Volume", 0x20, 0x5, HDA_INPUT), 4294 HDA_CODEC_VOLUME("PCM Playback Volume", 0x20, 0x5, HDA_INPUT),
@@ -4344,7 +4344,7 @@ static int ad1984a_precision_init(struct hda_codec *codec)
4344 * digital-mic (0x17) - Internal mic 4344 * digital-mic (0x17) - Internal mic
4345 */ 4345 */
4346 4346
4347static struct hda_verb ad1984a_touchsmart_verbs[] = { 4347static const struct hda_verb ad1984a_touchsmart_verbs[] = {
4348 /* DACs; unmute as default */ 4348 /* DACs; unmute as default */
4349 {0x03, AC_VERB_SET_AMP_GAIN_MUTE, 0x27}, /* 0dB */ 4349 {0x03, AC_VERB_SET_AMP_GAIN_MUTE, 0x27}, /* 0dB */
4350 {0x04, AC_VERB_SET_AMP_GAIN_MUTE, 0x27}, /* 0dB */ 4350 {0x04, AC_VERB_SET_AMP_GAIN_MUTE, 0x27}, /* 0dB */
@@ -4396,7 +4396,7 @@ static struct hda_verb ad1984a_touchsmart_verbs[] = {
4396 { } /* end */ 4396 { } /* end */
4397}; 4397};
4398 4398
4399static struct snd_kcontrol_new ad1984a_touchsmart_mixers[] = { 4399static const struct snd_kcontrol_new ad1984a_touchsmart_mixers[] = {
4400 HDA_CODEC_VOLUME("Master Playback Volume", 0x21, 0x0, HDA_OUTPUT), 4400 HDA_CODEC_VOLUME("Master Playback Volume", 0x21, 0x0, HDA_OUTPUT),
4401/* HDA_CODEC_MUTE("Master Playback Switch", 0x21, 0x0, HDA_OUTPUT),*/ 4401/* HDA_CODEC_MUTE("Master Playback Switch", 0x21, 0x0, HDA_OUTPUT),*/
4402 { 4402 {
@@ -4475,7 +4475,7 @@ static const char * const ad1884a_models[AD1884A_MODELS] = {
4475 [AD1984A_PRECISION] = "precision", 4475 [AD1984A_PRECISION] = "precision",
4476}; 4476};
4477 4477
4478static struct snd_pci_quirk ad1884a_cfg_tbl[] = { 4478static const struct snd_pci_quirk ad1884a_cfg_tbl[] = {
4479 SND_PCI_QUIRK(0x1028, 0x04ac, "Precision R5500", AD1984A_PRECISION), 4479 SND_PCI_QUIRK(0x1028, 0x04ac, "Precision R5500", AD1984A_PRECISION),
4480 SND_PCI_QUIRK(0x103c, 0x3030, "HP", AD1884A_MOBILE), 4480 SND_PCI_QUIRK(0x103c, 0x3030, "HP", AD1884A_MOBILE),
4481 SND_PCI_QUIRK(0x103c, 0x3037, "HP 2230s", AD1884A_LAPTOP), 4481 SND_PCI_QUIRK(0x103c, 0x3037, "HP 2230s", AD1884A_LAPTOP),
@@ -4614,22 +4614,22 @@ static int patch_ad1884a(struct hda_codec *codec)
4614 * port-G - rear clfe-out (6stack) 4614 * port-G - rear clfe-out (6stack)
4615 */ 4615 */
4616 4616
4617static hda_nid_t ad1882_dac_nids[3] = { 4617static const hda_nid_t ad1882_dac_nids[3] = {
4618 0x04, 0x03, 0x05 4618 0x04, 0x03, 0x05
4619}; 4619};
4620 4620
4621static hda_nid_t ad1882_adc_nids[2] = { 4621static const hda_nid_t ad1882_adc_nids[2] = {
4622 0x08, 0x09, 4622 0x08, 0x09,
4623}; 4623};
4624 4624
4625static hda_nid_t ad1882_capsrc_nids[2] = { 4625static const hda_nid_t ad1882_capsrc_nids[2] = {
4626 0x0c, 0x0d, 4626 0x0c, 0x0d,
4627}; 4627};
4628 4628
4629#define AD1882_SPDIF_OUT 0x02 4629#define AD1882_SPDIF_OUT 0x02
4630 4630
4631/* list: 0x11, 0x39, 0x3a, 0x18, 0x3c, 0x3b, 0x12, 0x20 */ 4631/* list: 0x11, 0x39, 0x3a, 0x18, 0x3c, 0x3b, 0x12, 0x20 */
4632static struct hda_input_mux ad1882_capture_source = { 4632static const struct hda_input_mux ad1882_capture_source = {
4633 .num_items = 5, 4633 .num_items = 5,
4634 .items = { 4634 .items = {
4635 { "Front Mic", 0x1 }, 4635 { "Front Mic", 0x1 },
@@ -4641,7 +4641,7 @@ static struct hda_input_mux ad1882_capture_source = {
4641}; 4641};
4642 4642
4643/* list: 0x11, 0x39, 0x3a, 0x3c, 0x18, 0x1f, 0x12, 0x20 */ 4643/* list: 0x11, 0x39, 0x3a, 0x3c, 0x18, 0x1f, 0x12, 0x20 */
4644static struct hda_input_mux ad1882a_capture_source = { 4644static const struct hda_input_mux ad1882a_capture_source = {
4645 .num_items = 5, 4645 .num_items = 5,
4646 .items = { 4646 .items = {
4647 { "Front Mic", 0x1 }, 4647 { "Front Mic", 0x1 },
@@ -4652,7 +4652,7 @@ static struct hda_input_mux ad1882a_capture_source = {
4652 }, 4652 },
4653}; 4653};
4654 4654
4655static struct snd_kcontrol_new ad1882_base_mixers[] = { 4655static const struct snd_kcontrol_new ad1882_base_mixers[] = {
4656 HDA_CODEC_VOLUME("Front Playback Volume", 0x04, 0x0, HDA_OUTPUT), 4656 HDA_CODEC_VOLUME("Front Playback Volume", 0x04, 0x0, HDA_OUTPUT),
4657 HDA_CODEC_VOLUME("Surround Playback Volume", 0x03, 0x0, HDA_OUTPUT), 4657 HDA_CODEC_VOLUME("Surround Playback Volume", 0x03, 0x0, HDA_OUTPUT),
4658 HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x05, 1, 0x0, HDA_OUTPUT), 4658 HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x05, 1, 0x0, HDA_OUTPUT),
@@ -4694,7 +4694,7 @@ static struct snd_kcontrol_new ad1882_base_mixers[] = {
4694 { } /* end */ 4694 { } /* end */
4695}; 4695};
4696 4696
4697static struct snd_kcontrol_new ad1882_loopback_mixers[] = { 4697static const struct snd_kcontrol_new ad1882_loopback_mixers[] = {
4698 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x20, 0x00, HDA_INPUT), 4698 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x20, 0x00, HDA_INPUT),
4699 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x20, 0x00, HDA_INPUT), 4699 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x20, 0x00, HDA_INPUT),
4700 HDA_CODEC_VOLUME("Mic Playback Volume", 0x20, 0x01, HDA_INPUT), 4700 HDA_CODEC_VOLUME("Mic Playback Volume", 0x20, 0x01, HDA_INPUT),
@@ -4706,7 +4706,7 @@ static struct snd_kcontrol_new ad1882_loopback_mixers[] = {
4706 { } /* end */ 4706 { } /* end */
4707}; 4707};
4708 4708
4709static struct snd_kcontrol_new ad1882a_loopback_mixers[] = { 4709static const struct snd_kcontrol_new ad1882a_loopback_mixers[] = {
4710 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x20, 0x00, HDA_INPUT), 4710 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x20, 0x00, HDA_INPUT),
4711 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x20, 0x00, HDA_INPUT), 4711 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x20, 0x00, HDA_INPUT),
4712 HDA_CODEC_VOLUME("Mic Playback Volume", 0x20, 0x04, HDA_INPUT), 4712 HDA_CODEC_VOLUME("Mic Playback Volume", 0x20, 0x04, HDA_INPUT),
@@ -4719,7 +4719,7 @@ static struct snd_kcontrol_new ad1882a_loopback_mixers[] = {
4719 { } /* end */ 4719 { } /* end */
4720}; 4720};
4721 4721
4722static struct snd_kcontrol_new ad1882_3stack_mixers[] = { 4722static const struct snd_kcontrol_new ad1882_3stack_mixers[] = {
4723 HDA_CODEC_MUTE("Surround Playback Switch", 0x15, 0x0, HDA_OUTPUT), 4723 HDA_CODEC_MUTE("Surround Playback Switch", 0x15, 0x0, HDA_OUTPUT),
4724 HDA_CODEC_MUTE_MONO("Center Playback Switch", 0x17, 1, 0x0, HDA_OUTPUT), 4724 HDA_CODEC_MUTE_MONO("Center Playback Switch", 0x17, 1, 0x0, HDA_OUTPUT),
4725 HDA_CODEC_MUTE_MONO("LFE Playback Switch", 0x17, 2, 0x0, HDA_OUTPUT), 4725 HDA_CODEC_MUTE_MONO("LFE Playback Switch", 0x17, 2, 0x0, HDA_OUTPUT),
@@ -4733,14 +4733,14 @@ static struct snd_kcontrol_new ad1882_3stack_mixers[] = {
4733 { } /* end */ 4733 { } /* end */
4734}; 4734};
4735 4735
4736static struct snd_kcontrol_new ad1882_6stack_mixers[] = { 4736static const struct snd_kcontrol_new ad1882_6stack_mixers[] = {
4737 HDA_CODEC_MUTE("Surround Playback Switch", 0x16, 0x0, HDA_OUTPUT), 4737 HDA_CODEC_MUTE("Surround Playback Switch", 0x16, 0x0, HDA_OUTPUT),
4738 HDA_CODEC_MUTE_MONO("Center Playback Switch", 0x24, 1, 0x0, HDA_OUTPUT), 4738 HDA_CODEC_MUTE_MONO("Center Playback Switch", 0x24, 1, 0x0, HDA_OUTPUT),
4739 HDA_CODEC_MUTE_MONO("LFE Playback Switch", 0x24, 2, 0x0, HDA_OUTPUT), 4739 HDA_CODEC_MUTE_MONO("LFE Playback Switch", 0x24, 2, 0x0, HDA_OUTPUT),
4740 { } /* end */ 4740 { } /* end */
4741}; 4741};
4742 4742
4743static struct hda_verb ad1882_ch2_init[] = { 4743static const struct hda_verb ad1882_ch2_init[] = {
4744 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN}, 4744 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
4745 {0x2c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, 4745 {0x2c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
4746 {0x2c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, 4746 {0x2c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
@@ -4750,7 +4750,7 @@ static struct hda_verb ad1882_ch2_init[] = {
4750 { } /* end */ 4750 { } /* end */
4751}; 4751};
4752 4752
4753static struct hda_verb ad1882_ch4_init[] = { 4753static const struct hda_verb ad1882_ch4_init[] = {
4754 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT}, 4754 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
4755 {0x2c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, 4755 {0x2c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
4756 {0x2c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)}, 4756 {0x2c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
@@ -4760,7 +4760,7 @@ static struct hda_verb ad1882_ch4_init[] = {
4760 { } /* end */ 4760 { } /* end */
4761}; 4761};
4762 4762
4763static struct hda_verb ad1882_ch6_init[] = { 4763static const struct hda_verb ad1882_ch6_init[] = {
4764 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT}, 4764 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
4765 {0x2c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, 4765 {0x2c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
4766 {0x2c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)}, 4766 {0x2c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
@@ -4770,7 +4770,7 @@ static struct hda_verb ad1882_ch6_init[] = {
4770 { } /* end */ 4770 { } /* end */
4771}; 4771};
4772 4772
4773static struct hda_channel_mode ad1882_modes[3] = { 4773static const struct hda_channel_mode ad1882_modes[3] = {
4774 { 2, ad1882_ch2_init }, 4774 { 2, ad1882_ch2_init },
4775 { 4, ad1882_ch4_init }, 4775 { 4, ad1882_ch4_init },
4776 { 6, ad1882_ch6_init }, 4776 { 6, ad1882_ch6_init },
@@ -4779,7 +4779,7 @@ static struct hda_channel_mode ad1882_modes[3] = {
4779/* 4779/*
4780 * initialization verbs 4780 * initialization verbs
4781 */ 4781 */
4782static struct hda_verb ad1882_init_verbs[] = { 4782static const struct hda_verb ad1882_init_verbs[] = {
4783 /* DACs; mute as default */ 4783 /* DACs; mute as default */
4784 {0x03, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO}, 4784 {0x03, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
4785 {0x04, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO}, 4785 {0x04, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
@@ -4848,7 +4848,7 @@ static struct hda_verb ad1882_init_verbs[] = {
4848}; 4848};
4849 4849
4850#ifdef CONFIG_SND_HDA_POWER_SAVE 4850#ifdef CONFIG_SND_HDA_POWER_SAVE
4851static struct hda_amp_list ad1882_loopbacks[] = { 4851static const struct hda_amp_list ad1882_loopbacks[] = {
4852 { 0x20, HDA_INPUT, 0 }, /* Front Mic */ 4852 { 0x20, HDA_INPUT, 0 }, /* Front Mic */
4853 { 0x20, HDA_INPUT, 1 }, /* Mic */ 4853 { 0x20, HDA_INPUT, 1 }, /* Mic */
4854 { 0x20, HDA_INPUT, 4 }, /* Line */ 4854 { 0x20, HDA_INPUT, 4 }, /* Line */
@@ -4945,7 +4945,7 @@ static int patch_ad1882(struct hda_codec *codec)
4945/* 4945/*
4946 * patch entries 4946 * patch entries
4947 */ 4947 */
4948static struct hda_codec_preset snd_hda_preset_analog[] = { 4948static const struct hda_codec_preset snd_hda_preset_analog[] = {
4949 { .id = 0x11d4184a, .name = "AD1884A", .patch = patch_ad1884a }, 4949 { .id = 0x11d4184a, .name = "AD1884A", .patch = patch_ad1884a },
4950 { .id = 0x11d41882, .name = "AD1882", .patch = patch_ad1882 }, 4950 { .id = 0x11d41882, .name = "AD1882", .patch = patch_ad1882 },
4951 { .id = 0x11d41883, .name = "AD1883", .patch = patch_ad1884a }, 4951 { .id = 0x11d41883, .name = "AD1883", .patch = patch_ad1884a },