diff options
Diffstat (limited to 'sound/pci/hda/patch_analog.c')
-rw-r--r-- | sound/pci/hda/patch_analog.c | 345 |
1 files changed, 173 insertions, 172 deletions
diff --git a/sound/pci/hda/patch_analog.c b/sound/pci/hda/patch_analog.c index 2942d2a9ea1..f1b3875c57d 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 | ||
32 | struct ad198x_spec { | 32 | struct 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 */ |
185 | static struct snd_kcontrol_new ad_beep_mixer[] = { | 185 | static 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 | ||
191 | static struct snd_kcontrol_new ad_beep2_mixer[] = { | 191 | static 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 | ||
334 | static struct hda_pcm_stream ad198x_pcm_analog_alt_playback = { | 334 | static 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 | */ |
406 | static struct hda_pcm_stream ad198x_pcm_analog_playback = { | 406 | static 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 | ||
418 | static struct hda_pcm_stream ad198x_pcm_analog_capture = { | 418 | static 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 | ||
429 | static struct hda_pcm_stream ad198x_pcm_digital_playback = { | 429 | static 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 | ||
442 | static struct hda_pcm_stream ad198x_pcm_digital_capture = { | 442 | static 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, |
@@ -489,11 +489,6 @@ static int ad198x_build_pcms(struct hda_codec *codec) | |||
489 | return 0; | 489 | return 0; |
490 | } | 490 | } |
491 | 491 | ||
492 | static inline void ad198x_shutup(struct hda_codec *codec) | ||
493 | { | ||
494 | snd_hda_shutup_pins(codec); | ||
495 | } | ||
496 | |||
497 | static void ad198x_free_kctls(struct hda_codec *codec) | 492 | static void ad198x_free_kctls(struct hda_codec *codec) |
498 | { | 493 | { |
499 | struct ad198x_spec *spec = codec->spec; | 494 | struct ad198x_spec *spec = codec->spec; |
@@ -547,6 +542,12 @@ static void ad198x_power_eapd(struct hda_codec *codec) | |||
547 | } | 542 | } |
548 | } | 543 | } |
549 | 544 | ||
545 | static void ad198x_shutup(struct hda_codec *codec) | ||
546 | { | ||
547 | snd_hda_shutup_pins(codec); | ||
548 | ad198x_power_eapd(codec); | ||
549 | } | ||
550 | |||
550 | static void ad198x_free(struct hda_codec *codec) | 551 | static void ad198x_free(struct hda_codec *codec) |
551 | { | 552 | { |
552 | struct ad198x_spec *spec = codec->spec; | 553 | struct ad198x_spec *spec = codec->spec; |
@@ -564,12 +565,11 @@ static void ad198x_free(struct hda_codec *codec) | |||
564 | static int ad198x_suspend(struct hda_codec *codec, pm_message_t state) | 565 | static int ad198x_suspend(struct hda_codec *codec, pm_message_t state) |
565 | { | 566 | { |
566 | ad198x_shutup(codec); | 567 | ad198x_shutup(codec); |
567 | ad198x_power_eapd(codec); | ||
568 | return 0; | 568 | return 0; |
569 | } | 569 | } |
570 | #endif | 570 | #endif |
571 | 571 | ||
572 | static struct hda_codec_ops ad198x_patch_ops = { | 572 | static 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 | ||
642 | static hda_nid_t ad1986a_dac_nids[3] = { | 642 | static 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 | }; |
645 | static hda_nid_t ad1986a_adc_nids[1] = { AD1986A_ADC }; | 645 | static const hda_nid_t ad1986a_adc_nids[1] = { AD1986A_ADC }; |
646 | static hda_nid_t ad1986a_capsrc_nids[1] = { 0x12 }; | 646 | static const hda_nid_t ad1986a_capsrc_nids[1] = { 0x12 }; |
647 | 647 | ||
648 | static struct hda_input_mux ad1986a_capture_source = { | 648 | static 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 | ||
662 | static struct hda_bind_ctls ad1986a_bind_pcm_vol = { | 662 | static 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 | ||
672 | static struct hda_bind_ctls ad1986a_bind_pcm_sw = { | 672 | static 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 | */ |
685 | static struct snd_kcontrol_new ad1986a_mixers[] = { | 685 | static 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 */ |
726 | static struct snd_kcontrol_new ad1986a_3st_mixers[] = { | 726 | static 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 */ |
738 | static hda_nid_t ad1986a_laptop_dac_nids[1] = { AD1986A_FRONT_DAC }; | 738 | static 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 */ |
741 | static struct hda_bind_ctls ad1986a_laptop_master_vol = { | 741 | static 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 | ||
750 | static struct hda_bind_ctls ad1986a_laptop_master_sw = { | 750 | static 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 | ||
759 | static struct snd_kcontrol_new ad1986a_laptop_mixers[] = { | 759 | static 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 | ||
790 | static struct hda_input_mux ad1986a_laptop_eapd_capture_source = { | 790 | static 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 | ||
799 | static struct hda_input_mux ad1986a_automic_capture_source = { | 799 | static 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 | ||
807 | static struct snd_kcontrol_new ad1986a_laptop_master_mixers[] = { | 807 | static 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 | ||
813 | static struct snd_kcontrol_new ad1986a_laptop_eapd_mixers[] = { | 813 | static 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 | ||
840 | static struct snd_kcontrol_new ad1986a_laptop_intmic_mixers[] = { | 840 | static 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 | ||
934 | static struct snd_kcontrol_new ad1986a_automute_master_mixers[] = { | 934 | static 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 | */ |
952 | static struct hda_verb ad1986a_init_verbs[] = { | 952 | static 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 | ||
1007 | static struct hda_verb ad1986a_ch2_init[] = { | 1007 | static 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 | ||
1019 | static struct hda_verb ad1986a_ch4_init[] = { | 1019 | static 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 | ||
1029 | static struct hda_verb ad1986a_ch6_init[] = { | 1029 | static 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 | ||
1039 | static struct hda_channel_mode ad1986a_modes[3] = { | 1039 | static 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 */ |
1046 | static struct hda_verb ad1986a_eapd_init_verbs[] = { | 1046 | static 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 | ||
1051 | static struct hda_verb ad1986a_automic_verbs[] = { | 1051 | static 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 */ |
1061 | static struct hda_verb ad1986a_ultra_init[] = { | 1061 | static 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 */ |
1072 | static struct hda_verb ad1986a_hp_init_verbs[] = { | 1072 | static 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 | ||
1123 | static struct snd_pci_quirk ad1986a_cfg_tbl[] = { | 1123 | static 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 |
1155 | static struct hda_amp_list ad1986a_loopbacks[] = { | 1155 | static 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 | ||
1332 | static hda_nid_t ad1983_dac_nids[1] = { AD1983_DAC }; | 1332 | static const hda_nid_t ad1983_dac_nids[1] = { AD1983_DAC }; |
1333 | static hda_nid_t ad1983_adc_nids[1] = { AD1983_ADC }; | 1333 | static const hda_nid_t ad1983_adc_nids[1] = { AD1983_ADC }; |
1334 | static hda_nid_t ad1983_capsrc_nids[1] = { 0x15 }; | 1334 | static const hda_nid_t ad1983_capsrc_nids[1] = { 0x15 }; |
1335 | 1335 | ||
1336 | static struct hda_input_mux ad1983_capture_source = { | 1336 | static 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 | */ |
1349 | static int ad1983_spdif_route_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) | 1349 | static 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 | ||
1388 | static struct snd_kcontrol_new ad1983_mixers[] = { | 1388 | static 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 | ||
1421 | static struct hda_verb ad1983_init_verbs[] = { | 1421 | static 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 |
1461 | static struct hda_amp_list ad1983_loopbacks[] = { | 1461 | static 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 | ||
1521 | static hda_nid_t ad1981_dac_nids[1] = { AD1981_DAC }; | 1521 | static const hda_nid_t ad1981_dac_nids[1] = { AD1981_DAC }; |
1522 | static hda_nid_t ad1981_adc_nids[1] = { AD1981_ADC }; | 1522 | static const hda_nid_t ad1981_adc_nids[1] = { AD1981_ADC }; |
1523 | static hda_nid_t ad1981_capsrc_nids[1] = { 0x15 }; | 1523 | static 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 */ |
1526 | static struct hda_input_mux ad1981_capture_source = { | 1526 | static 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 | ||
1539 | static struct snd_kcontrol_new ad1981_mixers[] = { | 1539 | static 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 | ||
1580 | static struct hda_verb ad1981_init_verbs[] = { | 1580 | static 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 |
1628 | static struct hda_amp_list ad1981_loopbacks[] = { | 1628 | static 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 | ||
1648 | static struct hda_verb ad1981_hp_init_verbs[] = { | 1648 | static 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 */ |
1677 | static struct hda_bind_ctls ad1981_hp_bind_master_vol = { | 1677 | static 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 */ |
1697 | static void ad1981_hp_automic(struct hda_codec *codec) | 1697 | static 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 | ||
1733 | static struct hda_input_mux ad1981_hp_capture_source = { | 1733 | static 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 | ||
1742 | static struct snd_kcontrol_new ad1981_hp_mixers[] = { | 1742 | static 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 */ |
1793 | static struct hda_verb ad1981_toshiba_init_verbs[] = { | 1793 | static 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 | ||
1801 | static struct snd_kcontrol_new ad1981_toshiba_mixers[] = { | 1801 | static 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 */ |
1808 | static struct snd_kcontrol_new ad1981_thinkpad_mixers[] = { | 1808 | static 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 | ||
1838 | static struct hda_input_mux ad1981_thinkpad_capture_source = { | 1838 | static 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 | ||
1863 | static struct snd_pci_quirk ad1981_cfg_tbl[] = { | 1863 | static 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 | ||
2078 | static hda_nid_t ad1988_6stack_dac_nids[4] = { | 2078 | static const hda_nid_t ad1988_6stack_dac_nids[4] = { |
2079 | 0x04, 0x06, 0x05, 0x0a | 2079 | 0x04, 0x06, 0x05, 0x0a |
2080 | }; | 2080 | }; |
2081 | 2081 | ||
2082 | static hda_nid_t ad1988_3stack_dac_nids[3] = { | 2082 | static 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 */ |
2087 | static hda_nid_t ad1988_6stack_dac_nids_rev2[4] = { | 2087 | static const hda_nid_t ad1988_6stack_dac_nids_rev2[4] = { |
2088 | 0x04, 0x05, 0x0a, 0x06 | 2088 | 0x04, 0x05, 0x0a, 0x06 |
2089 | }; | 2089 | }; |
2090 | 2090 | ||
2091 | static hda_nid_t ad1988_alt_dac_nid[1] = { | 2091 | static const hda_nid_t ad1988_alt_dac_nid[1] = { |
2092 | 0x03 | 2092 | 0x03 |
2093 | }; | 2093 | }; |
2094 | 2094 | ||
2095 | static hda_nid_t ad1988_3stack_dac_nids_rev2[3] = { | 2095 | static const hda_nid_t ad1988_3stack_dac_nids_rev2[3] = { |
2096 | 0x04, 0x0a, 0x06 | 2096 | 0x04, 0x0a, 0x06 |
2097 | }; | 2097 | }; |
2098 | 2098 | ||
2099 | static hda_nid_t ad1988_adc_nids[3] = { | 2099 | static const hda_nid_t ad1988_adc_nids[3] = { |
2100 | 0x08, 0x09, 0x0f | 2100 | 0x08, 0x09, 0x0f |
2101 | }; | 2101 | }; |
2102 | 2102 | ||
2103 | static hda_nid_t ad1988_capsrc_nids[3] = { | 2103 | static 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 | ||
2111 | static hda_nid_t ad1989b_slave_dig_outs[] = { | 2111 | static 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 | ||
2115 | static struct hda_input_mux ad1988_6stack_capture_source = { | 2115 | static 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 | ||
2126 | static struct hda_input_mux ad1988_laptop_capture_source = { | 2126 | static 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 */ |
2169 | static struct snd_kcontrol_new ad1988_6stack_mixers1[] = { | 2169 | static 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 | ||
2178 | static struct snd_kcontrol_new ad1988_6stack_mixers1_rev2[] = { | 2178 | static 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 | ||
2187 | static struct snd_kcontrol_new ad1988_6stack_mixers2[] = { | 2187 | static 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 | ||
2214 | static struct snd_kcontrol_new ad1988_6stack_fp_mixers[] = { | 2214 | static 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 */ |
2221 | static struct snd_kcontrol_new ad1988_3stack_mixers1[] = { | 2221 | static 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 | ||
2229 | static struct snd_kcontrol_new ad1988_3stack_mixers1_rev2[] = { | 2229 | static 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 | ||
2237 | static struct snd_kcontrol_new ad1988_3stack_mixers2[] = { | 2237 | static 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 */ |
2271 | static struct snd_kcontrol_new ad1988_laptop_mixers[] = { | 2271 | static 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 */ |
2302 | static struct snd_kcontrol_new ad1988_capture_mixers[] = { | 2302 | static 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[] = { | |||
2324 | static int ad1988_spdif_playback_source_info(struct snd_kcontrol *kcontrol, | 2324 | static 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 | ||
2408 | static struct snd_kcontrol_new ad1988_spdif_out_mixers[] = { | 2408 | static 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 | ||
2421 | static struct snd_kcontrol_new ad1988_spdif_in_mixers[] = { | 2421 | static 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 | ||
2426 | static struct snd_kcontrol_new ad1989_spdif_out_mixers[] = { | 2426 | static 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 | */ |
2439 | static struct hda_verb ad1988_6stack_init_verbs[] = { | 2439 | static 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 | ||
2499 | static struct hda_verb ad1988_6stack_fp_init_verbs[] = { | 2499 | static 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 | ||
2512 | static struct hda_verb ad1988_capture_init_verbs[] = { | 2512 | static 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 | ||
2530 | static struct hda_verb ad1988_spdif_init_verbs[] = { | 2530 | static 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 | ||
2542 | static struct hda_verb ad1988_spdif_in_init_verbs[] = { | 2542 | static 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 */ |
2549 | static struct hda_verb ad1989_spdif_init_verbs[] = { | 2549 | static 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 | */ |
2562 | static struct hda_verb ad1988_3stack_ch2_init[] = { | 2562 | static 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 | ||
2572 | static struct hda_verb ad1988_3stack_ch6_init[] = { | 2572 | static 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 | ||
2582 | static struct hda_channel_mode ad1988_3stack_modes[2] = { | 2582 | static 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 | ||
2587 | static struct hda_verb ad1988_3stack_init_verbs[] = { | 2587 | static 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 | */ |
2647 | static struct hda_verb ad1988_laptop_hp_on[] = { | 2647 | static 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 | }; |
2653 | static struct hda_verb ad1988_laptop_hp_off[] = { | 2653 | static 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 | ||
2662 | static struct hda_verb ad1988_laptop_init_verbs[] = { | 2662 | static 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 |
2726 | static struct hda_amp_list ad1988_loopbacks[] = { | 2726 | static 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 | }; |
2744 | static struct snd_kcontrol_new ad1988_control_templates[] = { | 2744 | static 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 | ||
2773 | static hda_nid_t ad1988_mixer_nids[8] = { | 2773 | static 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 | ||
2778 | static inline hda_nid_t ad1988_idx_to_dac(struct hda_codec *codec, int idx) | 2778 | static 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 | ||
2794 | static hda_nid_t ad1988_boost_nids[8] = { | 2794 | static 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 | ||
2798 | static int ad1988_pin_idx(hda_nid_t nid) | 2798 | static 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 | ||
2810 | static int ad1988_pin_to_loopback_idx(hda_nid_t nid) | 2810 | static 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 | ||
2823 | static int ad1988_pin_to_adc_idx(hda_nid_t nid) | 2823 | static 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) { |
@@ -2845,7 +2845,7 @@ static int ad1988_auto_fill_dac_nids(struct hda_codec *codec, | |||
2845 | /* check the pins hardwired to audio widget */ | 2845 | /* check the pins hardwired to audio widget */ |
2846 | for (i = 0; i < cfg->line_outs; i++) { | 2846 | for (i = 0; i < cfg->line_outs; i++) { |
2847 | idx = ad1988_pin_idx(cfg->line_out_pins[i]); | 2847 | idx = ad1988_pin_idx(cfg->line_out_pins[i]); |
2848 | spec->multiout.dac_nids[i] = ad1988_idx_to_dac(codec, idx); | 2848 | spec->private_dac_nids[i] = ad1988_idx_to_dac(codec, idx); |
2849 | } | 2849 | } |
2850 | spec->multiout.num_dacs = cfg->line_outs; | 2850 | spec->multiout.num_dacs = cfg->line_outs; |
2851 | return 0; | 2851 | return 0; |
@@ -3070,6 +3070,7 @@ static void ad1988_auto_init_analog_input(struct hda_codec *codec) | |||
3070 | 3070 | ||
3071 | for (i = 0; i < cfg->num_inputs; i++) { | 3071 | for (i = 0; i < cfg->num_inputs; i++) { |
3072 | hda_nid_t nid = cfg->inputs[i].pin; | 3072 | hda_nid_t nid = cfg->inputs[i].pin; |
3073 | int type = cfg->inputs[i].type; | ||
3073 | switch (nid) { | 3074 | switch (nid) { |
3074 | case 0x15: /* port-C */ | 3075 | case 0x15: /* port-C */ |
3075 | snd_hda_codec_write(codec, 0x33, 0, AC_VERB_SET_CONNECT_SEL, 0x0); | 3076 | snd_hda_codec_write(codec, 0x33, 0, AC_VERB_SET_CONNECT_SEL, 0x0); |
@@ -3079,7 +3080,7 @@ static void ad1988_auto_init_analog_input(struct hda_codec *codec) | |||
3079 | break; | 3080 | break; |
3080 | } | 3081 | } |
3081 | snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, | 3082 | snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, |
3082 | i == AUTO_PIN_MIC ? PIN_VREF80 : PIN_IN); | 3083 | type == AUTO_PIN_MIC ? PIN_VREF80 : PIN_IN); |
3083 | if (nid != AD1988_PIN_CD_NID) | 3084 | if (nid != AD1988_PIN_CD_NID) |
3084 | snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_AMP_GAIN_MUTE, | 3085 | snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_AMP_GAIN_MUTE, |
3085 | AMP_OUT_MUTE); | 3086 | AMP_OUT_MUTE); |
@@ -3154,7 +3155,7 @@ static const char * const ad1988_models[AD1988_MODEL_LAST] = { | |||
3154 | [AD1988_AUTO] = "auto", | 3155 | [AD1988_AUTO] = "auto", |
3155 | }; | 3156 | }; |
3156 | 3157 | ||
3157 | static struct snd_pci_quirk ad1988_cfg_tbl[] = { | 3158 | static const struct snd_pci_quirk ad1988_cfg_tbl[] = { |
3158 | SND_PCI_QUIRK(0x1043, 0x81ec, "Asus P5B-DLX", AD1988_6STACK_DIG), | 3159 | SND_PCI_QUIRK(0x1043, 0x81ec, "Asus P5B-DLX", AD1988_6STACK_DIG), |
3159 | SND_PCI_QUIRK(0x1043, 0x81f6, "Asus M2N-SLI", AD1988_6STACK_DIG), | 3160 | 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), | 3161 | SND_PCI_QUIRK(0x1043, 0x8277, "Asus P5K-E/WIFI-AP", AD1988_6STACK_DIG), |
@@ -3342,21 +3343,21 @@ static int patch_ad1988(struct hda_codec *codec) | |||
3342 | * but no build-up framework is given, so far. | 3343 | * but no build-up framework is given, so far. |
3343 | */ | 3344 | */ |
3344 | 3345 | ||
3345 | static hda_nid_t ad1884_dac_nids[1] = { | 3346 | static const hda_nid_t ad1884_dac_nids[1] = { |
3346 | 0x04, | 3347 | 0x04, |
3347 | }; | 3348 | }; |
3348 | 3349 | ||
3349 | static hda_nid_t ad1884_adc_nids[2] = { | 3350 | static const hda_nid_t ad1884_adc_nids[2] = { |
3350 | 0x08, 0x09, | 3351 | 0x08, 0x09, |
3351 | }; | 3352 | }; |
3352 | 3353 | ||
3353 | static hda_nid_t ad1884_capsrc_nids[2] = { | 3354 | static const hda_nid_t ad1884_capsrc_nids[2] = { |
3354 | 0x0c, 0x0d, | 3355 | 0x0c, 0x0d, |
3355 | }; | 3356 | }; |
3356 | 3357 | ||
3357 | #define AD1884_SPDIF_OUT 0x02 | 3358 | #define AD1884_SPDIF_OUT 0x02 |
3358 | 3359 | ||
3359 | static struct hda_input_mux ad1884_capture_source = { | 3360 | static const struct hda_input_mux ad1884_capture_source = { |
3360 | .num_items = 4, | 3361 | .num_items = 4, |
3361 | .items = { | 3362 | .items = { |
3362 | { "Front Mic", 0x0 }, | 3363 | { "Front Mic", 0x0 }, |
@@ -3366,7 +3367,7 @@ static struct hda_input_mux ad1884_capture_source = { | |||
3366 | }, | 3367 | }, |
3367 | }; | 3368 | }; |
3368 | 3369 | ||
3369 | static struct snd_kcontrol_new ad1884_base_mixers[] = { | 3370 | static const struct snd_kcontrol_new ad1884_base_mixers[] = { |
3370 | HDA_CODEC_VOLUME("PCM Playback Volume", 0x04, 0x0, HDA_OUTPUT), | 3371 | HDA_CODEC_VOLUME("PCM Playback Volume", 0x04, 0x0, HDA_OUTPUT), |
3371 | /* HDA_CODEC_VOLUME_IDX("PCM Playback Volume", 1, 0x03, 0x0, HDA_OUTPUT), */ | 3372 | /* HDA_CODEC_VOLUME_IDX("PCM Playback Volume", 1, 0x03, 0x0, HDA_OUTPUT), */ |
3372 | HDA_CODEC_MUTE("Headphone Playback Switch", 0x11, 0x0, HDA_OUTPUT), | 3373 | HDA_CODEC_MUTE("Headphone Playback Switch", 0x11, 0x0, HDA_OUTPUT), |
@@ -3410,7 +3411,7 @@ static struct snd_kcontrol_new ad1884_base_mixers[] = { | |||
3410 | { } /* end */ | 3411 | { } /* end */ |
3411 | }; | 3412 | }; |
3412 | 3413 | ||
3413 | static struct snd_kcontrol_new ad1984_dmic_mixers[] = { | 3414 | static const struct snd_kcontrol_new ad1984_dmic_mixers[] = { |
3414 | HDA_CODEC_VOLUME("Digital Mic Capture Volume", 0x05, 0x0, HDA_INPUT), | 3415 | HDA_CODEC_VOLUME("Digital Mic Capture Volume", 0x05, 0x0, HDA_INPUT), |
3415 | HDA_CODEC_MUTE("Digital Mic Capture Switch", 0x05, 0x0, HDA_INPUT), | 3416 | HDA_CODEC_MUTE("Digital Mic Capture Switch", 0x05, 0x0, HDA_INPUT), |
3416 | HDA_CODEC_VOLUME_IDX("Digital Mic Capture Volume", 1, 0x06, 0x0, | 3417 | HDA_CODEC_VOLUME_IDX("Digital Mic Capture Volume", 1, 0x06, 0x0, |
@@ -3423,7 +3424,7 @@ static struct snd_kcontrol_new ad1984_dmic_mixers[] = { | |||
3423 | /* | 3424 | /* |
3424 | * initialization verbs | 3425 | * initialization verbs |
3425 | */ | 3426 | */ |
3426 | static struct hda_verb ad1884_init_verbs[] = { | 3427 | static const struct hda_verb ad1884_init_verbs[] = { |
3427 | /* DACs; mute as default */ | 3428 | /* DACs; mute as default */ |
3428 | {0x03, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO}, | 3429 | {0x03, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO}, |
3429 | {0x04, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO}, | 3430 | {0x04, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO}, |
@@ -3469,7 +3470,7 @@ static struct hda_verb ad1884_init_verbs[] = { | |||
3469 | }; | 3470 | }; |
3470 | 3471 | ||
3471 | #ifdef CONFIG_SND_HDA_POWER_SAVE | 3472 | #ifdef CONFIG_SND_HDA_POWER_SAVE |
3472 | static struct hda_amp_list ad1884_loopbacks[] = { | 3473 | static const struct hda_amp_list ad1884_loopbacks[] = { |
3473 | { 0x20, HDA_INPUT, 0 }, /* Front Mic */ | 3474 | { 0x20, HDA_INPUT, 0 }, /* Front Mic */ |
3474 | { 0x20, HDA_INPUT, 1 }, /* Mic */ | 3475 | { 0x20, HDA_INPUT, 1 }, /* Mic */ |
3475 | { 0x20, HDA_INPUT, 2 }, /* CD */ | 3476 | { 0x20, HDA_INPUT, 2 }, /* CD */ |
@@ -3541,7 +3542,7 @@ static int patch_ad1884(struct hda_codec *codec) | |||
3541 | /* | 3542 | /* |
3542 | * Lenovo Thinkpad T61/X61 | 3543 | * Lenovo Thinkpad T61/X61 |
3543 | */ | 3544 | */ |
3544 | static struct hda_input_mux ad1984_thinkpad_capture_source = { | 3545 | static const struct hda_input_mux ad1984_thinkpad_capture_source = { |
3545 | .num_items = 4, | 3546 | .num_items = 4, |
3546 | .items = { | 3547 | .items = { |
3547 | { "Mic", 0x0 }, | 3548 | { "Mic", 0x0 }, |
@@ -3555,7 +3556,7 @@ static struct hda_input_mux ad1984_thinkpad_capture_source = { | |||
3555 | /* | 3556 | /* |
3556 | * Dell Precision T3400 | 3557 | * Dell Precision T3400 |
3557 | */ | 3558 | */ |
3558 | static struct hda_input_mux ad1984_dell_desktop_capture_source = { | 3559 | static const struct hda_input_mux ad1984_dell_desktop_capture_source = { |
3559 | .num_items = 3, | 3560 | .num_items = 3, |
3560 | .items = { | 3561 | .items = { |
3561 | { "Front Mic", 0x0 }, | 3562 | { "Front Mic", 0x0 }, |
@@ -3565,7 +3566,7 @@ static struct hda_input_mux ad1984_dell_desktop_capture_source = { | |||
3565 | }; | 3566 | }; |
3566 | 3567 | ||
3567 | 3568 | ||
3568 | static struct snd_kcontrol_new ad1984_thinkpad_mixers[] = { | 3569 | static const struct snd_kcontrol_new ad1984_thinkpad_mixers[] = { |
3569 | HDA_CODEC_VOLUME("PCM Playback Volume", 0x04, 0x0, HDA_OUTPUT), | 3570 | HDA_CODEC_VOLUME("PCM Playback Volume", 0x04, 0x0, HDA_OUTPUT), |
3570 | /* HDA_CODEC_VOLUME_IDX("PCM Playback Volume", 1, 0x03, 0x0, HDA_OUTPUT), */ | 3571 | /* HDA_CODEC_VOLUME_IDX("PCM Playback Volume", 1, 0x03, 0x0, HDA_OUTPUT), */ |
3571 | HDA_CODEC_MUTE("Headphone Playback Switch", 0x11, 0x0, HDA_OUTPUT), | 3572 | HDA_CODEC_MUTE("Headphone Playback Switch", 0x11, 0x0, HDA_OUTPUT), |
@@ -3611,7 +3612,7 @@ static struct snd_kcontrol_new ad1984_thinkpad_mixers[] = { | |||
3611 | }; | 3612 | }; |
3612 | 3613 | ||
3613 | /* additional verbs */ | 3614 | /* additional verbs */ |
3614 | static struct hda_verb ad1984_thinkpad_init_verbs[] = { | 3615 | static const struct hda_verb ad1984_thinkpad_init_verbs[] = { |
3615 | /* Port-E (docking station mic) pin */ | 3616 | /* Port-E (docking station mic) pin */ |
3616 | {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80}, | 3617 | {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80}, |
3617 | {0x1c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, | 3618 | {0x1c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, |
@@ -3629,7 +3630,7 @@ static struct hda_verb ad1984_thinkpad_init_verbs[] = { | |||
3629 | /* | 3630 | /* |
3630 | * Dell Precision T3400 | 3631 | * Dell Precision T3400 |
3631 | */ | 3632 | */ |
3632 | static struct snd_kcontrol_new ad1984_dell_desktop_mixers[] = { | 3633 | static const struct snd_kcontrol_new ad1984_dell_desktop_mixers[] = { |
3633 | HDA_CODEC_VOLUME("PCM Playback Volume", 0x04, 0x0, HDA_OUTPUT), | 3634 | HDA_CODEC_VOLUME("PCM Playback Volume", 0x04, 0x0, HDA_OUTPUT), |
3634 | HDA_CODEC_MUTE("Headphone Playback Switch", 0x11, 0x0, HDA_OUTPUT), | 3635 | HDA_CODEC_MUTE("Headphone Playback Switch", 0x11, 0x0, HDA_OUTPUT), |
3635 | HDA_CODEC_MUTE("Speaker Playback Switch", 0x12, 0x0, HDA_OUTPUT), | 3636 | HDA_CODEC_MUTE("Speaker Playback Switch", 0x12, 0x0, HDA_OUTPUT), |
@@ -3680,7 +3681,7 @@ static int ad1984_pcm_dmic_cleanup(struct hda_pcm_stream *hinfo, | |||
3680 | return 0; | 3681 | return 0; |
3681 | } | 3682 | } |
3682 | 3683 | ||
3683 | static struct hda_pcm_stream ad1984_pcm_dmic_capture = { | 3684 | static const struct hda_pcm_stream ad1984_pcm_dmic_capture = { |
3684 | .substreams = 2, | 3685 | .substreams = 2, |
3685 | .channels_min = 2, | 3686 | .channels_min = 2, |
3686 | .channels_max = 2, | 3687 | .channels_max = 2, |
@@ -3722,7 +3723,7 @@ static const char * const ad1984_models[AD1984_MODELS] = { | |||
3722 | [AD1984_DELL_DESKTOP] = "dell_desktop", | 3723 | [AD1984_DELL_DESKTOP] = "dell_desktop", |
3723 | }; | 3724 | }; |
3724 | 3725 | ||
3725 | static struct snd_pci_quirk ad1984_cfg_tbl[] = { | 3726 | static const struct snd_pci_quirk ad1984_cfg_tbl[] = { |
3726 | /* Lenovo Thinkpad T61/X61 */ | 3727 | /* Lenovo Thinkpad T61/X61 */ |
3727 | SND_PCI_QUIRK_VENDOR(0x17aa, "Lenovo Thinkpad", AD1984_THINKPAD), | 3728 | SND_PCI_QUIRK_VENDOR(0x17aa, "Lenovo Thinkpad", AD1984_THINKPAD), |
3728 | SND_PCI_QUIRK(0x1028, 0x0214, "Dell T3400", AD1984_DELL_DESKTOP), | 3729 | SND_PCI_QUIRK(0x1028, 0x0214, "Dell T3400", AD1984_DELL_DESKTOP), |
@@ -3787,7 +3788,7 @@ static int patch_ad1984(struct hda_codec *codec) | |||
3787 | * We share the single DAC for both HP and line-outs (see AD1884/1984). | 3788 | * We share the single DAC for both HP and line-outs (see AD1884/1984). |
3788 | */ | 3789 | */ |
3789 | 3790 | ||
3790 | static hda_nid_t ad1884a_dac_nids[1] = { | 3791 | static const hda_nid_t ad1884a_dac_nids[1] = { |
3791 | 0x03, | 3792 | 0x03, |
3792 | }; | 3793 | }; |
3793 | 3794 | ||
@@ -3796,7 +3797,7 @@ static hda_nid_t ad1884a_dac_nids[1] = { | |||
3796 | 3797 | ||
3797 | #define AD1884A_SPDIF_OUT 0x02 | 3798 | #define AD1884A_SPDIF_OUT 0x02 |
3798 | 3799 | ||
3799 | static struct hda_input_mux ad1884a_capture_source = { | 3800 | static const struct hda_input_mux ad1884a_capture_source = { |
3800 | .num_items = 5, | 3801 | .num_items = 5, |
3801 | .items = { | 3802 | .items = { |
3802 | { "Front Mic", 0x0 }, | 3803 | { "Front Mic", 0x0 }, |
@@ -3807,7 +3808,7 @@ static struct hda_input_mux ad1884a_capture_source = { | |||
3807 | }, | 3808 | }, |
3808 | }; | 3809 | }; |
3809 | 3810 | ||
3810 | static struct snd_kcontrol_new ad1884a_base_mixers[] = { | 3811 | static const struct snd_kcontrol_new ad1884a_base_mixers[] = { |
3811 | HDA_CODEC_VOLUME("Master Playback Volume", 0x21, 0x0, HDA_OUTPUT), | 3812 | HDA_CODEC_VOLUME("Master Playback Volume", 0x21, 0x0, HDA_OUTPUT), |
3812 | HDA_CODEC_MUTE("Master Playback Switch", 0x21, 0x0, HDA_OUTPUT), | 3813 | HDA_CODEC_MUTE("Master Playback Switch", 0x21, 0x0, HDA_OUTPUT), |
3813 | HDA_CODEC_MUTE("Headphone Playback Switch", 0x11, 0x0, HDA_OUTPUT), | 3814 | HDA_CODEC_MUTE("Headphone Playback Switch", 0x11, 0x0, HDA_OUTPUT), |
@@ -3859,7 +3860,7 @@ static struct snd_kcontrol_new ad1884a_base_mixers[] = { | |||
3859 | /* | 3860 | /* |
3860 | * initialization verbs | 3861 | * initialization verbs |
3861 | */ | 3862 | */ |
3862 | static struct hda_verb ad1884a_init_verbs[] = { | 3863 | static const struct hda_verb ad1884a_init_verbs[] = { |
3863 | /* DACs; unmute as default */ | 3864 | /* DACs; unmute as default */ |
3864 | {0x03, AC_VERB_SET_AMP_GAIN_MUTE, 0x27}, /* 0dB */ | 3865 | {0x03, AC_VERB_SET_AMP_GAIN_MUTE, 0x27}, /* 0dB */ |
3865 | {0x04, AC_VERB_SET_AMP_GAIN_MUTE, 0x27}, /* 0dB */ | 3866 | {0x04, AC_VERB_SET_AMP_GAIN_MUTE, 0x27}, /* 0dB */ |
@@ -3914,7 +3915,7 @@ static struct hda_verb ad1884a_init_verbs[] = { | |||
3914 | }; | 3915 | }; |
3915 | 3916 | ||
3916 | #ifdef CONFIG_SND_HDA_POWER_SAVE | 3917 | #ifdef CONFIG_SND_HDA_POWER_SAVE |
3917 | static struct hda_amp_list ad1884a_loopbacks[] = { | 3918 | static const struct hda_amp_list ad1884a_loopbacks[] = { |
3918 | { 0x20, HDA_INPUT, 0 }, /* Front Mic */ | 3919 | { 0x20, HDA_INPUT, 0 }, /* Front Mic */ |
3919 | { 0x20, HDA_INPUT, 1 }, /* Mic */ | 3920 | { 0x20, HDA_INPUT, 1 }, /* Mic */ |
3920 | { 0x20, HDA_INPUT, 2 }, /* CD */ | 3921 | { 0x20, HDA_INPUT, 2 }, /* CD */ |
@@ -3947,7 +3948,7 @@ static int ad1884a_mobile_master_sw_put(struct snd_kcontrol *kcontrol, | |||
3947 | return ret; | 3948 | return ret; |
3948 | } | 3949 | } |
3949 | 3950 | ||
3950 | static struct snd_kcontrol_new ad1884a_laptop_mixers[] = { | 3951 | static const struct snd_kcontrol_new ad1884a_laptop_mixers[] = { |
3951 | HDA_CODEC_VOLUME("Master Playback Volume", 0x21, 0x0, HDA_OUTPUT), | 3952 | HDA_CODEC_VOLUME("Master Playback Volume", 0x21, 0x0, HDA_OUTPUT), |
3952 | { | 3953 | { |
3953 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | 3954 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
@@ -3975,7 +3976,7 @@ static struct snd_kcontrol_new ad1884a_laptop_mixers[] = { | |||
3975 | { } /* end */ | 3976 | { } /* end */ |
3976 | }; | 3977 | }; |
3977 | 3978 | ||
3978 | static struct snd_kcontrol_new ad1884a_mobile_mixers[] = { | 3979 | static const struct snd_kcontrol_new ad1884a_mobile_mixers[] = { |
3979 | HDA_CODEC_VOLUME("Master Playback Volume", 0x21, 0x0, HDA_OUTPUT), | 3980 | HDA_CODEC_VOLUME("Master Playback Volume", 0x21, 0x0, HDA_OUTPUT), |
3980 | /*HDA_CODEC_MUTE("Master Playback Switch", 0x21, 0x0, HDA_OUTPUT),*/ | 3981 | /*HDA_CODEC_MUTE("Master Playback Switch", 0x21, 0x0, HDA_OUTPUT),*/ |
3981 | { | 3982 | { |
@@ -4095,7 +4096,7 @@ static int ad1884a_laptop_init(struct hda_codec *codec) | |||
4095 | } | 4096 | } |
4096 | 4097 | ||
4097 | /* additional verbs for laptop model */ | 4098 | /* additional verbs for laptop model */ |
4098 | static struct hda_verb ad1884a_laptop_verbs[] = { | 4099 | static const struct hda_verb ad1884a_laptop_verbs[] = { |
4099 | /* Port-A (HP) pin - always unmuted */ | 4100 | /* Port-A (HP) pin - always unmuted */ |
4100 | {0x11, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, | 4101 | {0x11, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, |
4101 | /* Port-F (int speaker) mixer - route only from analog mixer */ | 4102 | /* Port-F (int speaker) mixer - route only from analog mixer */ |
@@ -4126,7 +4127,7 @@ static struct hda_verb ad1884a_laptop_verbs[] = { | |||
4126 | { } /* end */ | 4127 | { } /* end */ |
4127 | }; | 4128 | }; |
4128 | 4129 | ||
4129 | static struct hda_verb ad1884a_mobile_verbs[] = { | 4130 | static const struct hda_verb ad1884a_mobile_verbs[] = { |
4130 | /* DACs; unmute as default */ | 4131 | /* DACs; unmute as default */ |
4131 | {0x03, AC_VERB_SET_AMP_GAIN_MUTE, 0x27}, /* 0dB */ | 4132 | {0x03, AC_VERB_SET_AMP_GAIN_MUTE, 0x27}, /* 0dB */ |
4132 | {0x04, AC_VERB_SET_AMP_GAIN_MUTE, 0x27}, /* 0dB */ | 4133 | {0x04, AC_VERB_SET_AMP_GAIN_MUTE, 0x27}, /* 0dB */ |
@@ -4181,7 +4182,7 @@ static struct hda_verb ad1884a_mobile_verbs[] = { | |||
4181 | * 0x17 - built-in mic | 4182 | * 0x17 - built-in mic |
4182 | */ | 4183 | */ |
4183 | 4184 | ||
4184 | static struct hda_verb ad1984a_thinkpad_verbs[] = { | 4185 | static const struct hda_verb ad1984a_thinkpad_verbs[] = { |
4185 | /* HP unmute */ | 4186 | /* HP unmute */ |
4186 | {0x11, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, | 4187 | {0x11, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, |
4187 | /* analog mix */ | 4188 | /* analog mix */ |
@@ -4198,7 +4199,7 @@ static struct hda_verb ad1984a_thinkpad_verbs[] = { | |||
4198 | { } /* end */ | 4199 | { } /* end */ |
4199 | }; | 4200 | }; |
4200 | 4201 | ||
4201 | static struct snd_kcontrol_new ad1984a_thinkpad_mixers[] = { | 4202 | static const struct snd_kcontrol_new ad1984a_thinkpad_mixers[] = { |
4202 | HDA_CODEC_VOLUME("Master Playback Volume", 0x21, 0x0, HDA_OUTPUT), | 4203 | HDA_CODEC_VOLUME("Master Playback Volume", 0x21, 0x0, HDA_OUTPUT), |
4203 | HDA_CODEC_MUTE("Master Playback Switch", 0x21, 0x0, HDA_OUTPUT), | 4204 | HDA_CODEC_MUTE("Master Playback Switch", 0x21, 0x0, HDA_OUTPUT), |
4204 | HDA_CODEC_VOLUME("PCM Playback Volume", 0x20, 0x5, HDA_INPUT), | 4205 | HDA_CODEC_VOLUME("PCM Playback Volume", 0x20, 0x5, HDA_INPUT), |
@@ -4219,7 +4220,7 @@ static struct snd_kcontrol_new ad1984a_thinkpad_mixers[] = { | |||
4219 | { } /* end */ | 4220 | { } /* end */ |
4220 | }; | 4221 | }; |
4221 | 4222 | ||
4222 | static struct hda_input_mux ad1984a_thinkpad_capture_source = { | 4223 | static const struct hda_input_mux ad1984a_thinkpad_capture_source = { |
4223 | .num_items = 3, | 4224 | .num_items = 3, |
4224 | .items = { | 4225 | .items = { |
4225 | { "Mic", 0x0 }, | 4226 | { "Mic", 0x0 }, |
@@ -4262,7 +4263,7 @@ static int ad1984a_thinkpad_init(struct hda_codec *codec) | |||
4262 | * 0x15 - mic-in | 4263 | * 0x15 - mic-in |
4263 | */ | 4264 | */ |
4264 | 4265 | ||
4265 | static struct hda_verb ad1984a_precision_verbs[] = { | 4266 | static const struct hda_verb ad1984a_precision_verbs[] = { |
4266 | /* Unmute main output path */ | 4267 | /* Unmute main output path */ |
4267 | {0x03, AC_VERB_SET_AMP_GAIN_MUTE, 0x27}, /* 0dB */ | 4268 | {0x03, AC_VERB_SET_AMP_GAIN_MUTE, 0x27}, /* 0dB */ |
4268 | {0x21, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE + 0x1f}, /* 0dB */ | 4269 | {0x21, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE + 0x1f}, /* 0dB */ |
@@ -4288,7 +4289,7 @@ static struct hda_verb ad1984a_precision_verbs[] = { | |||
4288 | { } /* end */ | 4289 | { } /* end */ |
4289 | }; | 4290 | }; |
4290 | 4291 | ||
4291 | static struct snd_kcontrol_new ad1984a_precision_mixers[] = { | 4292 | static const struct snd_kcontrol_new ad1984a_precision_mixers[] = { |
4292 | HDA_CODEC_VOLUME("Master Playback Volume", 0x21, 0x0, HDA_OUTPUT), | 4293 | HDA_CODEC_VOLUME("Master Playback Volume", 0x21, 0x0, HDA_OUTPUT), |
4293 | HDA_CODEC_MUTE("Master Playback Switch", 0x21, 0x0, HDA_OUTPUT), | 4294 | HDA_CODEC_MUTE("Master Playback Switch", 0x21, 0x0, HDA_OUTPUT), |
4294 | HDA_CODEC_VOLUME("PCM Playback Volume", 0x20, 0x5, HDA_INPUT), | 4295 | HDA_CODEC_VOLUME("PCM Playback Volume", 0x20, 0x5, HDA_INPUT), |
@@ -4344,7 +4345,7 @@ static int ad1984a_precision_init(struct hda_codec *codec) | |||
4344 | * digital-mic (0x17) - Internal mic | 4345 | * digital-mic (0x17) - Internal mic |
4345 | */ | 4346 | */ |
4346 | 4347 | ||
4347 | static struct hda_verb ad1984a_touchsmart_verbs[] = { | 4348 | static const struct hda_verb ad1984a_touchsmart_verbs[] = { |
4348 | /* DACs; unmute as default */ | 4349 | /* DACs; unmute as default */ |
4349 | {0x03, AC_VERB_SET_AMP_GAIN_MUTE, 0x27}, /* 0dB */ | 4350 | {0x03, AC_VERB_SET_AMP_GAIN_MUTE, 0x27}, /* 0dB */ |
4350 | {0x04, AC_VERB_SET_AMP_GAIN_MUTE, 0x27}, /* 0dB */ | 4351 | {0x04, AC_VERB_SET_AMP_GAIN_MUTE, 0x27}, /* 0dB */ |
@@ -4396,7 +4397,7 @@ static struct hda_verb ad1984a_touchsmart_verbs[] = { | |||
4396 | { } /* end */ | 4397 | { } /* end */ |
4397 | }; | 4398 | }; |
4398 | 4399 | ||
4399 | static struct snd_kcontrol_new ad1984a_touchsmart_mixers[] = { | 4400 | static const struct snd_kcontrol_new ad1984a_touchsmart_mixers[] = { |
4400 | HDA_CODEC_VOLUME("Master Playback Volume", 0x21, 0x0, HDA_OUTPUT), | 4401 | HDA_CODEC_VOLUME("Master Playback Volume", 0x21, 0x0, HDA_OUTPUT), |
4401 | /* HDA_CODEC_MUTE("Master Playback Switch", 0x21, 0x0, HDA_OUTPUT),*/ | 4402 | /* HDA_CODEC_MUTE("Master Playback Switch", 0x21, 0x0, HDA_OUTPUT),*/ |
4402 | { | 4403 | { |
@@ -4475,7 +4476,7 @@ static const char * const ad1884a_models[AD1884A_MODELS] = { | |||
4475 | [AD1984A_PRECISION] = "precision", | 4476 | [AD1984A_PRECISION] = "precision", |
4476 | }; | 4477 | }; |
4477 | 4478 | ||
4478 | static struct snd_pci_quirk ad1884a_cfg_tbl[] = { | 4479 | static const struct snd_pci_quirk ad1884a_cfg_tbl[] = { |
4479 | SND_PCI_QUIRK(0x1028, 0x04ac, "Precision R5500", AD1984A_PRECISION), | 4480 | SND_PCI_QUIRK(0x1028, 0x04ac, "Precision R5500", AD1984A_PRECISION), |
4480 | SND_PCI_QUIRK(0x103c, 0x3030, "HP", AD1884A_MOBILE), | 4481 | SND_PCI_QUIRK(0x103c, 0x3030, "HP", AD1884A_MOBILE), |
4481 | SND_PCI_QUIRK(0x103c, 0x3037, "HP 2230s", AD1884A_LAPTOP), | 4482 | SND_PCI_QUIRK(0x103c, 0x3037, "HP 2230s", AD1884A_LAPTOP), |
@@ -4614,22 +4615,22 @@ static int patch_ad1884a(struct hda_codec *codec) | |||
4614 | * port-G - rear clfe-out (6stack) | 4615 | * port-G - rear clfe-out (6stack) |
4615 | */ | 4616 | */ |
4616 | 4617 | ||
4617 | static hda_nid_t ad1882_dac_nids[3] = { | 4618 | static const hda_nid_t ad1882_dac_nids[3] = { |
4618 | 0x04, 0x03, 0x05 | 4619 | 0x04, 0x03, 0x05 |
4619 | }; | 4620 | }; |
4620 | 4621 | ||
4621 | static hda_nid_t ad1882_adc_nids[2] = { | 4622 | static const hda_nid_t ad1882_adc_nids[2] = { |
4622 | 0x08, 0x09, | 4623 | 0x08, 0x09, |
4623 | }; | 4624 | }; |
4624 | 4625 | ||
4625 | static hda_nid_t ad1882_capsrc_nids[2] = { | 4626 | static const hda_nid_t ad1882_capsrc_nids[2] = { |
4626 | 0x0c, 0x0d, | 4627 | 0x0c, 0x0d, |
4627 | }; | 4628 | }; |
4628 | 4629 | ||
4629 | #define AD1882_SPDIF_OUT 0x02 | 4630 | #define AD1882_SPDIF_OUT 0x02 |
4630 | 4631 | ||
4631 | /* list: 0x11, 0x39, 0x3a, 0x18, 0x3c, 0x3b, 0x12, 0x20 */ | 4632 | /* list: 0x11, 0x39, 0x3a, 0x18, 0x3c, 0x3b, 0x12, 0x20 */ |
4632 | static struct hda_input_mux ad1882_capture_source = { | 4633 | static const struct hda_input_mux ad1882_capture_source = { |
4633 | .num_items = 5, | 4634 | .num_items = 5, |
4634 | .items = { | 4635 | .items = { |
4635 | { "Front Mic", 0x1 }, | 4636 | { "Front Mic", 0x1 }, |
@@ -4641,7 +4642,7 @@ static struct hda_input_mux ad1882_capture_source = { | |||
4641 | }; | 4642 | }; |
4642 | 4643 | ||
4643 | /* list: 0x11, 0x39, 0x3a, 0x3c, 0x18, 0x1f, 0x12, 0x20 */ | 4644 | /* list: 0x11, 0x39, 0x3a, 0x3c, 0x18, 0x1f, 0x12, 0x20 */ |
4644 | static struct hda_input_mux ad1882a_capture_source = { | 4645 | static const struct hda_input_mux ad1882a_capture_source = { |
4645 | .num_items = 5, | 4646 | .num_items = 5, |
4646 | .items = { | 4647 | .items = { |
4647 | { "Front Mic", 0x1 }, | 4648 | { "Front Mic", 0x1 }, |
@@ -4652,7 +4653,7 @@ static struct hda_input_mux ad1882a_capture_source = { | |||
4652 | }, | 4653 | }, |
4653 | }; | 4654 | }; |
4654 | 4655 | ||
4655 | static struct snd_kcontrol_new ad1882_base_mixers[] = { | 4656 | static const struct snd_kcontrol_new ad1882_base_mixers[] = { |
4656 | HDA_CODEC_VOLUME("Front Playback Volume", 0x04, 0x0, HDA_OUTPUT), | 4657 | HDA_CODEC_VOLUME("Front Playback Volume", 0x04, 0x0, HDA_OUTPUT), |
4657 | HDA_CODEC_VOLUME("Surround Playback Volume", 0x03, 0x0, HDA_OUTPUT), | 4658 | HDA_CODEC_VOLUME("Surround Playback Volume", 0x03, 0x0, HDA_OUTPUT), |
4658 | HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x05, 1, 0x0, HDA_OUTPUT), | 4659 | HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x05, 1, 0x0, HDA_OUTPUT), |
@@ -4694,7 +4695,7 @@ static struct snd_kcontrol_new ad1882_base_mixers[] = { | |||
4694 | { } /* end */ | 4695 | { } /* end */ |
4695 | }; | 4696 | }; |
4696 | 4697 | ||
4697 | static struct snd_kcontrol_new ad1882_loopback_mixers[] = { | 4698 | static const struct snd_kcontrol_new ad1882_loopback_mixers[] = { |
4698 | HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x20, 0x00, HDA_INPUT), | 4699 | HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x20, 0x00, HDA_INPUT), |
4699 | HDA_CODEC_MUTE("Front Mic Playback Switch", 0x20, 0x00, HDA_INPUT), | 4700 | HDA_CODEC_MUTE("Front Mic Playback Switch", 0x20, 0x00, HDA_INPUT), |
4700 | HDA_CODEC_VOLUME("Mic Playback Volume", 0x20, 0x01, HDA_INPUT), | 4701 | HDA_CODEC_VOLUME("Mic Playback Volume", 0x20, 0x01, HDA_INPUT), |
@@ -4706,7 +4707,7 @@ static struct snd_kcontrol_new ad1882_loopback_mixers[] = { | |||
4706 | { } /* end */ | 4707 | { } /* end */ |
4707 | }; | 4708 | }; |
4708 | 4709 | ||
4709 | static struct snd_kcontrol_new ad1882a_loopback_mixers[] = { | 4710 | static const struct snd_kcontrol_new ad1882a_loopback_mixers[] = { |
4710 | HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x20, 0x00, HDA_INPUT), | 4711 | HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x20, 0x00, HDA_INPUT), |
4711 | HDA_CODEC_MUTE("Front Mic Playback Switch", 0x20, 0x00, HDA_INPUT), | 4712 | HDA_CODEC_MUTE("Front Mic Playback Switch", 0x20, 0x00, HDA_INPUT), |
4712 | HDA_CODEC_VOLUME("Mic Playback Volume", 0x20, 0x04, HDA_INPUT), | 4713 | HDA_CODEC_VOLUME("Mic Playback Volume", 0x20, 0x04, HDA_INPUT), |
@@ -4719,7 +4720,7 @@ static struct snd_kcontrol_new ad1882a_loopback_mixers[] = { | |||
4719 | { } /* end */ | 4720 | { } /* end */ |
4720 | }; | 4721 | }; |
4721 | 4722 | ||
4722 | static struct snd_kcontrol_new ad1882_3stack_mixers[] = { | 4723 | static const struct snd_kcontrol_new ad1882_3stack_mixers[] = { |
4723 | HDA_CODEC_MUTE("Surround Playback Switch", 0x15, 0x0, HDA_OUTPUT), | 4724 | HDA_CODEC_MUTE("Surround Playback Switch", 0x15, 0x0, HDA_OUTPUT), |
4724 | HDA_CODEC_MUTE_MONO("Center Playback Switch", 0x17, 1, 0x0, HDA_OUTPUT), | 4725 | 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), | 4726 | HDA_CODEC_MUTE_MONO("LFE Playback Switch", 0x17, 2, 0x0, HDA_OUTPUT), |
@@ -4733,14 +4734,14 @@ static struct snd_kcontrol_new ad1882_3stack_mixers[] = { | |||
4733 | { } /* end */ | 4734 | { } /* end */ |
4734 | }; | 4735 | }; |
4735 | 4736 | ||
4736 | static struct snd_kcontrol_new ad1882_6stack_mixers[] = { | 4737 | static const struct snd_kcontrol_new ad1882_6stack_mixers[] = { |
4737 | HDA_CODEC_MUTE("Surround Playback Switch", 0x16, 0x0, HDA_OUTPUT), | 4738 | HDA_CODEC_MUTE("Surround Playback Switch", 0x16, 0x0, HDA_OUTPUT), |
4738 | HDA_CODEC_MUTE_MONO("Center Playback Switch", 0x24, 1, 0x0, HDA_OUTPUT), | 4739 | 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), | 4740 | HDA_CODEC_MUTE_MONO("LFE Playback Switch", 0x24, 2, 0x0, HDA_OUTPUT), |
4740 | { } /* end */ | 4741 | { } /* end */ |
4741 | }; | 4742 | }; |
4742 | 4743 | ||
4743 | static struct hda_verb ad1882_ch2_init[] = { | 4744 | static const struct hda_verb ad1882_ch2_init[] = { |
4744 | {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN}, | 4745 | {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN}, |
4745 | {0x2c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, | 4746 | {0x2c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, |
4746 | {0x2c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, | 4747 | {0x2c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, |
@@ -4750,7 +4751,7 @@ static struct hda_verb ad1882_ch2_init[] = { | |||
4750 | { } /* end */ | 4751 | { } /* end */ |
4751 | }; | 4752 | }; |
4752 | 4753 | ||
4753 | static struct hda_verb ad1882_ch4_init[] = { | 4754 | static const struct hda_verb ad1882_ch4_init[] = { |
4754 | {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT}, | 4755 | {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT}, |
4755 | {0x2c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, | 4756 | {0x2c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, |
4756 | {0x2c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)}, | 4757 | {0x2c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)}, |
@@ -4760,7 +4761,7 @@ static struct hda_verb ad1882_ch4_init[] = { | |||
4760 | { } /* end */ | 4761 | { } /* end */ |
4761 | }; | 4762 | }; |
4762 | 4763 | ||
4763 | static struct hda_verb ad1882_ch6_init[] = { | 4764 | static const struct hda_verb ad1882_ch6_init[] = { |
4764 | {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT}, | 4765 | {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT}, |
4765 | {0x2c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, | 4766 | {0x2c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, |
4766 | {0x2c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)}, | 4767 | {0x2c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)}, |
@@ -4770,7 +4771,7 @@ static struct hda_verb ad1882_ch6_init[] = { | |||
4770 | { } /* end */ | 4771 | { } /* end */ |
4771 | }; | 4772 | }; |
4772 | 4773 | ||
4773 | static struct hda_channel_mode ad1882_modes[3] = { | 4774 | static const struct hda_channel_mode ad1882_modes[3] = { |
4774 | { 2, ad1882_ch2_init }, | 4775 | { 2, ad1882_ch2_init }, |
4775 | { 4, ad1882_ch4_init }, | 4776 | { 4, ad1882_ch4_init }, |
4776 | { 6, ad1882_ch6_init }, | 4777 | { 6, ad1882_ch6_init }, |
@@ -4779,7 +4780,7 @@ static struct hda_channel_mode ad1882_modes[3] = { | |||
4779 | /* | 4780 | /* |
4780 | * initialization verbs | 4781 | * initialization verbs |
4781 | */ | 4782 | */ |
4782 | static struct hda_verb ad1882_init_verbs[] = { | 4783 | static const struct hda_verb ad1882_init_verbs[] = { |
4783 | /* DACs; mute as default */ | 4784 | /* DACs; mute as default */ |
4784 | {0x03, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO}, | 4785 | {0x03, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO}, |
4785 | {0x04, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO}, | 4786 | {0x04, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO}, |
@@ -4848,7 +4849,7 @@ static struct hda_verb ad1882_init_verbs[] = { | |||
4848 | }; | 4849 | }; |
4849 | 4850 | ||
4850 | #ifdef CONFIG_SND_HDA_POWER_SAVE | 4851 | #ifdef CONFIG_SND_HDA_POWER_SAVE |
4851 | static struct hda_amp_list ad1882_loopbacks[] = { | 4852 | static const struct hda_amp_list ad1882_loopbacks[] = { |
4852 | { 0x20, HDA_INPUT, 0 }, /* Front Mic */ | 4853 | { 0x20, HDA_INPUT, 0 }, /* Front Mic */ |
4853 | { 0x20, HDA_INPUT, 1 }, /* Mic */ | 4854 | { 0x20, HDA_INPUT, 1 }, /* Mic */ |
4854 | { 0x20, HDA_INPUT, 4 }, /* Line */ | 4855 | { 0x20, HDA_INPUT, 4 }, /* Line */ |
@@ -4945,7 +4946,7 @@ static int patch_ad1882(struct hda_codec *codec) | |||
4945 | /* | 4946 | /* |
4946 | * patch entries | 4947 | * patch entries |
4947 | */ | 4948 | */ |
4948 | static struct hda_codec_preset snd_hda_preset_analog[] = { | 4949 | static const struct hda_codec_preset snd_hda_preset_analog[] = { |
4949 | { .id = 0x11d4184a, .name = "AD1884A", .patch = patch_ad1884a }, | 4950 | { .id = 0x11d4184a, .name = "AD1884A", .patch = patch_ad1884a }, |
4950 | { .id = 0x11d41882, .name = "AD1882", .patch = patch_ad1882 }, | 4951 | { .id = 0x11d41882, .name = "AD1882", .patch = patch_ad1882 }, |
4951 | { .id = 0x11d41883, .name = "AD1883", .patch = patch_ad1884a }, | 4952 | { .id = 0x11d41883, .name = "AD1883", .patch = patch_ad1884a }, |