Lines Matching +full:ext +full:- +full:gen
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()
127 struct ad198x_spec *spec = codec->spec; in ad_vmaster_eapd_hook()
129 if (!spec->eapd_nid) in ad_vmaster_eapd_hook()
131 if (codec->inv_eapd) in ad_vmaster_eapd_hook()
133 snd_hda_codec_write_cache(codec, spec->eapd_nid, 0, in ad_vmaster_eapd_hook()
170 struct ad198x_spec *spec = codec->spec; in ad198x_parse_auto_config()
171 struct auto_pin_cfg *cfg = &spec->gen.autocfg; in ad198x_parse_auto_config()
174 codec->spdif_status_reset = 1; in ad198x_parse_auto_config()
175 codec->no_trigger_sense = 1; in ad198x_parse_auto_config()
176 codec->no_sticky_stream = 1; in ad198x_parse_auto_config()
178 spec->gen.indep_hp = indep_hp; in ad198x_parse_auto_config()
179 if (!spec->gen.add_stereo_mix_input) in ad198x_parse_auto_config()
180 spec->gen.add_stereo_mix_input = HDA_HINT_STEREO_MIX_AUTO; in ad198x_parse_auto_config()
202 return -ENOMEM; in alloc_ad_spec()
203 codec->spec = spec; in alloc_ad_spec()
204 snd_hda_gen_spec_init(&spec->gen); in alloc_ad_spec()
205 codec->patch_ops = ad198x_auto_patch_ops; in alloc_ad_spec()
213 /* Lenovo N100 seems to report the reversed bit for HP jack-sensing */
217 struct ad198x_spec *spec = codec->spec; in ad_fixup_inv_jack_detect()
220 codec->inv_jack_detect = 1; in ad_fixup_inv_jack_detect()
221 spec->gen.keep_eapd_on = 1; in ad_fixup_inv_jack_detect()
222 spec->gen.vmaster_mute.hook = ad_vmaster_eapd_hook; in ad_fixup_inv_jack_detect()
223 spec->eapd_nid = 0x1b; in ad_fixup_inv_jack_detect()
231 struct ad198x_spec *spec = codec->spec; in ad1986a_fixup_eapd()
234 codec->inv_eapd = 0; in ad1986a_fixup_eapd()
235 spec->gen.keep_eapd_on = 1; in ad1986a_fixup_eapd()
236 spec->eapd_nid = 0x1b; in ad1986a_fixup_eapd()
240 /* enable stereo-mix input for avoiding regression on KDE (bko#88251) */
244 struct ad198x_spec *spec = codec->spec; in ad1986a_fixup_eapd_mix_in()
248 spec->gen.add_stereo_mix_input = HDA_HINT_STEREO_MIX_ENABLE; in ad1986a_fixup_eapd_mix_in()
292 { 0x1c, 0x01813030 }, /* line-in */
359 SND_PCI_QUIRK(0x10de, 0xcb84, "ASUS A8N-VM", AD1986A_FIXUP_3STACK),
374 { .id = AD1986A_FIXUP_LAPTOP_IMIC, .name = "laptop-imic" },
375 { .id = AD1986A_FIXUP_LAPTOP_IMIC, .name = "laptop-eapd" }, /* alias */
398 spec = codec->spec; in patch_ad1986a()
401 codec->inv_eapd = 1; in patch_ad1986a()
403 spec->gen.mixer_nid = 0x07; in patch_ad1986a()
404 spec->gen.beep_nid = 0x19; in patch_ad1986a()
413 spec->gen.multiout.no_share_stream = 1; in patch_ad1986a()
415 spec->gen.preferred_dacs = preferred_pairs; in patch_ad1986a()
418 spec->gen.auto_mute_via_amp = 1; in patch_ad1986a()
441 * SPDIF mux control for AD1983 auto-parser
447 struct ad198x_spec *spec = codec->spec; in ad1983_auto_smux_enum_info()
450 int num_conns = spec->num_smux_conns; in ad1983_auto_smux_enum_info()
457 return -EINVAL; in ad1983_auto_smux_enum_info()
464 struct ad198x_spec *spec = codec->spec; in ad1983_auto_smux_enum_get()
466 ucontrol->value.enumerated.item[0] = spec->cur_smux; in ad1983_auto_smux_enum_get()
474 struct ad198x_spec *spec = codec->spec; in ad1983_auto_smux_enum_put()
475 unsigned int val = ucontrol->value.enumerated.item[0]; in ad1983_auto_smux_enum_put()
476 hda_nid_t dig_out = spec->gen.multiout.dig_out_nid; in ad1983_auto_smux_enum_put()
477 int num_conns = spec->num_smux_conns; in ad1983_auto_smux_enum_put()
480 return -EINVAL; in ad1983_auto_smux_enum_put()
481 if (spec->cur_smux == val) in ad1983_auto_smux_enum_put()
483 spec->cur_smux = val; in ad1983_auto_smux_enum_put()
499 struct ad198x_spec *spec = codec->spec; in ad1983_add_spdif_mux_ctl()
500 hda_nid_t dig_out = spec->gen.multiout.dig_out_nid; in ad1983_add_spdif_mux_ctl()
508 spec->num_smux_conns = num_conns; in ad1983_add_spdif_mux_ctl()
509 if (!snd_hda_gen_add_kctl(&spec->gen, NULL, &ad1983_auto_smux_mixer)) in ad1983_add_spdif_mux_ctl()
510 return -ENOMEM; in ad1983_add_spdif_mux_ctl()
524 spec = codec->spec; in patch_ad1983()
526 spec->gen.mixer_nid = 0x0e; in patch_ad1983()
527 spec->gen.beep_nid = 0x10; in patch_ad1983()
555 struct ad198x_spec *spec = codec->spec; in ad1981_fixup_hp_eapd()
558 spec->gen.vmaster_mute.hook = ad_vmaster_eapd_hook; in ad1981_fixup_hp_eapd()
559 spec->eapd_nid = 0x05; in ad1981_fixup_hp_eapd()
563 /* set the upper-limit for mixer amp to 0dB for avoiding the possible
611 return -ENOMEM; in patch_ad1981()
612 spec = codec->spec; in patch_ad1981()
614 spec->gen.mixer_nid = 0x0e; in patch_ad1981()
615 spec->gen.beep_nid = 0x10; in patch_ad1981()
644 * port-A 0x11 (mute/hp) <- 0x22 <- 0x37 <- 03/04/06
645 * port-B 0x14 (mute/hp) <- 0x2b <- 0x30 <- 03/04/06
646 * port-C 0x15 (mute) <- 0x2c <- 0x31 <- 05/0a
647 * port-D 0x12 (mute/hp) <- 0x29 <- 04
648 * port-E 0x17 (mute/hp) <- 0x26 <- 0x32 <- 05/0a
649 * port-F 0x16 (mute) <- 0x2a <- 06
650 * port-G 0x24 (mute) <- 0x27 <- 05
651 * port-H 0x25 (mute) <- 0x28 <- 0a
652 * mono 0x13 (mute/amp)<- 0x1e <- 0x36 <- 03/04/06
660 * port-A 0x11 -> 0x38 -> mix 2, ADC 0
661 * port-B 0x14 -> 0x39 -> mix 0, ADC 1
662 * port-C 0x15 -> 0x3a -> 33:0 - mix 1, ADC 2
663 * port-D 0x12 -> 0x3d -> mix 3, ADC 8
664 * port-E 0x17 -> 0x3c -> 34:0 - mix 4, ADC 4
665 * port-F 0x16 -> 0x3b -> mix 5, ADC 3
666 * port-G 0x24 -> N/A -> 33:1 - mix 1, 34:1 - mix 4, ADC 6
667 * port-H 0x25 -> N/A -> 33:2 - mix 1, 34:2 - mix 4, ADC 7
671 * 6stack - front/surr/CLFE/side/opt DACs - 04/06/05/0a/03
672 * 3stack - front/surr/CLFE/opt DACs - 04/05/0a/03
675 * 0:Port-B (front mic)
676 * 1:Port-C/G/H (line-in)
677 * 2:Port-A
678 * 3:Port-D (line-in/2)
679 * 4:Port-E/G/H (mic-in)
680 * 5:Port-F (mic2-in)
685 * 0:Port-A
686 * 1:Port-B (front mic-in)
687 * 2:Port-C (line-in)
688 * 3:Port-F (mic2-in)
689 * 4:Port-E (mic-in)
691 * 6:Port-G
692 * 7:Port-H
693 * 8:Port-D (line-in/2)
698 * 6-stack
699 * Port-A front headphone
700 * B front mic-in
701 * C rear line-in
702 * D rear front-out
703 * E rear mic-in
708 * 3-stack
709 * Port-A front headphone
711 * C rear line-in/surround
712 * D rear front-out
713 * E rear mic-in/CLFE
716 * Port-A headphone
717 * B mic-in
727 struct ad198x_spec *spec = codec->spec; in ad1988_auto_smux_enum_info()
731 int num_conns = spec->num_smux_conns; in ad1988_auto_smux_enum_info()
742 struct ad198x_spec *spec = codec->spec; in ad1988_auto_smux_enum_get()
744 ucontrol->value.enumerated.item[0] = spec->cur_smux; in ad1988_auto_smux_enum_get()
752 struct ad198x_spec *spec = codec->spec; in ad1988_auto_smux_enum_put()
753 unsigned int val = ucontrol->value.enumerated.item[0]; in ad1988_auto_smux_enum_put()
755 int num_conns = spec->num_smux_conns; in ad1988_auto_smux_enum_put()
758 return -EINVAL; in ad1988_auto_smux_enum_put()
759 if (spec->cur_smux == val) in ad1988_auto_smux_enum_put()
762 mutex_lock(&codec->control_mutex); in ad1988_auto_smux_enum_put()
764 spec->smux_paths[spec->cur_smux]); in ad1988_auto_smux_enum_put()
767 path = snd_hda_get_path_from_idx(codec, spec->smux_paths[val]); in ad1988_auto_smux_enum_put()
770 spec->cur_smux = val; in ad1988_auto_smux_enum_put()
771 mutex_unlock(&codec->control_mutex); in ad1988_auto_smux_enum_put()
785 struct ad198x_spec *spec = codec->spec; in ad1988_auto_init()
791 if (!spec->gen.autocfg.dig_outs) in ad1988_auto_init()
796 path = snd_hda_get_path_from_idx(codec, spec->smux_paths[i]); in ad1988_auto_init()
798 snd_hda_activate_path(codec, path, path->active, false); in ad1988_auto_init()
806 struct ad198x_spec *spec = codec->spec; in ad1988_add_spdif_mux_ctl()
839 if (!spec->gen.autocfg.dig_outs || in ad1988_add_spdif_mux_ctl()
846 spec->num_smux_conns = num_conns; in ad1988_add_spdif_mux_ctl()
849 struct nid_path *path = snd_array_new(&spec->gen.paths); in ad1988_add_spdif_mux_ctl()
851 return -ENOMEM; in ad1988_add_spdif_mux_ctl()
854 path->active = 1; in ad1988_add_spdif_mux_ctl()
855 spec->smux_paths[i] = snd_hda_get_path_idx(codec, path); in ad1988_add_spdif_mux_ctl()
858 if (!snd_hda_gen_add_kctl(&spec->gen, NULL, &ad1988_auto_smux_mixer)) in ad1988_add_spdif_mux_ctl()
859 return -ENOMEM; in ad1988_add_spdif_mux_ctl()
861 codec->patch_ops.init = ad1988_auto_init; in ad1988_add_spdif_mux_ctl()
877 { 0x11, 0x02214130 }, /* front-hp */
878 { 0x12, 0x01014010 }, /* line-out */
879 { 0x14, 0x02a19122 }, /* front-mic */
880 { 0x15, 0x01813021 }, /* line-in */
881 { 0x16, 0x01011012 }, /* line-out */
884 { 0x24, 0x01016011 }, /* line-out */
885 { 0x25, 0x01012013 }, /* line-out */
892 { .id = AD1988_FIXUP_6STACK_DIG, .name = "6stack-dig" },
904 spec = codec->spec; in patch_ad1988()
906 spec->gen.mixer_nid = 0x20; in patch_ad1988()
907 spec->gen.mixer_merge_nid = 0x21; in patch_ad1988()
908 spec->gen.beep_nid = 0x10; in patch_ad1988()
934 * port-B - front line/mic-in
935 * port-E - aux in/out
936 * port-F - aux in/out
937 * port-C - rear line/mic-in
938 * port-D - rear line/hp-out
939 * port-A - front line/hp-out
941 * AD1984 = AD1884 + two digital mic-ins
945 * port-B (0x14) - front mic-in
946 * port-E (0x1c) - rear mic-in
947 * port-F (0x16) - CD / ext out
948 * port-C (0x15) - rear line-in
949 * port-D (0x12) - rear line-out
950 * port-A (0x11) - front hp-out
952 * AD1984A = AD1884A + digital-mic
954 * AD1984B = AD1984A + extra SPDIF-out
957 /* set the upper-limit for mixer amp to 0dB for avoiding the possible
975 struct ad198x_spec *spec = codec->spec; in ad1884_vmaster_hp_gpio_hook()
977 if (spec->eapd_nid) in ad1884_vmaster_hp_gpio_hook()
987 struct ad198x_spec *spec = codec->spec; in ad1884_fixup_hp_eapd()
991 spec->gen.vmaster_mute.hook = ad1884_vmaster_hp_gpio_hook; in ad1884_fixup_hp_eapd()
992 spec->gen.own_eapd_ctl = 1; in ad1884_fixup_hp_eapd()
1001 if (spec->gen.autocfg.line_out_type == AUTO_PIN_SPEAKER_OUT) in ad1884_fixup_hp_eapd()
1002 spec->eapd_nid = spec->gen.autocfg.line_out_pins[0]; in ad1884_fixup_hp_eapd()
1004 spec->eapd_nid = spec->gen.autocfg.speaker_pins[0]; in ad1884_fixup_hp_eapd()
1012 struct ad198x_spec *spec = codec->spec; in ad1884_fixup_thinkpad()
1015 spec->gen.keep_eapd_on = 1; in ad1884_fixup_thinkpad()
1016 spec->gen.vmaster_mute.hook = ad_vmaster_eapd_hook; in ad1884_fixup_thinkpad()
1017 spec->eapd_nid = 0x12; in ad1884_fixup_thinkpad()
1018 /* Analog PC Beeper - allow firmware/ACPI beeps */ in ad1884_fixup_thinkpad()
1019 spec->beep_amp = HDA_COMPOSE_AMP_VAL(0x20, 3, 3, HDA_INPUT); in ad1884_fixup_thinkpad()
1020 spec->gen.beep_nid = 0; /* no digital beep */ in ad1884_fixup_thinkpad()
1084 spec = codec->spec; in patch_ad1884()
1086 spec->gen.mixer_nid = 0x20; in patch_ad1884()
1087 spec->gen.mixer_merge_nid = 0x21; in patch_ad1884()
1088 spec->gen.beep_nid = 0x10; in patch_ad1884()
1113 * port-A - front hp-out
1114 * port-B - front mic-in
1115 * port-C - rear line-in, shared surr-out (3stack)
1116 * port-D - rear line-out
1117 * port-E - rear mic-in, shared clfe-out (3stack)
1118 * port-F - rear surr-out (6stack)
1119 * port-G - rear clfe-out (6stack)
1130 spec = codec->spec; in patch_ad1882()
1132 spec->gen.mixer_nid = 0x20; in patch_ad1882()
1133 spec->gen.mixer_merge_nid = 0x21; in patch_ad1882()
1134 spec->gen.beep_nid = 0x10; in patch_ad1882()
1174 MODULE_DESCRIPTION("Analog Devices HD-audio codec");