Lines Matching +full:hp +full:- +full:cfg
1 // SPDX-License-Identifier: GPL-2.0-or-later
7 * Tobin Davis <tdavis@dsl-only.net>
63 spec->gen.beep_nid = nid;
65 knew = snd_hda_gen_add_kctl(&spec->gen, NULL,
68 return -ENOMEM;
69 knew->private_value = beep_amp;
76 struct conexant_spec *spec = codec->spec;
95 struct conexant_spec *spec = codec->spec;
103 spec->eapds[spec->num_eapds++] = nid;
104 if (spec->num_eapds >= ARRAY_SIZE(spec->eapds))
114 if (spec->num_eapds > 2)
115 spec->dynamic_eapd = 1;
134 struct conexant_spec *spec = codec->spec;
136 cx_auto_turn_eapd(codec, spec->num_eapds, spec->eapds, enabled);
143 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
144 struct conexant_spec *spec = codec->spec;
146 snd_hda_codec_write(codec, spec->mute_led_eapd, 0,
154 struct conexant_spec *spec = codec->spec;
155 unsigned int mask = spec->gpio_mute_led_mask | spec->gpio_mic_led_mask;
163 spec->gpio_led);
174 /* set OFF voltage for DFET from -1.2V to -0.8V, set headset micbias register
190 struct conexant_spec *spec = codec->spec;
192 if (!spec->dynamic_eapd)
193 cx_auto_turn_eapd(codec, spec->num_eapds, spec->eapds, true);
198 if (spec->is_cx8070_sn6140)
206 struct conexant_spec *spec = codec->spec;
210 cx_auto_turn_eapd(codec, spec->num_eapds, spec->eapds, false);
252 * Check hp&mic tag to process headset plugin & plugout.
278 * pin fix-up
319 struct conexant_spec *spec = codec->spec;
320 spec->gen.inv_dmic_split = 1;
354 struct conexant_spec *spec = codec->spec;
355 struct auto_pin_cfg *cfg = &spec->gen.autocfg;
357 hda_nid_t mux_pin = spec->gen.imux_pins[spec->gen.cur_mux[0]];
359 for (i = 0; i < cfg->num_inputs; i++)
360 if (cfg->inputs[i].pin == mux_pin) {
361 mic_mode = !!cfg->inputs[i].is_headphone_mic;
366 snd_hda_codec_write_cache(codec, 0x1c, 0, 0x410, 0x7c); /* enable merged mode for analog int-mic */
367 spec->gen.hp_jack_present = false;
369 snd_hda_codec_write_cache(codec, 0x1c, 0, 0x410, 0x54); /* disable merged mode for analog int-mic */
370 spec->gen.hp_jack_present = snd_hda_jack_detect(codec, spec->gen.autocfg.hp_pins[0]);
386 struct conexant_spec *spec = codec->spec;
390 spec->parse_flags |= HDA_PINCFG_HEADPHONE_MIC;
391 snd_hdac_regmap_add_vendor_verb(&codec->core, 0x410);
394 WARN_ON(spec->gen.cap_sync_hook);
395 spec->gen.cap_sync_hook = cxt_update_headset_mode_hook;
396 spec->gen.automute_hook = cxt_update_headset_mode;
407 struct conexant_spec *spec = codec->spec;
411 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
418 /* OLPC XO-1.5 supports DC input mode (e.g. for use with analog sensors)
440 struct conexant_spec *spec = codec->spec;
446 if (!spec->dc_enable)
455 struct conexant_spec *spec = codec->spec;
459 cur_input = spec->gen.input_paths[0][spec->gen.cur_mux[0]];
461 /* Set up mic pins for port-B, C and F dynamically as the recording
464 if (!spec->dc_enable) {
467 snd_hda_activate_path(codec, spec->dc_mode_path, false, false);
476 update_mic_pin(codec, 0x1a, spec->recording ?
478 update_mic_pin(codec, 0x1b, spec->recording ?
495 if (spec->recording)
496 val = olpc_xo_dc_bias.items[spec->dc_input_bias].index;
502 update_mic_pin(codec, 0x1e, spec->recording ? PIN_IN : 0);
503 snd_hda_activate_path(codec, spec->dc_mode_path, true, false);
511 struct conexant_spec *spec = codec->spec;
514 if (!spec->dc_enable)
517 if (spec->dc_enable)
527 struct conexant_spec *spec = codec->spec;
529 /* toggle spec->recording flag and update mic pins accordingly
534 spec->recording = 1;
538 spec->recording = 0;
548 struct conexant_spec *spec = codec->spec;
549 ucontrol->value.integer.value[0] = spec->dc_enable;
557 struct conexant_spec *spec = codec->spec;
558 int dc_enable = !!ucontrol->value.integer.value[0];
560 if (dc_enable == spec->dc_enable)
563 spec->dc_enable = dc_enable;
573 struct conexant_spec *spec = codec->spec;
574 ucontrol->value.enumerated.item[0] = spec->dc_input_bias;
588 struct conexant_spec *spec = codec->spec;
592 idx = ucontrol->value.enumerated.item[0];
593 if (idx >= imux->num_items)
594 idx = imux->num_items - 1;
595 if (spec->dc_input_bias == idx)
598 spec->dc_input_bias = idx;
599 if (spec->dc_enable)
629 struct conexant_spec *spec = codec->spec;
631 if (ret > 0 && spec->dc_enable)
639 struct conexant_spec *spec = codec->spec;
646 spec->gen.mic_autoswitch_hook = olpc_xo_automic;
647 spec->gen.pcm_capture_hook = olpc_xo_capture_hook;
648 spec->dc_mode_path = snd_hda_add_new_path(codec, 0x1e, 0x14, 0);
659 snd_array_for_each(&spec->gen.kctls, i, kctl) {
660 if (!strcmp(kctl->name, "Mic Boost Volume")) {
661 kctl->put = olpc_xo_mic_boost_put;
670 struct conexant_spec *spec = codec->spec;
673 spec->mute_led_eapd = 0x1b;
674 spec->dynamic_eapd = true;
722 struct conexant_spec *spec = codec->spec;
723 unsigned int oldval = spec->gpio_led;
725 if (spec->mute_led_polarity)
729 spec->gpio_led |= mask;
731 spec->gpio_led &= ~mask;
733 mask, led_on, spec->gpio_led);
734 if (spec->gpio_led != oldval)
736 spec->gpio_led);
743 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
744 struct conexant_spec *spec = codec->spec;
746 cxt_update_gpio_led(codec, spec->gpio_mute_led_mask, brightness);
750 /* turn on/off mic-mute LED via GPIO per capture hook */
754 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
755 struct conexant_spec *spec = codec->spec;
757 cxt_update_gpio_led(codec, spec->gpio_mic_led_mask, brightness);
764 struct conexant_spec *spec = codec->spec;
766 spec->gpio_led = 0;
767 spec->mute_led_polarity = 0;
770 spec->gpio_mute_led_mask = mute;
774 spec->gpio_mic_led_mask = mic_mute;
807 // Init vers in BIOS mute the spk/hp by set gpio high to avoid pop noise,
815 { 0x16, 0x042140ff }, /* HP (seq# overridden) */
816 { 0x17, 0x21a11000 }, /* dock-mic */
817 { 0x19, 0x2121103f }, /* dock-HP */
824 { 0x19, 0x042110ff }, /* HP (seq# overridden) */
825 { 0x1a, 0x21a190f0 }, /* dock-mic */
826 { 0x1c, 0x212140ff }, /* dock-HP */
842 /* SuoWoSi/South-holding JS201D with sn6140 */
844 { 0x16, 0x03211040 }, /* hp out */
942 { 0x10, 0x961701f0 }, /* speaker/hp */
968 { 0x16, 0x21011020 }, /* line-out */
969 { 0x18, 0x2181103f }, /* line-in */
1030 SND_PCI_QUIRK(0x103c, 0x30d5, "HP 530", CXT_FIXUP_HP_530),
1032 /* HP, Packard Bell, Fujitsu-Siemens & Lenovo laptops have
1035 SND_PCI_QUIRK_VENDOR(0x103c, "HP", CXT_FIXUP_CAP_MIX_AMP),
1043 { .id = CXT_FIXUP_CAP_MIX_AMP, .name = "cap-mix-amp" },
1044 { .id = CXT_FIXUP_TOSHIBA_P105, .name = "toshiba-p105" },
1045 { .id = CXT_FIXUP_HP_530, .name = "hp-530" },
1050 /* HP laptops have really bad sound over 0 dB on NID 0x10.
1052 SND_PCI_QUIRK_VENDOR(0x103c, "HP", CXT_FIXUP_CAP_MIX_AMP_5047),
1057 { .id = CXT_FIXUP_CAP_MIX_AMP_5047, .name = "cap-mix-amp" },
1068 { .id = CXT_PINCFG_LENOVO_X200, .name = "lenovo-x200" },
1076 SND_PCI_QUIRK(0x103c, 0x8079, "HP EliteBook 840 G3", CXT_FIXUP_HP_DOCK),
1077 SND_PCI_QUIRK(0x103c, 0x807C, "HP EliteBook 820 G3", CXT_FIXUP_HP_DOCK),
1078 SND_PCI_QUIRK(0x103c, 0x80FD, "HP ProBook 640 G2", CXT_FIXUP_HP_DOCK),
1079 SND_PCI_QUIRK(0x103c, 0x8115, "HP Z1 Gen3", CXT_FIXUP_HP_GATE_MIC),
1080 SND_PCI_QUIRK(0x103c, 0x814f, "HP ZBook 15u G3", CXT_FIXUP_MUTE_LED_GPIO),
1081 SND_PCI_QUIRK(0x103c, 0x8174, "HP Spectre x360", CXT_FIXUP_HP_SPECTRE),
1082 SND_PCI_QUIRK(0x103c, 0x822e, "HP ProBook 440 G4", CXT_FIXUP_MUTE_LED_GPIO),
1083 SND_PCI_QUIRK(0x103c, 0x828c, "HP EliteBook 840 G4", CXT_FIXUP_HP_DOCK),
1084 SND_PCI_QUIRK(0x103c, 0x8299, "HP 800 G3 SFF", CXT_FIXUP_HP_MIC_NO_PRESENCE),
1085 SND_PCI_QUIRK(0x103c, 0x829a, "HP 800 G3 DM", CXT_FIXUP_HP_MIC_NO_PRESENCE),
1086 SND_PCI_QUIRK(0x103c, 0x82b4, "HP ProDesk 600 G3", CXT_FIXUP_HP_MIC_NO_PRESENCE),
1087 SND_PCI_QUIRK(0x103c, 0x836e, "HP ProBook 455 G5", CXT_FIXUP_MUTE_LED_GPIO),
1088 SND_PCI_QUIRK(0x103c, 0x837f, "HP ProBook 470 G5", CXT_FIXUP_MUTE_LED_GPIO),
1089 SND_PCI_QUIRK(0x103c, 0x83b2, "HP EliteBook 840 G5", CXT_FIXUP_HP_DOCK),
1090 SND_PCI_QUIRK(0x103c, 0x83b3, "HP EliteBook 830 G5", CXT_FIXUP_HP_DOCK),
1091 SND_PCI_QUIRK(0x103c, 0x83d3, "HP ProBook 640 G4", CXT_FIXUP_HP_DOCK),
1092 SND_PCI_QUIRK(0x103c, 0x83e5, "HP EliteOne 1000 G2", CXT_FIXUP_HP_ELITEONE_OUT_DIS),
1093 SND_PCI_QUIRK(0x103c, 0x8402, "HP ProBook 645 G4", CXT_FIXUP_MUTE_LED_GPIO),
1094 SND_PCI_QUIRK(0x103c, 0x8427, "HP ZBook Studio G5", CXT_FIXUP_HP_ZBOOK_MUTE_LED),
1095 SND_PCI_QUIRK(0x103c, 0x844f, "HP ZBook Studio G5", CXT_FIXUP_HP_ZBOOK_MUTE_LED),
1096 SND_PCI_QUIRK(0x103c, 0x8455, "HP Z2 G4", CXT_FIXUP_HP_MIC_NO_PRESENCE),
1097 SND_PCI_QUIRK(0x103c, 0x8456, "HP Z2 G4 SFF", CXT_FIXUP_HP_MIC_NO_PRESENCE),
1098 SND_PCI_QUIRK(0x103c, 0x8457, "HP Z2 G4 mini", CXT_FIXUP_HP_MIC_NO_PRESENCE),
1099 SND_PCI_QUIRK(0x103c, 0x8458, "HP Z2 G4 mini premium", CXT_FIXUP_HP_MIC_NO_PRESENCE),
1101 SND_PCI_QUIRK(0x14f1, 0x0252, "MBX-Z60MR100", CXT_FIXUP_HP_A_U),
1103 SND_PCI_QUIRK(0x152d, 0x0833, "OLPC XO-1.5", CXT_FIXUP_OLPC_XO),
1111 SND_PCI_QUIRK(0x17aa, 0x21db, "Lenovo X220-tablet", CXT_PINCFG_LENOVO_TP410),
1113 SND_PCI_QUIRK(0x17aa, 0x3905, "Lenovo G50-30", CXT_FIXUP_STEREO_DMIC),
1114 SND_PCI_QUIRK(0x17aa, 0x390b, "Lenovo G50-80", CXT_FIXUP_STEREO_DMIC),
1120 SND_PCI_QUIRK(0x17aa, 0x3978, "Lenovo G50-70", CXT_FIXUP_STEREO_DMIC),
1131 { .id = CXT_FIXUP_STEREO_DMIC, .name = "stereo-dmic" },
1133 { .id = CXT_FIXUP_HEADPHONE_MIC_PIN, .name = "headphone-mic-pin" },
1136 { .id = CXT_PINCFG_LEMOTE_A1004, .name = "lemote-a1004" },
1137 { .id = CXT_PINCFG_LEMOTE_A1205, .name = "lemote-a1205" },
1138 { .id = CXT_FIXUP_OLPC_XO, .name = "olpc-xo" },
1139 { .id = CXT_FIXUP_MUTE_LED_EAPD, .name = "mute-led-eapd" },
1140 { .id = CXT_FIXUP_HP_DOCK, .name = "hp-dock" },
1141 { .id = CXT_FIXUP_MUTE_LED_GPIO, .name = "mute-led-gpio" },
1142 { .id = CXT_FIXUP_HP_ZBOOK_MUTE_LED, .name = "hp-zbook-mute-led" },
1143 { .id = CXT_FIXUP_HP_MIC_NO_PRESENCE, .name = "hp-mic-fix" },
1144 { .id = CXT_PINCFG_LENOVO_NOTEBOOK, .name = "lenovo-20149" },
1145 { .id = CXT_PINCFG_SWS_JS201D, .name = "sws-js201d" },
1146 { .id = CXT_PINCFG_TOP_SPEAKER, .name = "sirius-top-speaker" },
1147 { .id = CXT_FIXUP_HP_A_U, .name = "HP-U-support" },
1151 /* add "fake" mute amp-caps to DACs on cx5051 so that mixer mute switches
1156 struct conexant_spec *spec = codec->spec;
1166 spec->gen.dac_min_mute = true;
1174 codec_info(codec, "%s: BIOS auto-probing.\n", codec->core.chip_name);
1178 return -ENOMEM;
1179 snd_hda_gen_spec_init(&spec->gen);
1180 codec->spec = spec;
1181 codec->patch_ops = cx_auto_patch_ops;
1184 switch (codec->core.vendor_id) {
1187 spec->is_cx8070_sn6140 = true;
1193 spec->gen.own_eapd_ctl = 1;
1195 switch (codec->core.vendor_id) {
1197 codec->single_adc_amp = 1;
1198 spec->gen.mixer_nid = 0x17;
1199 spec->gen.add_stereo_mix_input = HDA_HINT_STEREO_MIX_AUTO;
1204 codec->pin_amp_workaround = 1;
1205 spec->gen.mixer_nid = 0x19;
1206 spec->gen.add_stereo_mix_input = HDA_HINT_STEREO_MIX_AUTO;
1212 codec->pin_amp_workaround = 1;
1217 codec->pin_amp_workaround = 1;
1218 spec->gen.mixer_nid = 0x22;
1219 spec->gen.add_stereo_mix_input = HDA_HINT_STEREO_MIX_AUTO;
1224 codec->power_save_node = 1;
1227 codec->pin_amp_workaround = 1;
1233 if (!spec->gen.vmaster_mute.hook && spec->dynamic_eapd)
1234 spec->gen.vmaster_mute.hook = cx_auto_vmaster_hook;
1238 err = snd_hda_parse_pin_defcfg(codec, &spec->gen.autocfg, NULL,
1239 spec->parse_flags);
1247 err = snd_hda_gen_parse_auto_config(codec, &spec->gen.autocfg);
1252 * which falls into the single-cmd mode.
1255 if (!codec->bus->core.sync_write) {
1258 codec->bus->core.sync_write = 1;
1259 codec->bus->allow_bus_reset = 1;
1313 MODULE_DESCRIPTION("Conexant HD-audio codec");