Lines Matching +full:gen +full:- +full:2

1 // SPDX-License-Identifier: GPL-2.0-or-later
6 * Copyright (c) 2005-2007 Takashi Iwai <tiwai@suse.de>
23 struct hda_gen_spec gen; member
44 ((spec)->beep_amp = HDA_COMPOSE_AMP_VAL(nid, 1, idx, dir)) /* mono */
52 struct ad198x_spec *spec = codec->spec; in create_beep_ctls()
55 if (!spec->beep_amp) in create_beep_ctls()
58 for (knew = ad_beep_mixer ; knew->name; knew++) { in create_beep_ctls()
63 return -ENOMEM; in create_beep_ctls()
64 kctl->private_value = spec->beep_amp; in create_beep_ctls()
81 !codec->inv_eapd ? 0x00 : 0x02); in ad198x_power_eapd_write()
84 !codec->inv_eapd ? 0x00 : 0x02); in ad198x_power_eapd_write()
90 switch (codec->core.vendor_id) { in ad198x_power_eapd()
133 struct ad198x_spec *spec = codec->spec; in ad_vmaster_eapd_hook()
135 if (!spec->eapd_nid) in ad_vmaster_eapd_hook()
137 if (codec->inv_eapd) in ad_vmaster_eapd_hook()
139 snd_hda_codec_write_cache(codec, spec->eapd_nid, 0, in ad_vmaster_eapd_hook()
177 struct ad198x_spec *spec = codec->spec; in ad198x_parse_auto_config()
178 struct auto_pin_cfg *cfg = &spec->gen.autocfg; in ad198x_parse_auto_config()
181 codec->spdif_status_reset = 1; in ad198x_parse_auto_config()
182 codec->no_trigger_sense = 1; in ad198x_parse_auto_config()
183 codec->no_sticky_stream = 1; in ad198x_parse_auto_config()
185 spec->gen.indep_hp = indep_hp; in ad198x_parse_auto_config()
186 if (!spec->gen.add_stereo_mix_input) in ad198x_parse_auto_config()
187 spec->gen.add_stereo_mix_input = HDA_HINT_STEREO_MIX_AUTO; in ad198x_parse_auto_config()
209 return -ENOMEM; in alloc_ad_spec()
210 codec->spec = spec; in alloc_ad_spec()
211 snd_hda_gen_spec_init(&spec->gen); in alloc_ad_spec()
212 codec->patch_ops = ad198x_auto_patch_ops; in alloc_ad_spec()
220 /* Lenovo N100 seems to report the reversed bit for HP jack-sensing */
224 struct ad198x_spec *spec = codec->spec; in ad_fixup_inv_jack_detect()
227 codec->inv_jack_detect = 1; in ad_fixup_inv_jack_detect()
228 spec->gen.keep_eapd_on = 1; in ad_fixup_inv_jack_detect()
229 spec->gen.vmaster_mute.hook = ad_vmaster_eapd_hook; in ad_fixup_inv_jack_detect()
230 spec->eapd_nid = 0x1b; in ad_fixup_inv_jack_detect()
238 struct ad198x_spec *spec = codec->spec; in ad1986a_fixup_eapd()
241 codec->inv_eapd = 0; in ad1986a_fixup_eapd()
242 spec->gen.keep_eapd_on = 1; in ad1986a_fixup_eapd()
243 spec->eapd_nid = 0x1b; in ad1986a_fixup_eapd()
247 /* enable stereo-mix input for avoiding regression on KDE (bko#88251) */
251 struct ad198x_spec *spec = codec->spec; in ad1986a_fixup_eapd_mix_in()
255 spec->gen.add_stereo_mix_input = HDA_HINT_STEREO_MIX_ENABLE; in ad1986a_fixup_eapd_mix_in()
299 { 0x1c, 0x01813030 }, /* line-in */
366 SND_PCI_QUIRK(0x10de, 0xcb84, "ASUS A8N-VM", AD1986A_FIXUP_3STACK),
381 { .id = AD1986A_FIXUP_LAPTOP_IMIC, .name = "laptop-imic" },
382 { .id = AD1986A_FIXUP_LAPTOP_IMIC, .name = "laptop-eapd" }, /* alias */
405 spec = codec->spec; in patch_ad1986a()
408 codec->inv_eapd = 1; in patch_ad1986a()
410 spec->gen.mixer_nid = 0x07; in patch_ad1986a()
411 spec->gen.beep_nid = 0x19; in patch_ad1986a()
420 spec->gen.multiout.no_share_stream = 1; in patch_ad1986a()
422 spec->gen.preferred_dacs = preferred_pairs; in patch_ad1986a()
425 spec->gen.auto_mute_via_amp = 1; in patch_ad1986a()
448 * SPDIF mux control for AD1983 auto-parser
454 struct ad198x_spec *spec = codec->spec; in ad1983_auto_smux_enum_info()
457 int num_conns = spec->num_smux_conns; in ad1983_auto_smux_enum_info()
459 if (num_conns == 2) in ad1983_auto_smux_enum_info()
460 return snd_hda_enum_helper_info(kcontrol, uinfo, 2, texts2); in ad1983_auto_smux_enum_info()
464 return -EINVAL; in ad1983_auto_smux_enum_info()
471 struct ad198x_spec *spec = codec->spec; in ad1983_auto_smux_enum_get()
473 ucontrol->value.enumerated.item[0] = spec->cur_smux; in ad1983_auto_smux_enum_get()
481 struct ad198x_spec *spec = codec->spec; in ad1983_auto_smux_enum_put()
482 unsigned int val = ucontrol->value.enumerated.item[0]; in ad1983_auto_smux_enum_put()
483 hda_nid_t dig_out = spec->gen.multiout.dig_out_nid; in ad1983_auto_smux_enum_put()
484 int num_conns = spec->num_smux_conns; in ad1983_auto_smux_enum_put()
487 return -EINVAL; in ad1983_auto_smux_enum_put()
488 if (spec->cur_smux == val) in ad1983_auto_smux_enum_put()
490 spec->cur_smux = val; in ad1983_auto_smux_enum_put()
506 struct ad198x_spec *spec = codec->spec; in ad1983_add_spdif_mux_ctl()
507 hda_nid_t dig_out = spec->gen.multiout.dig_out_nid; in ad1983_add_spdif_mux_ctl()
513 if (num_conns != 2 && num_conns != 3) in ad1983_add_spdif_mux_ctl()
515 spec->num_smux_conns = num_conns; in ad1983_add_spdif_mux_ctl()
516 if (!snd_hda_gen_add_kctl(&spec->gen, NULL, &ad1983_auto_smux_mixer)) in ad1983_add_spdif_mux_ctl()
517 return -ENOMEM; in ad1983_add_spdif_mux_ctl()
531 spec = codec->spec; in patch_ad1983()
533 spec->gen.mixer_nid = 0x0e; in patch_ad1983()
534 spec->gen.beep_nid = 0x10; in patch_ad1983()
562 struct ad198x_spec *spec = codec->spec; in ad1981_fixup_hp_eapd()
565 spec->gen.vmaster_mute.hook = ad_vmaster_eapd_hook; in ad1981_fixup_hp_eapd()
566 spec->eapd_nid = 0x05; in ad1981_fixup_hp_eapd()
570 /* set the upper-limit for mixer amp to 0dB for avoiding the possible
618 return -ENOMEM; in patch_ad1981()
619 spec = codec->spec; in patch_ad1981()
621 spec->gen.mixer_nid = 0x0e; in patch_ad1981()
622 spec->gen.beep_nid = 0x10; in patch_ad1981()
651 * port-A 0x11 (mute/hp) <- 0x22 <- 0x37 <- 03/04/06
652 * port-B 0x14 (mute/hp) <- 0x2b <- 0x30 <- 03/04/06
653 * port-C 0x15 (mute) <- 0x2c <- 0x31 <- 05/0a
654 * port-D 0x12 (mute/hp) <- 0x29 <- 04
655 * port-E 0x17 (mute/hp) <- 0x26 <- 0x32 <- 05/0a
656 * port-F 0x16 (mute) <- 0x2a <- 06
657 * port-G 0x24 (mute) <- 0x27 <- 05
658 * port-H 0x25 (mute) <- 0x28 <- 0a
659 * mono 0x13 (mute/amp)<- 0x1e <- 0x36 <- 03/04/06
662 * (*) DAC2/3/4 are swapped to DAC3/4/2 on AD198A rev.2 due to a h/w bug.
667 * port-A 0x11 -> 0x38 -> mix 2, ADC 0
668 * port-B 0x14 -> 0x39 -> mix 0, ADC 1
669 * port-C 0x15 -> 0x3a -> 33:0 - mix 1, ADC 2
670 * port-D 0x12 -> 0x3d -> mix 3, ADC 8
671 * port-E 0x17 -> 0x3c -> 34:0 - mix 4, ADC 4
672 * port-F 0x16 -> 0x3b -> mix 5, ADC 3
673 * port-G 0x24 -> N/A -> 33:1 - mix 1, 34:1 - mix 4, ADC 6
674 * port-H 0x25 -> N/A -> 33:2 - mix 1, 34:2 - mix 4, ADC 7
678 * 6stack - front/surr/CLFE/side/opt DACs - 04/06/05/0a/03
679 * 3stack - front/surr/CLFE/opt DACs - 04/05/0a/03
682 * 0:Port-B (front mic)
683 * 1:Port-C/G/H (line-in)
684 * 2:Port-A
685 * 3:Port-D (line-in/2)
686 * 4:Port-E/G/H (mic-in)
687 * 5:Port-F (mic2-in)
692 * 0:Port-A
693 * 1:Port-B (front mic-in)
694 * 2:Port-C (line-in)
695 * 3:Port-F (mic2-in)
696 * 4:Port-E (mic-in)
698 * 6:Port-G
699 * 7:Port-H
700 * 8:Port-D (line-in/2)
705 * 6-stack
706 * Port-A front headphone
707 * B front mic-in
708 * C rear line-in
709 * D rear front-out
710 * E rear mic-in
715 * 3-stack
716 * Port-A front headphone
718 * C rear line-in/surround
719 * D rear front-out
720 * E rear mic-in/CLFE
723 * Port-A headphone
724 * B mic-in
734 struct ad198x_spec *spec = codec->spec; in ad1988_auto_smux_enum_info()
738 int num_conns = spec->num_smux_conns; in ad1988_auto_smux_enum_info()
749 struct ad198x_spec *spec = codec->spec; in ad1988_auto_smux_enum_get()
751 ucontrol->value.enumerated.item[0] = spec->cur_smux; in ad1988_auto_smux_enum_get()
759 struct ad198x_spec *spec = codec->spec; in ad1988_auto_smux_enum_put()
760 unsigned int val = ucontrol->value.enumerated.item[0]; in ad1988_auto_smux_enum_put()
762 int num_conns = spec->num_smux_conns; in ad1988_auto_smux_enum_put()
765 return -EINVAL; in ad1988_auto_smux_enum_put()
766 if (spec->cur_smux == val) in ad1988_auto_smux_enum_put()
769 mutex_lock(&codec->control_mutex); in ad1988_auto_smux_enum_put()
771 spec->smux_paths[spec->cur_smux]); in ad1988_auto_smux_enum_put()
774 path = snd_hda_get_path_from_idx(codec, spec->smux_paths[val]); in ad1988_auto_smux_enum_put()
777 spec->cur_smux = val; in ad1988_auto_smux_enum_put()
778 mutex_unlock(&codec->control_mutex); in ad1988_auto_smux_enum_put()
792 struct ad198x_spec *spec = codec->spec; in ad1988_auto_init()
798 if (!spec->gen.autocfg.dig_outs) in ad1988_auto_init()
803 path = snd_hda_get_path_from_idx(codec, spec->smux_paths[i]); in ad1988_auto_init()
805 snd_hda_activate_path(codec, path, path->active, false); in ad1988_auto_init()
813 struct ad198x_spec *spec = codec->spec; in ad1988_add_spdif_mux_ctl()
840 .idx = { 0, 2, 1, 0 }, in ad1988_add_spdif_mux_ctl()
846 if (!spec->gen.autocfg.dig_outs || in ad1988_add_spdif_mux_ctl()
853 spec->num_smux_conns = num_conns; in ad1988_add_spdif_mux_ctl()
856 struct nid_path *path = snd_array_new(&spec->gen.paths); in ad1988_add_spdif_mux_ctl()
858 return -ENOMEM; in ad1988_add_spdif_mux_ctl()
861 path->active = 1; in ad1988_add_spdif_mux_ctl()
862 spec->smux_paths[i] = snd_hda_get_path_idx(codec, path); in ad1988_add_spdif_mux_ctl()
865 if (!snd_hda_gen_add_kctl(&spec->gen, NULL, &ad1988_auto_smux_mixer)) in ad1988_add_spdif_mux_ctl()
866 return -ENOMEM; in ad1988_add_spdif_mux_ctl()
868 codec->patch_ops.init = ad1988_auto_init; in ad1988_add_spdif_mux_ctl()
884 { 0x11, 0x02214130 }, /* front-hp */
885 { 0x12, 0x01014010 }, /* line-out */
886 { 0x14, 0x02a19122 }, /* front-mic */
887 { 0x15, 0x01813021 }, /* line-in */
888 { 0x16, 0x01011012 }, /* line-out */
891 { 0x24, 0x01016011 }, /* line-out */
892 { 0x25, 0x01012013 }, /* line-out */
899 { .id = AD1988_FIXUP_6STACK_DIG, .name = "6stack-dig" },
911 spec = codec->spec; in patch_ad1988()
913 spec->gen.mixer_nid = 0x20; in patch_ad1988()
914 spec->gen.mixer_merge_nid = 0x21; in patch_ad1988()
915 spec->gen.beep_nid = 0x10; in patch_ad1988()
941 * port-B - front line/mic-in
942 * port-E - aux in/out
943 * port-F - aux in/out
944 * port-C - rear line/mic-in
945 * port-D - rear line/hp-out
946 * port-A - front line/hp-out
948 * AD1984 = AD1884 + two digital mic-ins
952 * port-B (0x14) - front mic-in
953 * port-E (0x1c) - rear mic-in
954 * port-F (0x16) - CD / ext out
955 * port-C (0x15) - rear line-in
956 * port-D (0x12) - rear line-out
957 * port-A (0x11) - front hp-out
959 * AD1984A = AD1884A + digital-mic
961 * AD1984B = AD1984A + extra SPDIF-out
964 /* set the upper-limit for mixer amp to 0dB for avoiding the possible
982 struct ad198x_spec *spec = codec->spec; in ad1884_vmaster_hp_gpio_hook()
984 if (spec->eapd_nid) in ad1884_vmaster_hp_gpio_hook()
994 struct ad198x_spec *spec = codec->spec; in ad1884_fixup_hp_eapd()
998 spec->gen.vmaster_mute.hook = ad1884_vmaster_hp_gpio_hook; in ad1884_fixup_hp_eapd()
999 spec->gen.own_eapd_ctl = 1; in ad1884_fixup_hp_eapd()
1008 if (spec->gen.autocfg.line_out_type == AUTO_PIN_SPEAKER_OUT) in ad1884_fixup_hp_eapd()
1009 spec->eapd_nid = spec->gen.autocfg.line_out_pins[0]; in ad1884_fixup_hp_eapd()
1011 spec->eapd_nid = spec->gen.autocfg.speaker_pins[0]; in ad1884_fixup_hp_eapd()
1019 struct ad198x_spec *spec = codec->spec; in ad1884_fixup_thinkpad()
1022 spec->gen.keep_eapd_on = 1; in ad1884_fixup_thinkpad()
1023 spec->gen.vmaster_mute.hook = ad_vmaster_eapd_hook; in ad1884_fixup_thinkpad()
1024 spec->eapd_nid = 0x12; in ad1884_fixup_thinkpad()
1025 /* Analog PC Beeper - allow firmware/ACPI beeps */ in ad1884_fixup_thinkpad()
1026 spec->beep_amp = HDA_COMPOSE_AMP_VAL(0x20, 3, 3, HDA_INPUT); in ad1884_fixup_thinkpad()
1027 spec->gen.beep_nid = 0; /* no digital beep */ in ad1884_fixup_thinkpad()
1091 spec = codec->spec; in patch_ad1884()
1093 spec->gen.mixer_nid = 0x20; in patch_ad1884()
1094 spec->gen.mixer_merge_nid = 0x21; in patch_ad1884()
1095 spec->gen.beep_nid = 0x10; in patch_ad1884()
1120 * port-A - front hp-out
1121 * port-B - front mic-in
1122 * port-C - rear line-in, shared surr-out (3stack)
1123 * port-D - rear line-out
1124 * port-E - rear mic-in, shared clfe-out (3stack)
1125 * port-F - rear surr-out (6stack)
1126 * port-G - rear clfe-out (6stack)
1137 spec = codec->spec; in patch_ad1882()
1139 spec->gen.mixer_nid = 0x20; in patch_ad1882()
1140 spec->gen.mixer_merge_nid = 0x21; in patch_ad1882()
1141 spec->gen.beep_nid = 0x10; in patch_ad1882()
1181 MODULE_DESCRIPTION("Analog Devices HD-audio codec");