Lines Matching +full:headset +full:- +full:codec
1 // SPDX-License-Identifier: GPL-2.0-or-later
16 * 6-channel independent captures.
18 * In addition, an independent DAC for the multi-playback (not used in this
26 static int alc662_parse_auto_config(struct hda_codec *codec) in alc662_parse_auto_config() argument
33 if (codec->core.vendor_id == 0x10ec0272 || codec->core.vendor_id == 0x10ec0663 || in alc662_parse_auto_config()
34 codec->core.vendor_id == 0x10ec0665 || codec->core.vendor_id == 0x10ec0670 || in alc662_parse_auto_config()
35 codec->core.vendor_id == 0x10ec0671) in alc662_parse_auto_config()
39 return alc_parse_auto_config(codec, alc662_ignore, ssids); in alc662_parse_auto_config()
42 static void alc272_fixup_mario(struct hda_codec *codec, in alc272_fixup_mario() argument
47 if (snd_hda_override_amp_caps(codec, 0x2, HDA_OUTPUT, in alc272_fixup_mario()
52 codec_warn(codec, "failed to override amp caps for NID 0x2\n"); in alc272_fixup_mario()
56 static unsigned int gpio_led_power_filter(struct hda_codec *codec, in gpio_led_power_filter() argument
60 struct alc_spec *spec = codec->spec; in gpio_led_power_filter()
61 if (nid == codec->core.afg && power_state == AC_PWRST_D3 && spec->gpio_data) in gpio_led_power_filter()
66 static void alc662_fixup_led_gpio1(struct hda_codec *codec, in alc662_fixup_led_gpio1() argument
69 struct alc_spec *spec = codec->spec; in alc662_fixup_led_gpio1()
71 alc_fixup_hp_gpio_led(codec, action, 0x01, 0); in alc662_fixup_led_gpio1()
73 spec->mute_led_polarity = 1; in alc662_fixup_led_gpio1()
74 codec->power_filter = gpio_led_power_filter; in alc662_fixup_led_gpio1()
78 static void alc662_usi_automute_hook(struct hda_codec *codec, in alc662_usi_automute_hook() argument
81 struct alc_spec *spec = codec->spec; in alc662_usi_automute_hook()
84 snd_hda_gen_hp_automute(codec, jack); in alc662_usi_automute_hook()
86 vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0; in alc662_usi_automute_hook()
88 snd_hda_codec_write(codec, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, in alc662_usi_automute_hook()
92 static void alc662_fixup_usi_headset_mic(struct hda_codec *codec, in alc662_fixup_usi_headset_mic() argument
95 struct alc_spec *spec = codec->spec; in alc662_fixup_usi_headset_mic()
97 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC; in alc662_fixup_usi_headset_mic()
98 spec->gen.hp_automute_hook = alc662_usi_automute_hook; in alc662_fixup_usi_headset_mic()
102 static void alc662_aspire_ethos_mute_speakers(struct hda_codec *codec, in alc662_aspire_ethos_mute_speakers() argument
108 * 0x15 - front left/front right in alc662_aspire_ethos_mute_speakers()
109 * 0x18 - front center/ LFE in alc662_aspire_ethos_mute_speakers()
111 if (snd_hda_jack_detect_state(codec, 0x1b) == HDA_JACK_PRESENT) { in alc662_aspire_ethos_mute_speakers()
112 snd_hda_set_pin_ctl_cache(codec, 0x15, 0); in alc662_aspire_ethos_mute_speakers()
113 snd_hda_set_pin_ctl_cache(codec, 0x18, 0); in alc662_aspire_ethos_mute_speakers()
115 snd_hda_set_pin_ctl_cache(codec, 0x15, PIN_OUT); in alc662_aspire_ethos_mute_speakers()
116 snd_hda_set_pin_ctl_cache(codec, 0x18, PIN_OUT); in alc662_aspire_ethos_mute_speakers()
120 static void alc662_fixup_aspire_ethos_hp(struct hda_codec *codec, in alc662_fixup_aspire_ethos_hp() argument
124 if (!is_jack_detectable(codec, 0x1b)) in alc662_fixup_aspire_ethos_hp()
129 snd_hda_jack_detect_enable_callback(codec, 0x1b, in alc662_fixup_aspire_ethos_hp()
132 alc_setup_gpio(codec, 0x02); in alc662_fixup_aspire_ethos_hp()
138 alc662_aspire_ethos_mute_speakers(codec, NULL); in alc662_fixup_aspire_ethos_hp()
143 static void alc671_fixup_hp_headset_mic2(struct hda_codec *codec, in alc671_fixup_hp_headset_mic2() argument
146 struct alc_spec *spec = codec->spec; in alc671_fixup_hp_headset_mic2()
149 { 0x19, 0x02a11040 }, /* use as headset mic, with its own jack detect */ in alc671_fixup_hp_headset_mic2()
156 spec->gen.mixer_nid = 0; in alc671_fixup_hp_headset_mic2()
157 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC; in alc671_fixup_hp_headset_mic2()
158 snd_hda_apply_pincfgs(codec, pincfgs); in alc671_fixup_hp_headset_mic2()
161 alc_write_coef_idx(codec, 0x19, 0xa054); in alc671_fixup_hp_headset_mic2()
166 static void alc897_hp_automute_hook(struct hda_codec *codec, in alc897_hp_automute_hook() argument
169 struct alc_spec *spec = codec->spec; in alc897_hp_automute_hook()
172 snd_hda_gen_hp_automute(codec, jack); in alc897_hp_automute_hook()
173 vref = spec->gen.hp_jack_present ? (PIN_HP | AC_PINCTL_VREF_100) : PIN_HP; in alc897_hp_automute_hook()
174 snd_hda_set_pin_ctl(codec, 0x1b, vref); in alc897_hp_automute_hook()
177 static void alc897_fixup_lenovo_headset_mic(struct hda_codec *codec, in alc897_fixup_lenovo_headset_mic() argument
180 struct alc_spec *spec = codec->spec; in alc897_fixup_lenovo_headset_mic()
182 spec->gen.hp_automute_hook = alc897_hp_automute_hook; in alc897_fixup_lenovo_headset_mic()
183 spec->no_shutup_pins = 1; in alc897_fixup_lenovo_headset_mic()
186 snd_hda_set_pin_ctl_cache(codec, 0x1a, PIN_IN | AC_PINCTL_VREF_100); in alc897_fixup_lenovo_headset_mic()
190 static void alc897_fixup_lenovo_headset_mode(struct hda_codec *codec, in alc897_fixup_lenovo_headset_mode() argument
193 struct alc_spec *spec = codec->spec; in alc897_fixup_lenovo_headset_mode()
196 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC; in alc897_fixup_lenovo_headset_mode()
197 spec->gen.hp_automute_hook = alc897_hp_automute_hook; in alc897_fixup_lenovo_headset_mode()
225 static void alc668_restore_default_value(struct hda_codec *codec) in alc668_restore_default_value() argument
227 alc_process_coef_fw(codec, alc668_coefs); in alc668_restore_default_value()
230 static void alc_fixup_headset_mode_alc662(struct hda_codec *codec, in alc_fixup_headset_mode_alc662() argument
233 struct alc_spec *spec = codec->spec; in alc_fixup_headset_mode_alc662()
236 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC; in alc_fixup_headset_mode_alc662()
237 spec->gen.hp_mic = 1; /* Mic-in is same pin as headphone */ in alc_fixup_headset_mode_alc662()
239 /* Disable boost for mic-in permanently. (This code is only called in alc_fixup_headset_mode_alc662()
241 snd_hda_codec_write(codec, 0x1b, 0, AC_VERB_SET_AMP_GAIN_MUTE, 0x7000); in alc_fixup_headset_mode_alc662()
242 snd_hda_override_wcaps(codec, 0x1b, get_wcaps(codec, 0x1b) & ~AC_WCAP_IN_AMP); in alc_fixup_headset_mode_alc662()
244 alc_fixup_headset_mode(codec, fix, action); in alc_fixup_headset_mode_alc662()
247 static void alc_fixup_headset_mode_alc668(struct hda_codec *codec, in alc_fixup_headset_mode_alc668() argument
251 alc_write_coef_idx(codec, 0xc4, 0x8000); in alc_fixup_headset_mode_alc668()
252 alc_update_coef_idx(codec, 0xc2, ~0xfe, 0); in alc_fixup_headset_mode_alc668()
253 snd_hda_set_pin_ctl_cache(codec, 0x18, 0); in alc_fixup_headset_mode_alc668()
255 alc_fixup_headset_mode(codec, fix, action); in alc_fixup_headset_mode_alc668()
351 {0x19, 0x90a7013f}, /* int-mic */
387 { 0x19, 0x99a3092f }, /* int-mic */
399 { 0x19, 0x99a3092f }, /* int-mic */
412 { 0x19, 0x99a3094f }, /* int-mic */
425 { 0x19, 0x99a3094f }, /* int-mic */
439 { 0x19, 0x99a3094f }, /* int-mic */
451 { 0x19, 0x99a3094f }, /* int-mic */
464 { 0x19, 0x99a3094f }, /* int-mic */
476 { 0x12, 0x99a30970 }, /* int-mic */
522 { 0x19, 0x03a1113c }, /* use as headset mic, without its own jack detect */
537 { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */
591 { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */
622 { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */
650 { 0x19, 0x02a1913c }, /* use as headset mic, without its own jack detect */
683 { 0x1a, 0x02a1113c }, /* use as headset mic, without its own jack detect */
692 { 0x1a, 0x01a11140 }, /* use as headset mic, without its own jack detect */
738 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
749 { 0x1a, 0x01a11140 }, /* use as headset mic, without its own jack detect */
765 { 0x19, 0x03a11050 }, /* use as headset mic */
773 SND_PCI_QUIRK(0x1019, 0x9859, "JP-IK LEAP W502", ALC897_FIXUP_HEADSET_MIC_PIN3),
782 SND_PCI_QUIRK(0x1025, 0x123c, "Acer Nitro N50-600", ALC662_FIXUP_ACER_NITRO_HEADSET_MODE),
829 SND_PCI_QUIRK(0x17aa, 0x3742, "Lenovo TianYi510Pro-14IOB", ALC897_FIXUP_HEADSET_MIC_PIN2),
837 SND_PCI_QUIRK(0x1c6c, 0x1239, "Compaq N14JP6-V2", ALC897_FIXUP_HP_HSMIC_VERB),
903 {.id = ALC662_FIXUP_HP_RP5800, .name = "hp-rp5800"},
904 {.id = ALC662_FIXUP_ASUS_MODE1, .name = "asus-mode1"},
905 {.id = ALC662_FIXUP_ASUS_MODE2, .name = "asus-mode2"},
906 {.id = ALC662_FIXUP_ASUS_MODE3, .name = "asus-mode3"},
907 {.id = ALC662_FIXUP_ASUS_MODE4, .name = "asus-mode4"},
908 {.id = ALC662_FIXUP_ASUS_MODE5, .name = "asus-mode5"},
909 {.id = ALC662_FIXUP_ASUS_MODE6, .name = "asus-mode6"},
910 {.id = ALC662_FIXUP_ASUS_MODE7, .name = "asus-mode7"},
911 {.id = ALC662_FIXUP_ASUS_MODE8, .name = "asus-mode8"},
912 {.id = ALC662_FIXUP_ZOTAC_Z68, .name = "zotac-z68"},
913 {.id = ALC662_FIXUP_INV_DMIC, .name = "inv-dmic"},
914 {.id = ALC662_FIXUP_DELL_MIC_NO_PRESENCE, .name = "alc662-headset-multi"},
915 {.id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE, .name = "dell-headset-multi"},
916 {.id = ALC662_FIXUP_HEADSET_MODE, .name = "alc662-headset"},
917 {.id = ALC668_FIXUP_HEADSET_MODE, .name = "alc668-headset"},
921 {.id = ALC668_FIXUP_DELL_XPS13, .name = "dell-xps13"},
922 {.id = ALC662_FIXUP_ASUS_Nx50, .name = "asus-nx50"},
923 {.id = ALC668_FIXUP_ASUS_Nx51, .name = "asus-nx51"},
924 {.id = ALC668_FIXUP_ASUS_G751, .name = "asus-g751"},
925 {.id = ALC891_FIXUP_HEADSET_MODE, .name = "alc891-headset"},
926 {.id = ALC891_FIXUP_DELL_MIC_NO_PRESENCE, .name = "alc891-headset-multi"},
927 {.id = ALC662_FIXUP_ACER_VERITON, .name = "acer-veriton"},
928 {.id = ALC892_FIXUP_ASROCK_MOBO, .name = "asrock-mobo"},
929 {.id = ALC662_FIXUP_USI_HEADSET_MODE, .name = "usi-headset"},
930 {.id = ALC662_FIXUP_LENOVO_MULTI_CODECS, .name = "dual-codecs"},
931 {.id = ALC669_FIXUP_ACER_ASPIRE_ETHOS, .name = "aspire-ethos"},
932 {.id = ALC897_FIXUP_UNIS_H3C_X500S, .name = "unis-h3c-x500s"},
997 static int alc662_probe(struct hda_codec *codec, const struct hda_device_id *id) in alc662_probe() argument
1002 err = alc_alloc_spec(codec, 0x0b); in alc662_probe()
1006 spec = codec->spec; in alc662_probe()
1008 spec->shutup = alc_eapd_shutup; in alc662_probe()
1011 spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP; in alc662_probe()
1013 alc_fix_pll_init(codec, 0x20, 0x04, 15); in alc662_probe()
1015 switch (codec->core.vendor_id) { in alc662_probe()
1017 spec->init_hook = alc668_restore_default_value; in alc662_probe()
1021 alc_pre_init(codec); in alc662_probe()
1023 snd_hda_pick_fixup(codec, alc662_fixup_models, in alc662_probe()
1025 snd_hda_pick_pin_fixup(codec, alc662_pin_fixup_tbl, alc662_fixups, true); in alc662_probe()
1026 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); in alc662_probe()
1028 alc_auto_parse_customize_define(codec); in alc662_probe()
1030 if (has_cdefine_beep(codec)) in alc662_probe()
1031 spec->gen.beep_nid = 0x01; in alc662_probe()
1033 if ((alc_get_coef0(codec) & (1 << 14)) && in alc662_probe()
1034 codec->bus->pci && codec->bus->pci->subsystem_vendor == 0x1025 && in alc662_probe()
1035 spec->cdefine.platform_type == 1) { in alc662_probe()
1036 err = alc_codec_rename(codec, "ALC272X"); in alc662_probe()
1042 err = alc662_parse_auto_config(codec); in alc662_probe()
1046 if (!spec->gen.no_analog && spec->gen.beep_nid) { in alc662_probe()
1047 switch (codec->core.vendor_id) { in alc662_probe()
1065 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); in alc662_probe()
1070 snd_hda_gen_remove(codec); in alc662_probe()
1108 MODULE_DESCRIPTION("Realtek ALC662 and compatible HD-audio codec");