Lines Matching refs:codec

109 	void (*init_hook)(struct hda_codec *codec);
111 void (*power_hook)(struct hda_codec *codec);
113 void (*shutup)(struct hda_codec *codec);
114 void (*reboot_notify)(struct hda_codec *codec);
133 static int alc_read_coefex_idx(struct hda_codec *codec, hda_nid_t nid, in alc_read_coefex_idx() argument
138 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_COEF_INDEX, coef_idx); in alc_read_coefex_idx()
139 val = snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_PROC_COEF, 0); in alc_read_coefex_idx()
143 #define alc_read_coef_idx(codec, coef_idx) \ argument
144 alc_read_coefex_idx(codec, 0x20, coef_idx)
146 static void alc_write_coefex_idx(struct hda_codec *codec, hda_nid_t nid, in alc_write_coefex_idx() argument
149 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_COEF_INDEX, coef_idx); in alc_write_coefex_idx()
150 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_PROC_COEF, coef_val); in alc_write_coefex_idx()
153 #define alc_write_coef_idx(codec, coef_idx, coef_val) \ argument
154 alc_write_coefex_idx(codec, 0x20, coef_idx, coef_val)
156 static void alc_update_coefex_idx(struct hda_codec *codec, hda_nid_t nid, in alc_update_coefex_idx() argument
160 unsigned int val = alc_read_coefex_idx(codec, nid, coef_idx); in alc_update_coefex_idx()
163 alc_write_coefex_idx(codec, nid, coef_idx, in alc_update_coefex_idx()
167 #define alc_update_coef_idx(codec, coef_idx, mask, bits_set) \ argument
168 alc_update_coefex_idx(codec, 0x20, coef_idx, mask, bits_set)
171 static unsigned int alc_get_coef0(struct hda_codec *codec) in alc_get_coef0() argument
173 struct alc_spec *spec = codec->spec; in alc_get_coef0()
176 spec->coef0 = alc_read_coef_idx(codec, 0); in alc_get_coef0()
194 static void alc_process_coef_fw(struct hda_codec *codec, in alc_process_coef_fw() argument
199 alc_write_coefex_idx(codec, fw->nid, fw->idx, fw->val); in alc_process_coef_fw()
201 alc_update_coefex_idx(codec, fw->nid, fw->idx, in alc_process_coef_fw()
211 static void alc_setup_gpio(struct hda_codec *codec, unsigned int mask) in alc_setup_gpio() argument
213 struct alc_spec *spec = codec->spec; in alc_setup_gpio()
220 static void alc_write_gpio_data(struct hda_codec *codec) in alc_write_gpio_data() argument
222 struct alc_spec *spec = codec->spec; in alc_write_gpio_data()
224 snd_hda_codec_write(codec, 0x01, 0, AC_VERB_SET_GPIO_DATA, in alc_write_gpio_data()
228 static void alc_update_gpio_data(struct hda_codec *codec, unsigned int mask, in alc_update_gpio_data() argument
231 struct alc_spec *spec = codec->spec; in alc_update_gpio_data()
239 alc_write_gpio_data(codec); in alc_update_gpio_data()
242 static void alc_write_gpio(struct hda_codec *codec) in alc_write_gpio() argument
244 struct alc_spec *spec = codec->spec; in alc_write_gpio()
249 snd_hda_codec_write(codec, codec->core.afg, 0, in alc_write_gpio()
251 snd_hda_codec_write(codec, codec->core.afg, 0, in alc_write_gpio()
255 alc_write_gpio_data(codec); in alc_write_gpio()
258 static void alc_fixup_gpio(struct hda_codec *codec, int action, in alc_fixup_gpio() argument
262 alc_setup_gpio(codec, mask); in alc_fixup_gpio()
265 static void alc_fixup_gpio1(struct hda_codec *codec, in alc_fixup_gpio1() argument
268 alc_fixup_gpio(codec, action, 0x01); in alc_fixup_gpio1()
271 static void alc_fixup_gpio2(struct hda_codec *codec, in alc_fixup_gpio2() argument
274 alc_fixup_gpio(codec, action, 0x02); in alc_fixup_gpio2()
277 static void alc_fixup_gpio3(struct hda_codec *codec, in alc_fixup_gpio3() argument
280 alc_fixup_gpio(codec, action, 0x03); in alc_fixup_gpio3()
283 static void alc_fixup_gpio4(struct hda_codec *codec, in alc_fixup_gpio4() argument
286 alc_fixup_gpio(codec, action, 0x04); in alc_fixup_gpio4()
294 static void alc_fix_pll(struct hda_codec *codec) in alc_fix_pll() argument
296 struct alc_spec *spec = codec->spec; in alc_fix_pll()
299 alc_update_coefex_idx(codec, spec->pll_nid, spec->pll_coef_idx, in alc_fix_pll()
303 static void alc_fix_pll_init(struct hda_codec *codec, hda_nid_t nid, in alc_fix_pll_init() argument
306 struct alc_spec *spec = codec->spec; in alc_fix_pll_init()
310 alc_fix_pll(codec); in alc_fix_pll_init()
314 static void alc_update_knob_master(struct hda_codec *codec, in alc_update_knob_master() argument
321 kctl = snd_hda_find_mixer_ctl(codec, "Master Playback Volume"); in alc_update_knob_master()
327 val = snd_hda_codec_read(codec, jack->nid, 0, in alc_update_knob_master()
336 static void alc880_unsol_event(struct hda_codec *codec, unsigned int res) in alc880_unsol_event() argument
340 snd_hda_jack_unsol_event(codec, res >> 2); in alc880_unsol_event()
344 static void alc_fill_eapd_coef(struct hda_codec *codec) in alc_fill_eapd_coef() argument
348 coef = alc_get_coef0(codec); in alc_fill_eapd_coef()
350 switch (codec->core.vendor_id) { in alc_fill_eapd_coef()
352 alc_update_coef_idx(codec, 0x7, 0, 1<<5); in alc_fill_eapd_coef()
356 alc_update_coef_idx(codec, 0x7, 0, 1<<13); in alc_fill_eapd_coef()
360 alc_update_coef_idx(codec, 0xd, 0, 1<<14); in alc_fill_eapd_coef()
362 alc_update_coef_idx(codec, 0x4, 1<<15, 0); in alc_fill_eapd_coef()
364 alc_update_coef_idx(codec, 0x10, 1<<9, 0); in alc_fill_eapd_coef()
370 alc_update_coef_idx(codec, 0x4, 1<<15, 0); in alc_fill_eapd_coef()
375 alc_update_coef_idx(codec, 0x67, 0xf000, 0x3000); in alc_fill_eapd_coef()
391 alc_update_coef_idx(codec, 0x10, 1<<9, 0); in alc_fill_eapd_coef()
394 alc_update_coef_idx(codec, 0xe, 0, 1<<0); in alc_fill_eapd_coef()
397 alc_update_coef_idx(codec, 0xa, 1<<13, 0); in alc_fill_eapd_coef()
405 alc_update_coef_idx(codec, 0x10, 1<<15, 0); in alc_fill_eapd_coef()
409 alc_update_coef_idx(codec, 0x4, 1<<10, 0); /* EAPD Ctrl */ in alc_fill_eapd_coef()
418 alc_update_coef_idx(codec, 0xd, 0, 1<<14); /* EAPD Ctrl */ in alc_fill_eapd_coef()
421 alc_update_coef_idx(codec, 0x7, 3<<13, 0); in alc_fill_eapd_coef()
424 alc_update_coef_idx(codec, 0x4, 1<<10, 0); in alc_fill_eapd_coef()
428 alc_update_coef_idx(codec, 0x7, 1<<5, 0); in alc_fill_eapd_coef()
431 alc_update_coef_idx(codec, 0x7, 1<<5, 0); in alc_fill_eapd_coef()
437 alc_update_coef_idx(codec, 0x7, 1<<1, 0); in alc_fill_eapd_coef()
443 static void alc888_coef_init(struct hda_codec *codec) in alc888_coef_init() argument
445 switch (alc_get_coef0(codec) & 0x00f0) { in alc888_coef_init()
450 alc_update_coef_idx(codec, 7, 0, 0x2030); /* Turn EAPD to High */ in alc888_coef_init()
456 static void set_eapd(struct hda_codec *codec, hda_nid_t nid, int on) in set_eapd() argument
458 if (get_wcaps_type(get_wcaps(codec, nid)) != AC_WID_PIN) in set_eapd()
460 if (snd_hda_query_pin_caps(codec, nid) & AC_PINCAP_EAPD) in set_eapd()
461 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_EAPD_BTLENABLE, in set_eapd()
466 static void alc_auto_setup_eapd(struct hda_codec *codec, bool on) in alc_auto_setup_eapd() argument
474 set_eapd(codec, *p, on); in alc_auto_setup_eapd()
480 static void alc_eapd_shutup(struct hda_codec *codec) in alc_eapd_shutup() argument
482 struct alc_spec *spec = codec->spec; in alc_eapd_shutup()
484 alc_auto_setup_eapd(codec, false); in alc_eapd_shutup()
487 snd_hda_shutup_pins(codec); in alc_eapd_shutup()
491 static void alc_auto_init_amp(struct hda_codec *codec, int type) in alc_auto_init_amp() argument
493 alc_fill_eapd_coef(codec); in alc_auto_init_amp()
494 alc_auto_setup_eapd(codec, true); in alc_auto_init_amp()
495 alc_write_gpio(codec); in alc_auto_init_amp()
498 switch (codec->core.vendor_id) { in alc_auto_init_amp()
500 alc_update_coefex_idx(codec, 0x1a, 7, 0, 0x2010); in alc_auto_init_amp()
506 alc_update_coef_idx(codec, 7, 0, 0x2030); in alc_auto_init_amp()
509 alc888_coef_init(codec); in alc_auto_init_amp()
526 static void alc_fixup_sku_ignore(struct hda_codec *codec, in alc_fixup_sku_ignore() argument
529 struct alc_spec *spec = codec->spec; in alc_fixup_sku_ignore()
536 static void alc_fixup_no_depop_delay(struct hda_codec *codec, in alc_fixup_no_depop_delay() argument
539 struct alc_spec *spec = codec->spec; in alc_fixup_no_depop_delay()
543 codec->depop_delay = 0; in alc_fixup_no_depop_delay()
547 static int alc_auto_parse_customize_define(struct hda_codec *codec) in alc_auto_parse_customize_define() argument
551 struct alc_spec *spec = codec->spec; in alc_auto_parse_customize_define()
562 if (!codec->bus->pci) in alc_auto_parse_customize_define()
564 ass = codec->core.subsystem_id & 0xffff; in alc_auto_parse_customize_define()
565 if (ass != codec->bus->pci->subsystem_device && (ass & 1)) in alc_auto_parse_customize_define()
569 if (codec->core.vendor_id == 0x10ec0260) in alc_auto_parse_customize_define()
571 ass = snd_hda_codec_get_pincfg(codec, nid); in alc_auto_parse_customize_define()
574 codec_info(codec, "%s: SKU not ready 0x%08x\n", in alc_auto_parse_customize_define()
575 codec->core.chip_name, ass); in alc_auto_parse_customize_define()
599 codec_dbg(codec, "SKU: Nid=0x%x sku_cfg=0x%08x\n", in alc_auto_parse_customize_define()
601 codec_dbg(codec, "SKU: port_connectivity=0x%x\n", in alc_auto_parse_customize_define()
603 codec_dbg(codec, "SKU: enable_pcbeep=0x%x\n", spec->cdefine.enable_pcbeep); in alc_auto_parse_customize_define()
604 codec_dbg(codec, "SKU: check_sum=0x%08x\n", spec->cdefine.check_sum); in alc_auto_parse_customize_define()
605 codec_dbg(codec, "SKU: customization=0x%08x\n", spec->cdefine.customization); in alc_auto_parse_customize_define()
606 codec_dbg(codec, "SKU: external_amp=0x%x\n", spec->cdefine.external_amp); in alc_auto_parse_customize_define()
607 codec_dbg(codec, "SKU: platform_type=0x%x\n", spec->cdefine.platform_type); in alc_auto_parse_customize_define()
608 codec_dbg(codec, "SKU: swap=0x%x\n", spec->cdefine.swap); in alc_auto_parse_customize_define()
609 codec_dbg(codec, "SKU: override=0x%x\n", spec->cdefine.override); in alc_auto_parse_customize_define()
638 static int alc_subsystem_id(struct hda_codec *codec, const hda_nid_t *ports) in alc_subsystem_id() argument
642 struct alc_spec *spec = codec->spec; in alc_subsystem_id()
651 ass = codec->core.subsystem_id & 0xffff; in alc_subsystem_id()
652 if (codec->bus->pci && in alc_subsystem_id()
653 ass != codec->bus->pci->subsystem_device && (ass & 1)) in alc_subsystem_id()
666 if (codec->core.vendor_id == 0x10ec0260) in alc_subsystem_id()
668 ass = snd_hda_codec_get_pincfg(codec, nid); in alc_subsystem_id()
669 codec_dbg(codec, in alc_subsystem_id()
686 codec_dbg(codec, "realtek: Enabling init ASM_ID=0x%04x CODEC_ID=%08x\n", in alc_subsystem_id()
687 ass & 0xffff, codec->core.vendor_id); in alc_subsystem_id()
699 alc_setup_gpio(codec, 0x01); in alc_subsystem_id()
702 alc_setup_gpio(codec, 0x02); in alc_subsystem_id()
705 alc_setup_gpio(codec, 0x03); in alc_subsystem_id()
742 static void alc_ssid_check(struct hda_codec *codec, const hda_nid_t *ports) in alc_ssid_check() argument
744 if (!alc_subsystem_id(codec, ports)) { in alc_ssid_check()
745 struct alc_spec *spec = codec->spec; in alc_ssid_check()
746 codec_dbg(codec, in alc_ssid_check()
755 static void alc_fixup_inv_dmic(struct hda_codec *codec, in alc_fixup_inv_dmic() argument
758 struct alc_spec *spec = codec->spec; in alc_fixup_inv_dmic()
764 static int alc_build_controls(struct hda_codec *codec) in alc_build_controls() argument
768 err = snd_hda_gen_build_controls(codec); in alc_build_controls()
772 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_BUILD); in alc_build_controls()
781 static int alc_init(struct hda_codec *codec) in alc_init() argument
783 struct alc_spec *spec = codec->spec; in alc_init()
786 spec->init_hook(codec); in alc_init()
788 alc_fix_pll(codec); in alc_init()
789 alc_auto_init_amp(codec, spec->init_amp); in alc_init()
791 snd_hda_gen_init(codec); in alc_init()
793 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_INIT); in alc_init()
798 static inline void alc_shutup(struct hda_codec *codec) in alc_shutup() argument
800 struct alc_spec *spec = codec->spec; in alc_shutup()
802 if (!snd_hda_get_bool_hint(codec, "shutup")) in alc_shutup()
806 spec->shutup(codec); in alc_shutup()
808 snd_hda_shutup_pins(codec); in alc_shutup()
811 static void alc_reboot_notify(struct hda_codec *codec) in alc_reboot_notify() argument
813 struct alc_spec *spec = codec->spec; in alc_reboot_notify()
816 spec->reboot_notify(codec); in alc_reboot_notify()
818 alc_shutup(codec); in alc_reboot_notify()
822 static void alc_d3_at_reboot(struct hda_codec *codec) in alc_d3_at_reboot() argument
824 snd_hda_codec_set_power_to_all(codec, codec->core.afg, AC_PWRST_D3); in alc_d3_at_reboot()
825 snd_hda_codec_write(codec, codec->core.afg, 0, in alc_d3_at_reboot()
833 static void alc_power_eapd(struct hda_codec *codec) in alc_power_eapd() argument
835 alc_auto_setup_eapd(codec, false); in alc_power_eapd()
838 static int alc_suspend(struct hda_codec *codec) in alc_suspend() argument
840 struct alc_spec *spec = codec->spec; in alc_suspend()
841 alc_shutup(codec); in alc_suspend()
843 spec->power_hook(codec); in alc_suspend()
849 static int alc_resume(struct hda_codec *codec) in alc_resume() argument
851 struct alc_spec *spec = codec->spec; in alc_resume()
855 codec->patch_ops.init(codec); in alc_resume()
856 regcache_sync(codec->core.regmap); in alc_resume()
857 hda_call_check_power_status(codec, 0x01); in alc_resume()
879 #define alc_codec_rename(codec, name) snd_hda_codec_set_name(codec, name) argument
950 static int alc_codec_rename_from_preset(struct hda_codec *codec) in alc_codec_rename_from_preset() argument
956 if (p->vendor_id != codec->core.vendor_id) in alc_codec_rename_from_preset()
958 if ((alc_get_coef0(codec) & p->coef_mask) == p->coef_bits) in alc_codec_rename_from_preset()
959 return alc_codec_rename(codec, p->name); in alc_codec_rename_from_preset()
962 if (!codec->bus->pci) in alc_codec_rename_from_preset()
965 if (q->codec_vendor_id != codec->core.vendor_id) in alc_codec_rename_from_preset()
967 if (q->pci_subvendor != codec->bus->pci->subsystem_vendor) in alc_codec_rename_from_preset()
970 q->pci_subdevice == codec->bus->pci->subsystem_device) in alc_codec_rename_from_preset()
971 return alc_codec_rename(codec, q->name); in alc_codec_rename_from_preset()
1020 static inline int has_cdefine_beep(struct hda_codec *codec) in has_cdefine_beep() argument
1022 struct alc_spec *spec = codec->spec; in has_cdefine_beep()
1024 q = snd_pci_quirk_lookup(codec->bus->pci, beep_white_list); in has_cdefine_beep()
1031 #define has_cdefine_beep(codec) 0 argument
1038 static int alc_parse_auto_config(struct hda_codec *codec, in alc_parse_auto_config() argument
1042 struct alc_spec *spec = codec->spec; in alc_parse_auto_config()
1046 err = snd_hda_parse_pin_defcfg(codec, cfg, ignore_nids, in alc_parse_auto_config()
1052 alc_ssid_check(codec, ssid_nids); in alc_parse_auto_config()
1054 err = snd_hda_gen_parse_auto_config(codec, cfg); in alc_parse_auto_config()
1062 static int alc_alloc_spec(struct hda_codec *codec, hda_nid_t mixer_nid) in alc_alloc_spec() argument
1069 codec->spec = spec; in alc_alloc_spec()
1073 codec->single_adc_amp = 1; in alc_alloc_spec()
1075 codec->spdif_status_reset = 1; in alc_alloc_spec()
1076 codec->patch_ops = alc_patch_ops; in alc_alloc_spec()
1078 err = alc_codec_rename_from_preset(codec); in alc_alloc_spec()
1086 static int alc880_parse_auto_config(struct hda_codec *codec) in alc880_parse_auto_config() argument
1090 return alc_parse_auto_config(codec, alc880_ignore, alc880_ssids); in alc880_parse_auto_config()
1125 static void alc880_fixup_vol_knob(struct hda_codec *codec, in alc880_fixup_vol_knob() argument
1129 snd_hda_jack_detect_enable_callback(codec, 0x21, in alc880_fixup_vol_knob()
1508 static int patch_alc880(struct hda_codec *codec) in patch_alc880() argument
1513 err = alc_alloc_spec(codec, 0x0b); in patch_alc880()
1517 spec = codec->spec; in patch_alc880()
1521 codec->patch_ops.unsol_event = alc880_unsol_event; in patch_alc880()
1523 snd_hda_pick_fixup(codec, alc880_fixup_models, alc880_fixup_tbl, in patch_alc880()
1525 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); in patch_alc880()
1528 err = alc880_parse_auto_config(codec); in patch_alc880()
1538 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); in patch_alc880()
1543 alc_free(codec); in patch_alc880()
1551 static int alc260_parse_auto_config(struct hda_codec *codec) in alc260_parse_auto_config() argument
1555 return alc_parse_auto_config(codec, alc260_ignore, alc260_ssids); in alc260_parse_auto_config()
1575 static void alc260_gpio1_automute(struct hda_codec *codec) in alc260_gpio1_automute() argument
1577 struct alc_spec *spec = codec->spec; in alc260_gpio1_automute()
1579 alc_update_gpio_data(codec, 0x01, spec->gen.hp_jack_present); in alc260_gpio1_automute()
1582 static void alc260_fixup_gpio1_toggle(struct hda_codec *codec, in alc260_fixup_gpio1_toggle() argument
1585 struct alc_spec *spec = codec->spec; in alc260_fixup_gpio1_toggle()
1594 snd_hda_jack_detect_enable_callback(codec, 0x0f, in alc260_fixup_gpio1_toggle()
1596 alc_setup_gpio(codec, 0x01); in alc260_fixup_gpio1_toggle()
1600 static void alc260_fixup_kn1(struct hda_codec *codec, in alc260_fixup_kn1() argument
1603 struct alc_spec *spec = codec->spec; in alc260_fixup_kn1()
1622 snd_hda_apply_pincfgs(codec, pincfgs); in alc260_fixup_kn1()
1628 static void alc260_fixup_fsc_s7020(struct hda_codec *codec, in alc260_fixup_fsc_s7020() argument
1631 struct alc_spec *spec = codec->spec; in alc260_fixup_fsc_s7020()
1636 static void alc260_fixup_fsc_s7020_jwse(struct hda_codec *codec, in alc260_fixup_fsc_s7020_jwse() argument
1639 struct alc_spec *spec = codec->spec; in alc260_fixup_fsc_s7020_jwse()
1755 static int patch_alc260(struct hda_codec *codec) in patch_alc260() argument
1760 err = alc_alloc_spec(codec, 0x07); in patch_alc260()
1764 spec = codec->spec; in patch_alc260()
1774 snd_hda_pick_fixup(codec, alc260_fixup_models, alc260_fixup_tbl, in patch_alc260()
1776 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); in patch_alc260()
1779 err = alc260_parse_auto_config(codec); in patch_alc260()
1789 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); in patch_alc260()
1794 alc_free(codec); in patch_alc260()
1851 static void alc889_fixup_coef(struct hda_codec *codec, in alc889_fixup_coef() argument
1856 alc_update_coef_idx(codec, 7, 0, 0x2030); in alc889_fixup_coef()
1860 static void alc885_fixup_macpro_gpio(struct hda_codec *codec, in alc885_fixup_macpro_gpio() argument
1863 struct alc_spec *spec = codec->spec; in alc885_fixup_macpro_gpio()
1866 alc_fixup_gpio3(codec, fix, action); in alc885_fixup_macpro_gpio()
1873 static void alc889_fixup_dac_route(struct hda_codec *codec, in alc889_fixup_dac_route() argument
1880 snd_hda_override_conn_list(codec, 0x14, 2, conn1); in alc889_fixup_dac_route()
1881 snd_hda_override_conn_list(codec, 0x15, 2, conn1); in alc889_fixup_dac_route()
1882 snd_hda_override_conn_list(codec, 0x18, 2, conn2); in alc889_fixup_dac_route()
1883 snd_hda_override_conn_list(codec, 0x1a, 2, conn2); in alc889_fixup_dac_route()
1887 snd_hda_override_conn_list(codec, 0x14, 5, conn); in alc889_fixup_dac_route()
1888 snd_hda_override_conn_list(codec, 0x15, 5, conn); in alc889_fixup_dac_route()
1889 snd_hda_override_conn_list(codec, 0x18, 5, conn); in alc889_fixup_dac_route()
1890 snd_hda_override_conn_list(codec, 0x1a, 5, conn); in alc889_fixup_dac_route()
1895 static void alc889_fixup_mbp_vref(struct hda_codec *codec, in alc889_fixup_mbp_vref() argument
1898 struct alc_spec *spec = codec->spec; in alc889_fixup_mbp_vref()
1905 unsigned int val = snd_hda_codec_get_pincfg(codec, nids[i]); in alc889_fixup_mbp_vref()
1908 val = snd_hda_codec_get_pin_target(codec, nids[i]); in alc889_fixup_mbp_vref()
1910 snd_hda_set_pin_ctl(codec, nids[i], val); in alc889_fixup_mbp_vref()
1916 static void alc889_fixup_mac_pins(struct hda_codec *codec, in alc889_fixup_mac_pins() argument
1919 struct alc_spec *spec = codec->spec; in alc889_fixup_mac_pins()
1924 val = snd_hda_codec_get_pin_target(codec, nids[i]); in alc889_fixup_mac_pins()
1926 snd_hda_set_pin_ctl(codec, nids[i], val); in alc889_fixup_mac_pins()
1932 static void alc889_fixup_imac91_vref(struct hda_codec *codec, in alc889_fixup_imac91_vref() argument
1938 alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids)); in alc889_fixup_imac91_vref()
1942 static void alc889_fixup_mba11_vref(struct hda_codec *codec, in alc889_fixup_mba11_vref() argument
1948 alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids)); in alc889_fixup_mba11_vref()
1952 static void alc889_fixup_mba21_vref(struct hda_codec *codec, in alc889_fixup_mba21_vref() argument
1958 alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids)); in alc889_fixup_mba21_vref()
1965 static void alc882_fixup_no_primary_hp(struct hda_codec *codec, in alc882_fixup_no_primary_hp() argument
1968 struct alc_spec *spec = codec->spec; in alc882_fixup_no_primary_hp()
1975 static void alc_fixup_bass_chmap(struct hda_codec *codec,
1981 static void alc_fixup_dual_codecs(struct hda_codec *codec, in alc_fixup_dual_codecs() argument
1984 struct alc_spec *spec = codec->spec; in alc_fixup_dual_codecs()
1996 codec->force_pin_prefix = 1; in alc_fixup_dual_codecs()
1999 static void rename_ctl(struct hda_codec *codec, const char *oldname, in rename_ctl() argument
2004 kctl = snd_hda_find_mixer_ctl(codec, oldname); in rename_ctl()
2009 static void alc1220_fixup_gb_dual_codecs(struct hda_codec *codec, in alc1220_fixup_gb_dual_codecs() argument
2013 alc_fixup_dual_codecs(codec, fix, action); in alc1220_fixup_gb_dual_codecs()
2017 strcpy(codec->card->longname, "HDAudio-Gigabyte-ALC1220DualCodecs"); in alc1220_fixup_gb_dual_codecs()
2021 rename_ctl(codec, "Capture Volume", in alc1220_fixup_gb_dual_codecs()
2022 codec->addr == 0 ? in alc1220_fixup_gb_dual_codecs()
2025 rename_ctl(codec, "Capture Switch", in alc1220_fixup_gb_dual_codecs()
2026 codec->addr == 0 ? in alc1220_fixup_gb_dual_codecs()
2033 static void alc1220_fixup_clevo_p950(struct hda_codec *codec, in alc1220_fixup_clevo_p950() argument
2042 alc_update_coef_idx(codec, 0x7, 0, 0x3c3); in alc1220_fixup_clevo_p950()
2046 snd_hda_override_conn_list(codec, 0x14, 1, conn1); in alc1220_fixup_clevo_p950()
2047 snd_hda_override_conn_list(codec, 0x1b, 1, conn1); in alc1220_fixup_clevo_p950()
2416 static int alc882_parse_auto_config(struct hda_codec *codec) in alc882_parse_auto_config() argument
2420 return alc_parse_auto_config(codec, alc882_ignore, alc882_ssids); in alc882_parse_auto_config()
2425 static int patch_alc882(struct hda_codec *codec) in patch_alc882() argument
2430 err = alc_alloc_spec(codec, 0x0b); in patch_alc882()
2434 spec = codec->spec; in patch_alc882()
2436 switch (codec->core.vendor_id) { in patch_alc882()
2444 alc_fix_pll_init(codec, 0x20, 0x0a, 10); in patch_alc882()
2448 snd_hda_pick_fixup(codec, alc882_fixup_models, alc882_fixup_tbl, in patch_alc882()
2450 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); in patch_alc882()
2452 alc_auto_parse_customize_define(codec); in patch_alc882()
2454 if (has_cdefine_beep(codec)) in patch_alc882()
2458 err = alc882_parse_auto_config(codec); in patch_alc882()
2468 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); in patch_alc882()
2473 alc_free(codec); in patch_alc882()
2481 static int alc262_parse_auto_config(struct hda_codec *codec) in alc262_parse_auto_config() argument
2485 return alc_parse_auto_config(codec, alc262_ignore, alc262_ssids); in alc262_parse_auto_config()
2600 static int patch_alc262(struct hda_codec *codec) in patch_alc262() argument
2605 err = alc_alloc_spec(codec, 0x0b); in patch_alc262()
2609 spec = codec->spec; in patch_alc262()
2618 alc_update_coefex_idx(codec, 0x1a, 7, 0, 0x80); in patch_alc262()
2620 alc_fix_pll_init(codec, 0x20, 0x0a, 10); in patch_alc262()
2622 snd_hda_pick_fixup(codec, alc262_fixup_models, alc262_fixup_tbl, in patch_alc262()
2624 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); in patch_alc262()
2626 alc_auto_parse_customize_define(codec); in patch_alc262()
2628 if (has_cdefine_beep(codec)) in patch_alc262()
2632 err = alc262_parse_auto_config(codec); in patch_alc262()
2642 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); in patch_alc262()
2647 alc_free(codec); in patch_alc262()
2658 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); in alc268_beep_switch_put() local
2662 mutex_lock(&codec->control_mutex); in alc268_beep_switch_put()
2671 mutex_unlock(&codec->control_mutex); in alc268_beep_switch_put()
2743 static int alc268_parse_auto_config(struct hda_codec *codec) in alc268_parse_auto_config() argument
2746 return alc_parse_auto_config(codec, NULL, alc268_ssids); in alc268_parse_auto_config()
2751 static int patch_alc268(struct hda_codec *codec) in patch_alc268() argument
2757 err = alc_alloc_spec(codec, 0); in patch_alc268()
2761 spec = codec->spec; in patch_alc268()
2766 snd_hda_pick_fixup(codec, alc268_fixup_models, alc268_fixup_tbl, alc268_fixups); in patch_alc268()
2767 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); in patch_alc268()
2770 err = alc268_parse_auto_config(codec); in patch_alc268()
2783 snd_hda_add_verbs(codec, alc268_beep_init_verbs); in patch_alc268()
2784 if (!query_amp_caps(codec, 0x1d, HDA_INPUT)) in patch_alc268()
2786 snd_hda_override_amp_caps(codec, 0x1d, HDA_INPUT, in patch_alc268()
2793 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); in patch_alc268()
2798 alc_free(codec); in patch_alc268()
2839 static int alc269_parse_auto_config(struct hda_codec *codec) in alc269_parse_auto_config() argument
2844 struct alc_spec *spec = codec->spec; in alc269_parse_auto_config()
2875 return alc_parse_auto_config(codec, alc269_ignore, ssids); in alc269_parse_auto_config()
2878 static int find_ext_mic_pin(struct hda_codec *codec);
2880 static void alc286_shutup(struct hda_codec *codec) in alc286_shutup() argument
2884 int mic_pin = find_ext_mic_pin(codec); in alc286_shutup()
2888 if (codec->bus->shutdown) in alc286_shutup()
2890 snd_array_for_each(&codec->init_pins, i, pin) { in alc286_shutup()
2893 snd_hda_codec_read(codec, pin->nid, 0, in alc286_shutup()
2896 codec->pins_shutup = 1; in alc286_shutup()
2899 static void alc269vb_toggle_power_output(struct hda_codec *codec, int power_up) in alc269vb_toggle_power_output() argument
2901 alc_update_coef_idx(codec, 0x04, 1 << 11, power_up ? (1 << 11) : 0); in alc269vb_toggle_power_output()
2904 static void alc269_shutup(struct hda_codec *codec) in alc269_shutup() argument
2906 struct alc_spec *spec = codec->spec; in alc269_shutup()
2909 alc269vb_toggle_power_output(codec, 0); in alc269_shutup()
2911 (alc_get_coef0(codec) & 0x00ff) == 0x018) { in alc269_shutup()
2914 snd_hda_shutup_pins(codec); in alc269_shutup()
2950 static void alc282_restore_default_value(struct hda_codec *codec) in alc282_restore_default_value() argument
2952 alc_process_coef_fw(codec, alc282_coefs); in alc282_restore_default_value()
2955 static void alc282_init(struct hda_codec *codec) in alc282_init() argument
2957 struct alc_spec *spec = codec->spec; in alc282_init()
2962 alc282_restore_default_value(codec); in alc282_init()
2966 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); in alc282_init()
2967 coef78 = alc_read_coef_idx(codec, 0x78); in alc282_init()
2971 alc_write_coef_idx(codec, 0x78, 0x9004); in alc282_init()
2976 snd_hda_codec_write(codec, hp_pin, 0, in alc282_init()
2982 snd_hda_codec_write(codec, hp_pin, 0, in alc282_init()
2989 alc_write_coef_idx(codec, 0x78, coef78); in alc282_init()
2992 static void alc282_shutup(struct hda_codec *codec) in alc282_shutup() argument
2994 struct alc_spec *spec = codec->spec; in alc282_shutup()
3000 alc269_shutup(codec); in alc282_shutup()
3004 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); in alc282_shutup()
3005 coef78 = alc_read_coef_idx(codec, 0x78); in alc282_shutup()
3006 alc_write_coef_idx(codec, 0x78, 0x9004); in alc282_shutup()
3011 snd_hda_codec_write(codec, hp_pin, 0, in alc282_shutup()
3017 snd_hda_codec_write(codec, hp_pin, 0, in alc282_shutup()
3023 alc_auto_setup_eapd(codec, false); in alc282_shutup()
3024 snd_hda_shutup_pins(codec); in alc282_shutup()
3025 alc_write_coef_idx(codec, 0x78, coef78); in alc282_shutup()
3065 static void alc283_restore_default_value(struct hda_codec *codec) in alc283_restore_default_value() argument
3067 alc_process_coef_fw(codec, alc283_coefs); in alc283_restore_default_value()
3070 static void alc283_init(struct hda_codec *codec) in alc283_init() argument
3072 struct alc_spec *spec = codec->spec; in alc283_init()
3081 alc283_restore_default_value(codec); in alc283_init()
3087 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); in alc283_init()
3091 alc_write_coef_idx(codec, 0x43, 0x9004); in alc283_init()
3093 snd_hda_codec_write(codec, hp_pin, 0, in alc283_init()
3099 snd_hda_codec_write(codec, hp_pin, 0, in alc283_init()
3106 alc_update_coef_idx(codec, 0x46, 3 << 12, 0); in alc283_init()
3108 alc_write_coef_idx(codec, 0x43, 0x9614); in alc283_init()
3111 static void alc283_shutup(struct hda_codec *codec) in alc283_shutup() argument
3113 struct alc_spec *spec = codec->spec; in alc283_shutup()
3123 alc269_shutup(codec); in alc283_shutup()
3127 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); in alc283_shutup()
3129 alc_write_coef_idx(codec, 0x43, 0x9004); in alc283_shutup()
3132 alc_write_coef_idx(codec, 0x06, 0x2100); in alc283_shutup()
3134 snd_hda_codec_write(codec, hp_pin, 0, in alc283_shutup()
3140 snd_hda_codec_write(codec, hp_pin, 0, in alc283_shutup()
3143 alc_update_coef_idx(codec, 0x46, 0, 3 << 12); in alc283_shutup()
3147 alc_auto_setup_eapd(codec, false); in alc283_shutup()
3148 snd_hda_shutup_pins(codec); in alc283_shutup()
3149 alc_write_coef_idx(codec, 0x43, 0x9614); in alc283_shutup()
3152 static void alc256_init(struct hda_codec *codec) in alc256_init() argument
3154 struct alc_spec *spec = codec->spec; in alc256_init()
3163 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); in alc256_init()
3168 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */ in alc256_init()
3170 snd_hda_codec_write(codec, hp_pin, 0, in alc256_init()
3176 snd_hda_codec_write(codec, hp_pin, 0, in alc256_init()
3182 alc_update_coef_idx(codec, 0x46, 3 << 12, 0); in alc256_init()
3183 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x4); /* Hight power */ in alc256_init()
3184 alc_update_coefex_idx(codec, 0x53, 0x02, 0x8000, 1 << 15); /* Clear bit */ in alc256_init()
3185 alc_update_coefex_idx(codec, 0x53, 0x02, 0x8000, 0 << 15); in alc256_init()
3188 static void alc256_shutup(struct hda_codec *codec) in alc256_shutup() argument
3190 struct alc_spec *spec = codec->spec; in alc256_shutup()
3195 alc269_shutup(codec); in alc256_shutup()
3199 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); in alc256_shutup()
3204 snd_hda_codec_write(codec, hp_pin, 0, in alc256_shutup()
3212 alc_update_coef_idx(codec, 0x46, 0, 3 << 12); in alc256_shutup()
3214 snd_hda_codec_write(codec, hp_pin, 0, in alc256_shutup()
3220 alc_auto_setup_eapd(codec, false); in alc256_shutup()
3221 snd_hda_shutup_pins(codec); in alc256_shutup()
3224 static void alc225_init(struct hda_codec *codec) in alc225_init() argument
3226 struct alc_spec *spec = codec->spec; in alc225_init()
3235 hp1_pin_sense = snd_hda_jack_detect(codec, hp_pin); in alc225_init()
3236 hp2_pin_sense = snd_hda_jack_detect(codec, 0x16); in alc225_init()
3241 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */ in alc225_init()
3244 snd_hda_codec_write(codec, hp_pin, 0, in alc225_init()
3247 snd_hda_codec_write(codec, 0x16, 0, in alc225_init()
3254 snd_hda_codec_write(codec, hp_pin, 0, in alc225_init()
3257 snd_hda_codec_write(codec, 0x16, 0, in alc225_init()
3263 alc_update_coef_idx(codec, 0x4a, 3 << 10, 0); in alc225_init()
3264 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x4); /* Hight power */ in alc225_init()
3267 static void alc225_shutup(struct hda_codec *codec) in alc225_shutup() argument
3269 struct alc_spec *spec = codec->spec; in alc225_shutup()
3274 alc269_shutup(codec); in alc225_shutup()
3279 alc_update_coef_idx(codec, 0x4a, 0, 3 << 10); in alc225_shutup()
3281 hp1_pin_sense = snd_hda_jack_detect(codec, hp_pin); in alc225_shutup()
3282 hp2_pin_sense = snd_hda_jack_detect(codec, 0x16); in alc225_shutup()
3288 snd_hda_codec_write(codec, hp_pin, 0, in alc225_shutup()
3291 snd_hda_codec_write(codec, 0x16, 0, in alc225_shutup()
3298 snd_hda_codec_write(codec, hp_pin, 0, in alc225_shutup()
3301 snd_hda_codec_write(codec, 0x16, 0, in alc225_shutup()
3307 alc_auto_setup_eapd(codec, false); in alc225_shutup()
3308 snd_hda_shutup_pins(codec); in alc225_shutup()
3311 static void alc_default_init(struct hda_codec *codec) in alc_default_init() argument
3313 struct alc_spec *spec = codec->spec; in alc_default_init()
3322 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); in alc_default_init()
3327 snd_hda_codec_write(codec, hp_pin, 0, in alc_default_init()
3333 snd_hda_codec_write(codec, hp_pin, 0, in alc_default_init()
3340 static void alc_default_shutup(struct hda_codec *codec) in alc_default_shutup() argument
3342 struct alc_spec *spec = codec->spec; in alc_default_shutup()
3347 alc269_shutup(codec); in alc_default_shutup()
3351 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); in alc_default_shutup()
3356 snd_hda_codec_write(codec, hp_pin, 0, in alc_default_shutup()
3362 snd_hda_codec_write(codec, hp_pin, 0, in alc_default_shutup()
3368 alc_auto_setup_eapd(codec, false); in alc_default_shutup()
3369 snd_hda_shutup_pins(codec); in alc_default_shutup()
3372 static void alc5505_coef_set(struct hda_codec *codec, unsigned int index_reg, in alc5505_coef_set() argument
3375 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_COEF_INDEX, index_reg >> 1); in alc5505_coef_set()
3376 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_PROC_COEF, val & 0xffff); /* LSB */ in alc5505_coef_set()
3377 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_PROC_COEF, val >> 16); /* MSB */ in alc5505_coef_set()
3380 static int alc5505_coef_get(struct hda_codec *codec, unsigned int index_reg) in alc5505_coef_get() argument
3384 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_COEF_INDEX, index_reg >> 1); in alc5505_coef_get()
3385 val = snd_hda_codec_read(codec, 0x51, 0, AC_VERB_GET_PROC_COEF, 0) in alc5505_coef_get()
3387 val |= snd_hda_codec_read(codec, 0x51, 0, AC_VERB_GET_PROC_COEF, 0) in alc5505_coef_get()
3392 static void alc5505_dsp_halt(struct hda_codec *codec) in alc5505_dsp_halt() argument
3396 alc5505_coef_set(codec, 0x3000, 0x000c); /* DSP CPU stop */ in alc5505_dsp_halt()
3397 alc5505_coef_set(codec, 0x880c, 0x0008); /* DDR enter self refresh */ in alc5505_dsp_halt()
3398 alc5505_coef_set(codec, 0x61c0, 0x11110080); /* Clock control for PLL and CPU */ in alc5505_dsp_halt()
3399 alc5505_coef_set(codec, 0x6230, 0xfc0d4011); /* Disable Input OP */ in alc5505_dsp_halt()
3400 alc5505_coef_set(codec, 0x61b4, 0x040a2b03); /* Stop PLL2 */ in alc5505_dsp_halt()
3401 alc5505_coef_set(codec, 0x61b0, 0x00005b17); /* Stop PLL1 */ in alc5505_dsp_halt()
3402 alc5505_coef_set(codec, 0x61b8, 0x04133303); /* Stop PLL3 */ in alc5505_dsp_halt()
3403 val = alc5505_coef_get(codec, 0x6220); in alc5505_dsp_halt()
3404 alc5505_coef_set(codec, 0x6220, (val | 0x3000)); /* switch Ringbuffer clock to DBUS clock */ in alc5505_dsp_halt()
3407 static void alc5505_dsp_back_from_halt(struct hda_codec *codec) in alc5505_dsp_back_from_halt() argument
3409 alc5505_coef_set(codec, 0x61b8, 0x04133302); in alc5505_dsp_back_from_halt()
3410 alc5505_coef_set(codec, 0x61b0, 0x00005b16); in alc5505_dsp_back_from_halt()
3411 alc5505_coef_set(codec, 0x61b4, 0x040a2b02); in alc5505_dsp_back_from_halt()
3412 alc5505_coef_set(codec, 0x6230, 0xf80d4011); in alc5505_dsp_back_from_halt()
3413 alc5505_coef_set(codec, 0x6220, 0x2002010f); in alc5505_dsp_back_from_halt()
3414 alc5505_coef_set(codec, 0x880c, 0x00000004); in alc5505_dsp_back_from_halt()
3417 static void alc5505_dsp_init(struct hda_codec *codec) in alc5505_dsp_init() argument
3421 alc5505_dsp_halt(codec); in alc5505_dsp_init()
3422 alc5505_dsp_back_from_halt(codec); in alc5505_dsp_init()
3423 alc5505_coef_set(codec, 0x61b0, 0x5b14); /* PLL1 control */ in alc5505_dsp_init()
3424 alc5505_coef_set(codec, 0x61b0, 0x5b16); in alc5505_dsp_init()
3425 alc5505_coef_set(codec, 0x61b4, 0x04132b00); /* PLL2 control */ in alc5505_dsp_init()
3426 alc5505_coef_set(codec, 0x61b4, 0x04132b02); in alc5505_dsp_init()
3427 alc5505_coef_set(codec, 0x61b8, 0x041f3300); /* PLL3 control*/ in alc5505_dsp_init()
3428 alc5505_coef_set(codec, 0x61b8, 0x041f3302); in alc5505_dsp_init()
3429 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_CODEC_RESET, 0); /* Function reset */ in alc5505_dsp_init()
3430 alc5505_coef_set(codec, 0x61b8, 0x041b3302); in alc5505_dsp_init()
3431 alc5505_coef_set(codec, 0x61b8, 0x04173302); in alc5505_dsp_init()
3432 alc5505_coef_set(codec, 0x61b8, 0x04163302); in alc5505_dsp_init()
3433 alc5505_coef_set(codec, 0x8800, 0x348b328b); /* DRAM control */ in alc5505_dsp_init()
3434 alc5505_coef_set(codec, 0x8808, 0x00020022); /* DRAM control */ in alc5505_dsp_init()
3435 alc5505_coef_set(codec, 0x8818, 0x00000400); /* DRAM control */ in alc5505_dsp_init()
3437 val = alc5505_coef_get(codec, 0x6200) >> 16; /* Read revision ID */ in alc5505_dsp_init()
3439 alc5505_coef_set(codec, 0x6220, 0x2002010f); /* I/O PAD Configuration */ in alc5505_dsp_init()
3441 alc5505_coef_set(codec, 0x6220, 0x6002018f); in alc5505_dsp_init()
3443 alc5505_coef_set(codec, 0x61ac, 0x055525f0); /**/ in alc5505_dsp_init()
3444 alc5505_coef_set(codec, 0x61c0, 0x12230080); /* Clock control */ in alc5505_dsp_init()
3445 alc5505_coef_set(codec, 0x61b4, 0x040e2b02); /* PLL2 control */ in alc5505_dsp_init()
3446 alc5505_coef_set(codec, 0x61bc, 0x010234f8); /* OSC Control */ in alc5505_dsp_init()
3447 alc5505_coef_set(codec, 0x880c, 0x00000004); /* DRAM Function control */ in alc5505_dsp_init()
3448 alc5505_coef_set(codec, 0x880c, 0x00000003); in alc5505_dsp_init()
3449 alc5505_coef_set(codec, 0x880c, 0x00000010); in alc5505_dsp_init()
3452 alc5505_dsp_halt(codec); in alc5505_dsp_init()
3457 #define alc5505_dsp_suspend(codec) /* NOP */ argument
3458 #define alc5505_dsp_resume(codec) /* NOP */ argument
3460 #define alc5505_dsp_suspend(codec) alc5505_dsp_halt(codec) argument
3461 #define alc5505_dsp_resume(codec) alc5505_dsp_back_from_halt(codec) argument
3465 static int alc269_suspend(struct hda_codec *codec) in alc269_suspend() argument
3467 struct alc_spec *spec = codec->spec; in alc269_suspend()
3470 alc5505_dsp_suspend(codec); in alc269_suspend()
3471 return alc_suspend(codec); in alc269_suspend()
3474 static int alc269_resume(struct hda_codec *codec) in alc269_resume() argument
3476 struct alc_spec *spec = codec->spec; in alc269_resume()
3479 alc269vb_toggle_power_output(codec, 0); in alc269_resume()
3481 (alc_get_coef0(codec) & 0x00ff) == 0x018) { in alc269_resume()
3485 codec->patch_ops.init(codec); in alc269_resume()
3488 alc269vb_toggle_power_output(codec, 1); in alc269_resume()
3490 (alc_get_coef0(codec) & 0x00ff) == 0x017) { in alc269_resume()
3494 regcache_sync(codec->core.regmap); in alc269_resume()
3495 hda_call_check_power_status(codec, 0x01); in alc269_resume()
3502 alc_write_gpio_data(codec); in alc269_resume()
3505 alc5505_dsp_resume(codec); in alc269_resume()
3511 static void alc269_fixup_pincfg_no_hp_to_lineout(struct hda_codec *codec, in alc269_fixup_pincfg_no_hp_to_lineout() argument
3514 struct alc_spec *spec = codec->spec; in alc269_fixup_pincfg_no_hp_to_lineout()
3520 static void alc269_fixup_pincfg_U7x7_headset_mic(struct hda_codec *codec, in alc269_fixup_pincfg_U7x7_headset_mic() argument
3524 unsigned int cfg_headphone = snd_hda_codec_get_pincfg(codec, 0x21); in alc269_fixup_pincfg_U7x7_headset_mic()
3525 unsigned int cfg_headset_mic = snd_hda_codec_get_pincfg(codec, 0x19); in alc269_fixup_pincfg_U7x7_headset_mic()
3528 snd_hda_codec_set_pincfg(codec, 0x19, in alc269_fixup_pincfg_U7x7_headset_mic()
3533 static void alc269_fixup_hweq(struct hda_codec *codec, in alc269_fixup_hweq() argument
3537 alc_update_coef_idx(codec, 0x1e, 0, 0x80); in alc269_fixup_hweq()
3540 static void alc269_fixup_headset_mic(struct hda_codec *codec, in alc269_fixup_headset_mic() argument
3543 struct alc_spec *spec = codec->spec; in alc269_fixup_headset_mic()
3549 static void alc271_fixup_dmic(struct hda_codec *codec, in alc271_fixup_dmic() argument
3559 if (strcmp(codec->core.chip_name, "ALC271X") && in alc271_fixup_dmic()
3560 strcmp(codec->core.chip_name, "ALC269VB")) in alc271_fixup_dmic()
3562 cfg = snd_hda_codec_get_pincfg(codec, 0x12); in alc271_fixup_dmic()
3564 snd_hda_sequence_write(codec, verbs); in alc271_fixup_dmic()
3567 static void alc269_fixup_pcm_44k(struct hda_codec *codec, in alc269_fixup_pcm_44k() argument
3570 struct alc_spec *spec = codec->spec; in alc269_fixup_pcm_44k()
3582 static void alc269_fixup_stereo_dmic(struct hda_codec *codec, in alc269_fixup_stereo_dmic() argument
3591 alc_update_coef_idx(codec, 0x07, 0, 0x80); in alc269_fixup_stereo_dmic()
3594 static void alc269_quanta_automute(struct hda_codec *codec) in alc269_quanta_automute() argument
3596 snd_hda_gen_update_outputs(codec); in alc269_quanta_automute()
3598 alc_write_coef_idx(codec, 0x0c, 0x680); in alc269_quanta_automute()
3599 alc_write_coef_idx(codec, 0x0c, 0x480); in alc269_quanta_automute()
3602 static void alc269_fixup_quanta_mute(struct hda_codec *codec, in alc269_fixup_quanta_mute() argument
3605 struct alc_spec *spec = codec->spec; in alc269_fixup_quanta_mute()
3611 static void alc269_x101_hp_automute_hook(struct hda_codec *codec, in alc269_x101_hp_automute_hook() argument
3614 struct alc_spec *spec = codec->spec; in alc269_x101_hp_automute_hook()
3617 snd_hda_gen_hp_automute(codec, jack); in alc269_x101_hp_automute_hook()
3621 snd_hda_codec_write(codec, 0x18, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, in alc269_x101_hp_automute_hook()
3624 snd_hda_codec_write(codec, 0x18, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, in alc269_x101_hp_automute_hook()
3628 static void alc269_fixup_x101_headset_mic(struct hda_codec *codec, in alc269_fixup_x101_headset_mic() argument
3631 struct alc_spec *spec = codec->spec; in alc269_fixup_x101_headset_mic()
3642 struct hda_codec *codec = private_data; in alc269_fixup_mic_mute_hook() local
3643 struct alc_spec *spec = codec->spec; in alc269_fixup_mic_mute_hook()
3648 pinval = snd_hda_codec_get_pin_target(codec, spec->mute_led_nid); in alc269_fixup_mic_mute_hook()
3653 snd_hda_power_up_pm(codec); in alc269_fixup_mic_mute_hook()
3654 snd_hda_set_pin_ctl_cache(codec, spec->mute_led_nid, pinval); in alc269_fixup_mic_mute_hook()
3655 snd_hda_power_down_pm(codec); in alc269_fixup_mic_mute_hook()
3660 static unsigned int led_power_filter(struct hda_codec *codec, in led_power_filter() argument
3664 struct alc_spec *spec = codec->spec; in led_power_filter()
3671 snd_hda_set_pin_ctl(codec, nid, in led_power_filter()
3672 snd_hda_codec_get_pin_target(codec, nid)); in led_power_filter()
3674 return snd_hda_gen_path_power_filter(codec, nid, power_state); in led_power_filter()
3677 static void alc269_fixup_hp_mute_led(struct hda_codec *codec, in alc269_fixup_hp_mute_led() argument
3680 struct alc_spec *spec = codec->spec; in alc269_fixup_hp_mute_led()
3696 codec->power_filter = led_power_filter; in alc269_fixup_hp_mute_led()
3697 codec_dbg(codec, in alc269_fixup_hp_mute_led()
3704 static void alc269_fixup_hp_mute_led_micx(struct hda_codec *codec, in alc269_fixup_hp_mute_led_micx() argument
3708 struct alc_spec *spec = codec->spec; in alc269_fixup_hp_mute_led_micx()
3715 codec->power_filter = led_power_filter; in alc269_fixup_hp_mute_led_micx()
3719 static void alc269_fixup_hp_mute_led_mic1(struct hda_codec *codec, in alc269_fixup_hp_mute_led_mic1() argument
3722 alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x18); in alc269_fixup_hp_mute_led_mic1()
3725 static void alc269_fixup_hp_mute_led_mic2(struct hda_codec *codec, in alc269_fixup_hp_mute_led_mic2() argument
3728 alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x19); in alc269_fixup_hp_mute_led_mic2()
3731 static void alc269_fixup_hp_mute_led_mic3(struct hda_codec *codec, in alc269_fixup_hp_mute_led_mic3() argument
3734 alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x1b); in alc269_fixup_hp_mute_led_mic3()
3738 static void alc_update_gpio_led(struct hda_codec *codec, unsigned int mask, in alc_update_gpio_led() argument
3741 struct alc_spec *spec = codec->spec; in alc_update_gpio_led()
3745 alc_update_gpio_data(codec, mask, !enabled); /* muted -> LED on */ in alc_update_gpio_led()
3751 struct hda_codec *codec = private_data; in alc_fixup_gpio_mute_hook() local
3752 struct alc_spec *spec = codec->spec; in alc_fixup_gpio_mute_hook()
3754 alc_update_gpio_led(codec, spec->gpio_mute_led_mask, enabled); in alc_fixup_gpio_mute_hook()
3758 static void alc_gpio_micmute_update(struct hda_codec *codec) in alc_gpio_micmute_update() argument
3760 struct alc_spec *spec = codec->spec; in alc_gpio_micmute_update()
3762 alc_update_gpio_led(codec, spec->gpio_mic_led_mask, in alc_gpio_micmute_update()
3767 static void alc_fixup_hp_gpio_led(struct hda_codec *codec, in alc_fixup_hp_gpio_led() argument
3772 struct alc_spec *spec = codec->spec; in alc_fixup_hp_gpio_led()
3774 alc_fixup_gpio(codec, action, mute_mask | micmute_mask); in alc_fixup_hp_gpio_led()
3784 snd_hda_gen_add_micmute_led(codec, alc_gpio_micmute_update); in alc_fixup_hp_gpio_led()
3788 static void alc269_fixup_hp_gpio_led(struct hda_codec *codec, in alc269_fixup_hp_gpio_led() argument
3791 alc_fixup_hp_gpio_led(codec, action, 0x08, 0x10); in alc269_fixup_hp_gpio_led()
3794 static void alc286_fixup_hp_gpio_led(struct hda_codec *codec, in alc286_fixup_hp_gpio_led() argument
3797 alc_fixup_hp_gpio_led(codec, action, 0x02, 0x20); in alc286_fixup_hp_gpio_led()
3801 static void alc_cap_micmute_update(struct hda_codec *codec) in alc_cap_micmute_update() argument
3803 struct alc_spec *spec = codec->spec; in alc_cap_micmute_update()
3808 pinval = snd_hda_codec_get_pin_target(codec, spec->cap_mute_led_nid); in alc_cap_micmute_update()
3814 snd_hda_set_pin_ctl_cache(codec, spec->cap_mute_led_nid, pinval); in alc_cap_micmute_update()
3817 static void alc269_fixup_hp_gpio_mic1_led(struct hda_codec *codec, in alc269_fixup_hp_gpio_mic1_led() argument
3820 struct alc_spec *spec = codec->spec; in alc269_fixup_hp_gpio_mic1_led()
3822 alc_fixup_hp_gpio_led(codec, action, 0x08, 0); in alc269_fixup_hp_gpio_mic1_led()
3830 snd_hda_gen_add_micmute_led(codec, alc_cap_micmute_update); in alc269_fixup_hp_gpio_mic1_led()
3831 codec->power_filter = led_power_filter; in alc269_fixup_hp_gpio_mic1_led()
3835 static void alc280_fixup_hp_gpio4(struct hda_codec *codec, in alc280_fixup_hp_gpio4() argument
3838 struct alc_spec *spec = codec->spec; in alc280_fixup_hp_gpio4()
3840 alc_fixup_hp_gpio_led(codec, action, 0x08, 0); in alc280_fixup_hp_gpio4()
3843 snd_hda_gen_add_micmute_led(codec, alc_cap_micmute_update); in alc280_fixup_hp_gpio4()
3844 codec->power_filter = led_power_filter; in alc280_fixup_hp_gpio4()
3849 static void gpio2_mic_hotkey_event(struct hda_codec *codec, in gpio2_mic_hotkey_event() argument
3852 struct alc_spec *spec = codec->spec; in gpio2_mic_hotkey_event()
3862 static int alc_register_micmute_input_device(struct hda_codec *codec) in alc_register_micmute_input_device() argument
3864 struct alc_spec *spec = codec->spec; in alc_register_micmute_input_device()
3869 codec_err(codec, "Out of memory (input_allocate_device)\n"); in alc_register_micmute_input_device()
3884 codec_err(codec, "input_register_device failed\n"); in alc_register_micmute_input_device()
3898 static void alc280_fixup_hp_gpio2_mic_hotkey(struct hda_codec *codec, in alc280_fixup_hp_gpio2_mic_hotkey() argument
3901 struct alc_spec *spec = codec->spec; in alc280_fixup_hp_gpio2_mic_hotkey()
3903 alc_fixup_hp_gpio_led(codec, action, 0x08, 0x10); in alc280_fixup_hp_gpio2_mic_hotkey()
3906 if (alc_register_micmute_input_device(codec) != 0) in alc280_fixup_hp_gpio2_mic_hotkey()
3912 snd_hda_codec_write_cache(codec, codec->core.afg, 0, in alc280_fixup_hp_gpio2_mic_hotkey()
3914 snd_hda_jack_detect_enable_callback(codec, codec->core.afg, in alc280_fixup_hp_gpio2_mic_hotkey()
3932 static void alc233_fixup_lenovo_line2_mic_hotkey(struct hda_codec *codec, in alc233_fixup_lenovo_line2_mic_hotkey() argument
3935 struct alc_spec *spec = codec->spec; in alc233_fixup_lenovo_line2_mic_hotkey()
3937 alc_fixup_hp_gpio_led(codec, action, 0, 0x04); in alc233_fixup_lenovo_line2_mic_hotkey()
3940 if (alc_register_micmute_input_device(codec) != 0) in alc233_fixup_lenovo_line2_mic_hotkey()
3943 snd_hda_jack_detect_enable_callback(codec, 0x1b, in alc233_fixup_lenovo_line2_mic_hotkey()
3962 static void alc269_fixup_hp_line1_mic1_led(struct hda_codec *codec, in alc269_fixup_hp_line1_mic1_led() argument
3965 struct alc_spec *spec = codec->spec; in alc269_fixup_hp_line1_mic1_led()
3967 alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x1a); in alc269_fixup_hp_line1_mic1_led()
3970 snd_hda_gen_add_micmute_led(codec, alc_cap_micmute_update); in alc269_fixup_hp_line1_mic1_led()
3985 static void alc_headset_mode_unplugged(struct hda_codec *codec) in alc_headset_mode_unplugged() argument
4060 switch (codec->core.vendor_id) { in alc_headset_mode_unplugged()
4062 alc_process_coef_fw(codec, coef0255_1); in alc_headset_mode_unplugged()
4063 alc_process_coef_fw(codec, coef0255); in alc_headset_mode_unplugged()
4067 alc_process_coef_fw(codec, coef0256); in alc_headset_mode_unplugged()
4068 alc_process_coef_fw(codec, coef0255); in alc_headset_mode_unplugged()
4073 alc_process_coef_fw(codec, coef0274); in alc_headset_mode_unplugged()
4077 alc_process_coef_fw(codec, coef0233); in alc_headset_mode_unplugged()
4081 alc_process_coef_fw(codec, coef0288); in alc_headset_mode_unplugged()
4084 alc_process_coef_fw(codec, coef0298); in alc_headset_mode_unplugged()
4085 alc_process_coef_fw(codec, coef0288); in alc_headset_mode_unplugged()
4088 alc_process_coef_fw(codec, coef0292); in alc_headset_mode_unplugged()
4091 alc_process_coef_fw(codec, coef0293); in alc_headset_mode_unplugged()
4094 alc_process_coef_fw(codec, coef0668); in alc_headset_mode_unplugged()
4102 alc_process_coef_fw(codec, coef0225); in alc_headset_mode_unplugged()
4105 alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0); in alc_headset_mode_unplugged()
4108 codec_dbg(codec, "Headset jack set to unplugged mode.\n"); in alc_headset_mode_unplugged()
4112 static void alc_headset_mode_mic_in(struct hda_codec *codec, hda_nid_t hp_pin, in alc_headset_mode_mic_in() argument
4166 switch (codec->core.vendor_id) { in alc_headset_mode_mic_in()
4170 alc_write_coef_idx(codec, 0x45, 0xc489); in alc_headset_mode_mic_in()
4171 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); in alc_headset_mode_mic_in()
4172 alc_process_coef_fw(codec, coef0255); in alc_headset_mode_mic_in()
4173 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); in alc_headset_mode_mic_in()
4178 alc_write_coef_idx(codec, 0x45, 0x4689); in alc_headset_mode_mic_in()
4179 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); in alc_headset_mode_mic_in()
4180 alc_process_coef_fw(codec, coef0274); in alc_headset_mode_mic_in()
4181 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); in alc_headset_mode_mic_in()
4185 alc_write_coef_idx(codec, 0x45, 0xc429); in alc_headset_mode_mic_in()
4186 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); in alc_headset_mode_mic_in()
4187 alc_process_coef_fw(codec, coef0233); in alc_headset_mode_mic_in()
4188 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); in alc_headset_mode_mic_in()
4193 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); in alc_headset_mode_mic_in()
4194 alc_process_coef_fw(codec, coef0288); in alc_headset_mode_mic_in()
4195 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); in alc_headset_mode_mic_in()
4198 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); in alc_headset_mode_mic_in()
4199 alc_process_coef_fw(codec, coef0292); in alc_headset_mode_mic_in()
4203 alc_write_coef_idx(codec, 0x45, 0xc429); in alc_headset_mode_mic_in()
4204 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); in alc_headset_mode_mic_in()
4205 alc_process_coef_fw(codec, coef0293); in alc_headset_mode_mic_in()
4206 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); in alc_headset_mode_mic_in()
4209 alc_update_coefex_idx(codec, 0x57, 0x5, 0, 1<<14); in alc_headset_mode_mic_in()
4213 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); in alc_headset_mode_mic_in()
4214 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); in alc_headset_mode_mic_in()
4217 alc_write_coef_idx(codec, 0x11, 0x0001); in alc_headset_mode_mic_in()
4218 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); in alc_headset_mode_mic_in()
4219 alc_process_coef_fw(codec, coef0688); in alc_headset_mode_mic_in()
4220 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); in alc_headset_mode_mic_in()
4228 alc_process_coef_fw(codec, alc225_pre_hsmode); in alc_headset_mode_mic_in()
4229 alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x31<<10); in alc_headset_mode_mic_in()
4230 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); in alc_headset_mode_mic_in()
4231 alc_process_coef_fw(codec, coef0225); in alc_headset_mode_mic_in()
4232 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); in alc_headset_mode_mic_in()
4235 codec_dbg(codec, "Headset jack set to mic-in mode.\n"); in alc_headset_mode_mic_in()
4238 static void alc_headset_mode_default(struct hda_codec *codec) in alc_headset_mode_default() argument
4296 switch (codec->core.vendor_id) { in alc_headset_mode_default()
4303 alc_process_coef_fw(codec, alc225_pre_hsmode); in alc_headset_mode_default()
4304 alc_process_coef_fw(codec, coef0225); in alc_headset_mode_default()
4309 alc_process_coef_fw(codec, coef0255); in alc_headset_mode_default()
4314 alc_process_coef_fw(codec, coef0274); in alc_headset_mode_default()
4318 alc_process_coef_fw(codec, coef0233); in alc_headset_mode_default()
4323 alc_process_coef_fw(codec, coef0288); in alc_headset_mode_default()
4326 alc_process_coef_fw(codec, coef0292); in alc_headset_mode_default()
4329 alc_process_coef_fw(codec, coef0293); in alc_headset_mode_default()
4332 alc_process_coef_fw(codec, coef0688); in alc_headset_mode_default()
4335 alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0); in alc_headset_mode_default()
4338 codec_dbg(codec, "Headset jack set to headphone (default) mode.\n"); in alc_headset_mode_default()
4342 static void alc_headset_mode_ctia(struct hda_codec *codec) in alc_headset_mode_ctia() argument
4399 switch (codec->core.vendor_id) { in alc_headset_mode_ctia()
4401 alc_process_coef_fw(codec, coef0255); in alc_headset_mode_ctia()
4405 alc_process_coef_fw(codec, coef0256); in alc_headset_mode_ctia()
4410 alc_write_coef_idx(codec, 0x45, 0xd689); in alc_headset_mode_ctia()
4414 alc_process_coef_fw(codec, coef0233); in alc_headset_mode_ctia()
4417 val = alc_read_coef_idx(codec, 0x50); in alc_headset_mode_ctia()
4419 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0020); in alc_headset_mode_ctia()
4420 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400); in alc_headset_mode_ctia()
4423 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010); in alc_headset_mode_ctia()
4424 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400); in alc_headset_mode_ctia()
4430 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400); in alc_headset_mode_ctia()
4432 alc_process_coef_fw(codec, coef0288); in alc_headset_mode_ctia()
4435 alc_process_coef_fw(codec, coef0292); in alc_headset_mode_ctia()
4438 alc_process_coef_fw(codec, coef0293); in alc_headset_mode_ctia()
4441 alc_process_coef_fw(codec, coef0688); in alc_headset_mode_ctia()
4449 val = alc_read_coef_idx(codec, 0x45); in alc_headset_mode_ctia()
4451 alc_process_coef_fw(codec, coef0225_2); in alc_headset_mode_ctia()
4453 alc_process_coef_fw(codec, coef0225_1); in alc_headset_mode_ctia()
4456 alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0); in alc_headset_mode_ctia()
4459 codec_dbg(codec, "Headset jack set to iPhone-style headset mode.\n"); in alc_headset_mode_ctia()
4463 static void alc_headset_mode_omtp(struct hda_codec *codec) in alc_headset_mode_omtp() argument
4513 switch (codec->core.vendor_id) { in alc_headset_mode_omtp()
4515 alc_process_coef_fw(codec, coef0255); in alc_headset_mode_omtp()
4519 alc_process_coef_fw(codec, coef0256); in alc_headset_mode_omtp()
4524 alc_write_coef_idx(codec, 0x45, 0xe689); in alc_headset_mode_omtp()
4528 alc_process_coef_fw(codec, coef0233); in alc_headset_mode_omtp()
4531 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010);/* Headset output enable */ in alc_headset_mode_omtp()
4532 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xe400); in alc_headset_mode_omtp()
4537 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xe400); in alc_headset_mode_omtp()
4539 alc_process_coef_fw(codec, coef0288); in alc_headset_mode_omtp()
4542 alc_process_coef_fw(codec, coef0292); in alc_headset_mode_omtp()
4545 alc_process_coef_fw(codec, coef0293); in alc_headset_mode_omtp()
4548 alc_process_coef_fw(codec, coef0688); in alc_headset_mode_omtp()
4556 alc_process_coef_fw(codec, coef0225); in alc_headset_mode_omtp()
4559 codec_dbg(codec, "Headset jack set to Nokia-style headset mode.\n"); in alc_headset_mode_omtp()
4562 static void alc_determine_headset_type(struct hda_codec *codec) in alc_determine_headset_type() argument
4566 struct alc_spec *spec = codec->spec; in alc_determine_headset_type()
4605 switch (codec->core.vendor_id) { in alc_determine_headset_type()
4609 alc_process_coef_fw(codec, coef0255); in alc_determine_headset_type()
4611 val = alc_read_coef_idx(codec, 0x46); in alc_determine_headset_type()
4617 alc_process_coef_fw(codec, coef0274); in alc_determine_headset_type()
4619 val = alc_read_coef_idx(codec, 0x46); in alc_determine_headset_type()
4624 alc_write_coef_idx(codec, 0x45, 0xd029); in alc_determine_headset_type()
4626 val = alc_read_coef_idx(codec, 0x46); in alc_determine_headset_type()
4630 snd_hda_codec_write(codec, 0x21, 0, in alc_determine_headset_type()
4633 snd_hda_codec_write(codec, 0x21, 0, in alc_determine_headset_type()
4637 val = alc_read_coef_idx(codec, 0x50); in alc_determine_headset_type()
4639 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0020); in alc_determine_headset_type()
4640 alc_process_coef_fw(codec, coef0288); in alc_determine_headset_type()
4642 val = alc_read_coef_idx(codec, 0x50); in alc_determine_headset_type()
4645 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010); in alc_determine_headset_type()
4646 alc_process_coef_fw(codec, coef0288); in alc_determine_headset_type()
4648 val = alc_read_coef_idx(codec, 0x50); in alc_determine_headset_type()
4651 alc_process_coef_fw(codec, coef0298); in alc_determine_headset_type()
4652 snd_hda_codec_write(codec, 0x21, 0, in alc_determine_headset_type()
4655 snd_hda_codec_write(codec, 0x21, 0, in alc_determine_headset_type()
4660 alc_process_coef_fw(codec, coef0288); in alc_determine_headset_type()
4662 val = alc_read_coef_idx(codec, 0x50); in alc_determine_headset_type()
4666 alc_write_coef_idx(codec, 0x6b, 0xd429); in alc_determine_headset_type()
4668 val = alc_read_coef_idx(codec, 0x6c); in alc_determine_headset_type()
4672 alc_process_coef_fw(codec, coef0293); in alc_determine_headset_type()
4674 val = alc_read_coef_idx(codec, 0x46); in alc_determine_headset_type()
4678 alc_process_coef_fw(codec, coef0688); in alc_determine_headset_type()
4680 val = alc_read_coef_idx(codec, 0xbe); in alc_determine_headset_type()
4689 snd_hda_codec_write(codec, 0x21, 0, in alc_determine_headset_type()
4692 snd_hda_codec_write(codec, 0x21, 0, in alc_determine_headset_type()
4695 alc_process_coef_fw(codec, alc225_pre_hsmode); in alc_determine_headset_type()
4696 alc_update_coef_idx(codec, 0x67, 0xf000, 0x1000); in alc_determine_headset_type()
4697 val = alc_read_coef_idx(codec, 0x45); in alc_determine_headset_type()
4699 alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x34<<10); in alc_determine_headset_type()
4700 alc_update_coef_idx(codec, 0x49, 3<<8, 2<<8); in alc_determine_headset_type()
4702 val = alc_read_coef_idx(codec, 0x46); in alc_determine_headset_type()
4705 alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x34<<10); in alc_determine_headset_type()
4706 alc_update_coef_idx(codec, 0x49, 3<<8, 1<<8); in alc_determine_headset_type()
4708 val = alc_read_coef_idx(codec, 0x46); in alc_determine_headset_type()
4711 alc_update_coef_idx(codec, 0x4a, 7<<6, 7<<6); in alc_determine_headset_type()
4712 alc_update_coef_idx(codec, 0x4a, 3<<4, 3<<4); in alc_determine_headset_type()
4713 alc_update_coef_idx(codec, 0x67, 0xf000, 0x3000); in alc_determine_headset_type()
4715 snd_hda_codec_write(codec, 0x21, 0, in alc_determine_headset_type()
4718 snd_hda_codec_write(codec, 0x21, 0, in alc_determine_headset_type()
4726 codec_dbg(codec, "Headset jack detected iPhone-style headset: %s\n", in alc_determine_headset_type()
4731 static void alc_update_headset_mode(struct hda_codec *codec) in alc_update_headset_mode() argument
4733 struct alc_spec *spec = codec->spec; in alc_update_headset_mode()
4740 if (!snd_hda_jack_detect(codec, hp_pin)) in alc_update_headset_mode()
4750 snd_hda_gen_update_outputs(codec); in alc_update_headset_mode()
4756 alc_headset_mode_unplugged(codec); in alc_update_headset_mode()
4761 alc_determine_headset_type(codec); in alc_update_headset_mode()
4763 alc_headset_mode_ctia(codec); in alc_update_headset_mode()
4765 alc_headset_mode_omtp(codec); in alc_update_headset_mode()
4769 alc_headset_mode_mic_in(codec, hp_pin, spec->headphone_mic_pin); in alc_update_headset_mode()
4773 alc_headset_mode_default(codec); in alc_update_headset_mode()
4778 snd_hda_set_pin_ctl_cache(codec, hp_pin, in alc_update_headset_mode()
4781 snd_hda_set_pin_ctl_cache(codec, spec->headphone_mic_pin, in alc_update_headset_mode()
4786 snd_hda_gen_update_outputs(codec); in alc_update_headset_mode()
4789 static void alc_update_headset_mode_hook(struct hda_codec *codec, in alc_update_headset_mode_hook() argument
4793 alc_update_headset_mode(codec); in alc_update_headset_mode_hook()
4796 static void alc_update_headset_jack_cb(struct hda_codec *codec, in alc_update_headset_jack_cb() argument
4799 struct alc_spec *spec = codec->spec; in alc_update_headset_jack_cb()
4801 snd_hda_gen_hp_automute(codec, jack); in alc_update_headset_jack_cb()
4804 static void alc_probe_headset_mode(struct hda_codec *codec) in alc_probe_headset_mode() argument
4807 struct alc_spec *spec = codec->spec; in alc_probe_headset_mode()
4824 static void alc_fixup_headset_mode(struct hda_codec *codec, in alc_fixup_headset_mode() argument
4827 struct alc_spec *spec = codec->spec; in alc_fixup_headset_mode()
4834 alc_probe_headset_mode(codec); in alc_fixup_headset_mode()
4838 alc_update_headset_mode(codec); in alc_fixup_headset_mode()
4843 static void alc_fixup_headset_mode_no_hp_mic(struct hda_codec *codec, in alc_fixup_headset_mode_no_hp_mic() argument
4847 struct alc_spec *spec = codec->spec; in alc_fixup_headset_mode_no_hp_mic()
4851 alc_fixup_headset_mode(codec, fix, action); in alc_fixup_headset_mode_no_hp_mic()
4854 static void alc255_set_default_jack_type(struct hda_codec *codec) in alc255_set_default_jack_type() argument
4873 switch (codec->core.vendor_id) { in alc255_set_default_jack_type()
4875 alc_process_coef_fw(codec, alc255fw); in alc255_set_default_jack_type()
4879 alc_process_coef_fw(codec, alc256fw); in alc255_set_default_jack_type()
4885 static void alc_fixup_headset_mode_alc255(struct hda_codec *codec, in alc_fixup_headset_mode_alc255() argument
4889 alc255_set_default_jack_type(codec); in alc_fixup_headset_mode_alc255()
4891 alc_fixup_headset_mode(codec, fix, action); in alc_fixup_headset_mode_alc255()
4894 static void alc_fixup_headset_mode_alc255_no_hp_mic(struct hda_codec *codec, in alc_fixup_headset_mode_alc255_no_hp_mic() argument
4898 struct alc_spec *spec = codec->spec; in alc_fixup_headset_mode_alc255_no_hp_mic()
4900 alc255_set_default_jack_type(codec); in alc_fixup_headset_mode_alc255_no_hp_mic()
4903 alc_fixup_headset_mode(codec, fix, action); in alc_fixup_headset_mode_alc255_no_hp_mic()
4906 static void alc288_update_headset_jack_cb(struct hda_codec *codec, in alc288_update_headset_jack_cb() argument
4909 struct alc_spec *spec = codec->spec; in alc288_update_headset_jack_cb()
4911 alc_update_headset_jack_cb(codec, jack); in alc288_update_headset_jack_cb()
4913 alc_update_gpio_data(codec, 0x40, spec->gen.hp_jack_present); in alc288_update_headset_jack_cb()
4916 static void alc_fixup_headset_mode_dell_alc288(struct hda_codec *codec, in alc_fixup_headset_mode_dell_alc288() argument
4919 alc_fixup_headset_mode(codec, fix, action); in alc_fixup_headset_mode_dell_alc288()
4921 struct alc_spec *spec = codec->spec; in alc_fixup_headset_mode_dell_alc288()
4929 static void alc_fixup_auto_mute_via_amp(struct hda_codec *codec, in alc_fixup_auto_mute_via_amp() argument
4933 struct alc_spec *spec = codec->spec; in alc_fixup_auto_mute_via_amp()
4938 static void alc_no_shutup(struct hda_codec *codec) in alc_no_shutup() argument
4942 static void alc_fixup_no_shutup(struct hda_codec *codec, in alc_fixup_no_shutup() argument
4946 struct alc_spec *spec = codec->spec; in alc_fixup_no_shutup()
4951 static void alc_fixup_disable_aamix(struct hda_codec *codec, in alc_fixup_disable_aamix() argument
4955 struct alc_spec *spec = codec->spec; in alc_fixup_disable_aamix()
4962 static void alc_fixup_tpt440_dock(struct hda_codec *codec, in alc_fixup_tpt440_dock() argument
4970 struct alc_spec *spec = codec->spec; in alc_fixup_tpt440_dock()
4975 codec->power_save_node = 0; /* avoid click noises */ in alc_fixup_tpt440_dock()
4976 snd_hda_apply_pincfgs(codec, pincfgs); in alc_fixup_tpt440_dock()
4980 static void alc_fixup_tpt470_dock(struct hda_codec *codec, in alc_fixup_tpt470_dock() argument
4988 struct alc_spec *spec = codec->spec; in alc_fixup_tpt470_dock()
4992 snd_hda_apply_pincfgs(codec, pincfgs); in alc_fixup_tpt470_dock()
4995 snd_hda_codec_write(codec, 0x17, 0, in alc_fixup_tpt470_dock()
4998 snd_hda_codec_write(codec, 0x19, 0, in alc_fixup_tpt470_dock()
5003 static void alc_shutup_dell_xps13(struct hda_codec *codec) in alc_shutup_dell_xps13() argument
5005 struct alc_spec *spec = codec->spec; in alc_shutup_dell_xps13()
5009 snd_hda_codec_write(codec, hp_pin, 0, in alc_shutup_dell_xps13()
5014 static void alc_fixup_dell_xps13(struct hda_codec *codec, in alc_fixup_dell_xps13() argument
5017 struct alc_spec *spec = codec->spec; in alc_fixup_dell_xps13()
5026 snd_hda_codec_set_pin_target(codec, 0x19, PIN_VREFHIZ); in alc_fixup_dell_xps13()
5041 static void alc_fixup_headset_mode_alc662(struct hda_codec *codec, in alc_fixup_headset_mode_alc662() argument
5044 struct alc_spec *spec = codec->spec; in alc_fixup_headset_mode_alc662()
5052 snd_hda_codec_write(codec, 0x1b, 0, AC_VERB_SET_AMP_GAIN_MUTE, 0x7000); in alc_fixup_headset_mode_alc662()
5053 snd_hda_override_wcaps(codec, 0x1b, get_wcaps(codec, 0x1b) & ~AC_WCAP_IN_AMP); in alc_fixup_headset_mode_alc662()
5055 alc_fixup_headset_mode(codec, fix, action); in alc_fixup_headset_mode_alc662()
5058 static void alc_fixup_headset_mode_alc668(struct hda_codec *codec, in alc_fixup_headset_mode_alc668() argument
5062 alc_write_coef_idx(codec, 0xc4, 0x8000); in alc_fixup_headset_mode_alc668()
5063 alc_update_coef_idx(codec, 0xc2, ~0xfe, 0); in alc_fixup_headset_mode_alc668()
5064 snd_hda_set_pin_ctl_cache(codec, 0x18, 0); in alc_fixup_headset_mode_alc668()
5066 alc_fixup_headset_mode(codec, fix, action); in alc_fixup_headset_mode_alc668()
5070 static int find_ext_mic_pin(struct hda_codec *codec) in find_ext_mic_pin() argument
5072 struct alc_spec *spec = codec->spec; in find_ext_mic_pin()
5082 defcfg = snd_hda_codec_get_pincfg(codec, nid); in find_ext_mic_pin()
5091 static void alc271_hp_gate_mic_jack(struct hda_codec *codec, in alc271_hp_gate_mic_jack() argument
5095 struct alc_spec *spec = codec->spec; in alc271_hp_gate_mic_jack()
5098 int mic_pin = find_ext_mic_pin(codec); in alc271_hp_gate_mic_jack()
5103 snd_hda_jack_set_gating_jack(codec, mic_pin, hp_pin); in alc271_hp_gate_mic_jack()
5107 static void alc269_fixup_limit_int_mic_boost(struct hda_codec *codec, in alc269_fixup_limit_int_mic_boost() argument
5111 struct alc_spec *spec = codec->spec; in alc269_fixup_limit_int_mic_boost()
5127 defcfg = snd_hda_codec_get_pincfg(codec, nid); in alc269_fixup_limit_int_mic_boost()
5131 snd_hda_override_amp_caps(codec, nid, HDA_INPUT, in alc269_fixup_limit_int_mic_boost()
5139 static void alc283_hp_automute_hook(struct hda_codec *codec, in alc283_hp_automute_hook() argument
5142 struct alc_spec *spec = codec->spec; in alc283_hp_automute_hook()
5146 snd_hda_gen_hp_automute(codec, jack); in alc283_hp_automute_hook()
5151 snd_hda_codec_write(codec, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, in alc283_hp_automute_hook()
5155 static void alc283_fixup_chromebook(struct hda_codec *codec, in alc283_fixup_chromebook() argument
5158 struct alc_spec *spec = codec->spec; in alc283_fixup_chromebook()
5162 snd_hda_override_wcaps(codec, 0x03, 0); in alc283_fixup_chromebook()
5169 alc_update_coef_idx(codec, 0x06, 0x000c, 0); in alc283_fixup_chromebook()
5171 alc_update_coef_idx(codec, 0x1a, 0, 1 << 4); in alc283_fixup_chromebook()
5176 static void alc283_fixup_sense_combo_jack(struct hda_codec *codec, in alc283_fixup_sense_combo_jack() argument
5179 struct alc_spec *spec = codec->spec; in alc283_fixup_sense_combo_jack()
5188 alc_update_coef_idx(codec, 0x06, 0x000c, 0); in alc283_fixup_sense_combo_jack()
5194 static void asus_tx300_automute(struct hda_codec *codec) in asus_tx300_automute() argument
5196 struct alc_spec *spec = codec->spec; in asus_tx300_automute()
5197 snd_hda_gen_update_outputs(codec); in asus_tx300_automute()
5198 if (snd_hda_jack_detect(codec, 0x1b)) in asus_tx300_automute()
5202 static void alc282_fixup_asus_tx300(struct hda_codec *codec, in alc282_fixup_asus_tx300() argument
5205 struct alc_spec *spec = codec->spec; in alc282_fixup_asus_tx300()
5215 alc_setup_gpio(codec, 0x04); in alc282_fixup_asus_tx300()
5216 snd_hda_apply_pincfgs(codec, dock_pins); in alc282_fixup_asus_tx300()
5219 snd_hda_jack_detect_enable_callback(codec, 0x1b, in alc282_fixup_asus_tx300()
5229 rename_ctl(codec, "Speaker Playback Switch", in alc282_fixup_asus_tx300()
5231 rename_ctl(codec, "Bass Speaker Playback Switch", in alc282_fixup_asus_tx300()
5237 static void alc290_fixup_mono_speakers(struct hda_codec *codec, in alc290_fixup_mono_speakers() argument
5245 snd_hda_override_conn_list(codec, 0x14, 1, conn1); in alc290_fixup_mono_speakers()
5246 snd_hda_override_conn_list(codec, 0x15, 1, conn1); in alc290_fixup_mono_speakers()
5250 static void alc298_fixup_speaker_volume(struct hda_codec *codec, in alc298_fixup_speaker_volume() argument
5262 snd_hda_override_conn_list(codec, 0x17, 1, conn1); in alc298_fixup_speaker_volume()
5267 static void alc295_fixup_disable_dac3(struct hda_codec *codec, in alc295_fixup_disable_dac3() argument
5272 snd_hda_override_conn_list(codec, 0x17, 2, conn); in alc295_fixup_disable_dac3()
5277 static void alc280_hp_gpio4_automute_hook(struct hda_codec *codec, in alc280_hp_gpio4_automute_hook() argument
5280 struct alc_spec *spec = codec->spec; in alc280_hp_gpio4_automute_hook()
5282 snd_hda_gen_hp_automute(codec, jack); in alc280_hp_gpio4_automute_hook()
5284 alc_update_gpio_led(codec, 0x10, !spec->gen.hp_jack_present); in alc280_hp_gpio4_automute_hook()
5293 static void alc280_fixup_hp_9480m(struct hda_codec *codec, in alc280_fixup_hp_9480m() argument
5297 struct alc_spec *spec = codec->spec; in alc280_fixup_hp_9480m()
5299 alc_fixup_hp_gpio_led(codec, action, 0x08, 0); in alc280_fixup_hp_9480m()
5308 static void alc275_fixup_gpio4_off(struct hda_codec *codec, in alc275_fixup_gpio4_off() argument
5312 struct alc_spec *spec = codec->spec; in alc275_fixup_gpio4_off()
5321 static void alc233_alc662_fixup_lenovo_dual_codecs(struct hda_codec *codec, in alc233_alc662_fixup_lenovo_dual_codecs() argument
5325 alc_fixup_dual_codecs(codec, fix, action); in alc233_alc662_fixup_lenovo_dual_codecs()
5329 strcpy(codec->card->longname, "HDAudio-Lenovo-DualCodecs"); in alc233_alc662_fixup_lenovo_dual_codecs()
5333 rename_ctl(codec, "Capture Volume", in alc233_alc662_fixup_lenovo_dual_codecs()
5334 codec->addr == 0 ? in alc233_alc662_fixup_lenovo_dual_codecs()
5337 rename_ctl(codec, "Capture Switch", in alc233_alc662_fixup_lenovo_dual_codecs()
5338 codec->addr == 0 ? in alc233_alc662_fixup_lenovo_dual_codecs()
5346 static void alc274_fixup_bind_dacs(struct hda_codec *codec, in alc274_fixup_bind_dacs() argument
5349 struct alc_spec *spec = codec->spec; in alc274_fixup_bind_dacs()
5364 static void alc_fixup_thinkpad_acpi(struct hda_codec *codec, in alc_fixup_thinkpad_acpi() argument
5367 alc_fixup_no_shutup(codec, fix, action); /* reduce click noise */ in alc_fixup_thinkpad_acpi()
5368 hda_fixup_thinkpad_acpi(codec, fix, action); in alc_fixup_thinkpad_acpi()
7125 static void alc269_fill_coef(struct hda_codec *codec) in alc269_fill_coef() argument
7127 struct alc_spec *spec = codec->spec; in alc269_fill_coef()
7133 if ((alc_get_coef0(codec) & 0x00ff) < 0x015) { in alc269_fill_coef()
7134 alc_write_coef_idx(codec, 0xf, 0x960b); in alc269_fill_coef()
7135 alc_write_coef_idx(codec, 0xe, 0x8817); in alc269_fill_coef()
7138 if ((alc_get_coef0(codec) & 0x00ff) == 0x016) { in alc269_fill_coef()
7139 alc_write_coef_idx(codec, 0xf, 0x960b); in alc269_fill_coef()
7140 alc_write_coef_idx(codec, 0xe, 0x8814); in alc269_fill_coef()
7143 if ((alc_get_coef0(codec) & 0x00ff) == 0x017) { in alc269_fill_coef()
7145 alc_update_coef_idx(codec, 0x04, 0, 1<<11); in alc269_fill_coef()
7148 if ((alc_get_coef0(codec) & 0x00ff) == 0x018) { in alc269_fill_coef()
7149 val = alc_read_coef_idx(codec, 0xd); in alc269_fill_coef()
7152 alc_write_coef_idx(codec, 0xd, val | (1<<10)); in alc269_fill_coef()
7154 val = alc_read_coef_idx(codec, 0x17); in alc269_fill_coef()
7157 alc_write_coef_idx(codec, 0x17, val | (1<<7)); in alc269_fill_coef()
7162 alc_update_coef_idx(codec, 0x4, 0, 1<<11); in alc269_fill_coef()
7167 static int patch_alc269(struct hda_codec *codec) in patch_alc269() argument
7172 err = alc_alloc_spec(codec, 0x0b); in patch_alc269()
7176 spec = codec->spec; in patch_alc269()
7178 codec->power_save_node = 1; in patch_alc269()
7181 codec->patch_ops.suspend = alc269_suspend; in patch_alc269()
7182 codec->patch_ops.resume = alc269_resume; in patch_alc269()
7187 switch (codec->core.vendor_id) { in patch_alc269()
7190 switch (alc_get_coef0(codec) & 0x00f0) { in patch_alc269()
7192 if (codec->bus->pci && in patch_alc269()
7193 codec->bus->pci->subsystem_vendor == 0x1025 && in patch_alc269()
7195 err = alc_codec_rename(codec, "ALC271X"); in patch_alc269()
7199 if (codec->bus->pci && in patch_alc269()
7200 codec->bus->pci->subsystem_vendor == 0x17aa && in patch_alc269()
7201 codec->bus->pci->subsystem_device == 0x21f3) in patch_alc269()
7202 err = alc_codec_rename(codec, "ALC3202"); in patch_alc269()
7209 alc_fix_pll_init(codec, 0x20, 0x04, 15); in patch_alc269()
7215 alc269_fill_coef(codec); in patch_alc269()
7260 alc_update_coef_idx(codec, 0x36, 1 << 13, 1 << 5); /* Switch pcbeep path to Line in path*/ in patch_alc269()
7289 alc_update_coef_idx(codec, 0x6b, 0x0018, (1<<4) | (1<<3)); /* UAJ MIC Vref control by verb */ in patch_alc269()
7296 alc_update_coef_idx(codec, 0x4a, 1 << 15, 0); /* Combo jack auto trigger control */ in patch_alc269()
7301 if (snd_hda_codec_read(codec, 0x51, 0, AC_VERB_PARAMETERS, 0) == 0x10ec5505) { in patch_alc269()
7306 snd_hda_pick_fixup(codec, alc269_fixup_models, in patch_alc269()
7308 snd_hda_pick_pin_fixup(codec, alc269_pin_fixup_tbl, alc269_fixups); in patch_alc269()
7309 snd_hda_pick_fixup(codec, NULL, alc269_fixup_vendor_tbl, in patch_alc269()
7311 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); in patch_alc269()
7313 alc_auto_parse_customize_define(codec); in patch_alc269()
7315 if (has_cdefine_beep(codec)) in patch_alc269()
7319 err = alc269_parse_auto_config(codec); in patch_alc269()
7329 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); in patch_alc269()
7334 alc_free(codec); in patch_alc269()
7342 static int alc861_parse_auto_config(struct hda_codec *codec) in alc861_parse_auto_config() argument
7346 return alc_parse_auto_config(codec, alc861_ignore, alc861_ssids); in alc861_parse_auto_config()
7359 static void alc861_fixup_asus_amp_vref_0f(struct hda_codec *codec, in alc861_fixup_asus_amp_vref_0f() argument
7362 struct alc_spec *spec = codec->spec; in alc861_fixup_asus_amp_vref_0f()
7367 val = snd_hda_codec_get_pin_target(codec, 0x0f); in alc861_fixup_asus_amp_vref_0f()
7371 snd_hda_set_pin_ctl(codec, 0x0f, val); in alc861_fixup_asus_amp_vref_0f()
7376 static void alc_fixup_no_jack_detect(struct hda_codec *codec, in alc_fixup_no_jack_detect() argument
7380 codec->no_jack_detect = 1; in alc_fixup_no_jack_detect()
7432 static int patch_alc861(struct hda_codec *codec) in patch_alc861() argument
7437 err = alc_alloc_spec(codec, 0x15); in patch_alc861()
7441 spec = codec->spec; in patch_alc861()
7448 snd_hda_pick_fixup(codec, NULL, alc861_fixup_tbl, alc861_fixups); in patch_alc861()
7449 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); in patch_alc861()
7452 err = alc861_parse_auto_config(codec); in patch_alc861()
7462 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); in patch_alc861()
7467 alc_free(codec); in patch_alc861()
7478 static int alc861vd_parse_auto_config(struct hda_codec *codec) in alc861vd_parse_auto_config() argument
7482 return alc_parse_auto_config(codec, alc861vd_ignore, alc861vd_ssids); in alc861vd_parse_auto_config()
7491 static void alc861vd_fixup_dallas(struct hda_codec *codec, in alc861vd_fixup_dallas() argument
7495 snd_hda_override_pin_caps(codec, 0x18, 0x00000734); in alc861vd_fixup_dallas()
7496 snd_hda_override_pin_caps(codec, 0x19, 0x0000073c); in alc861vd_fixup_dallas()
7501 static void alc660vd_fixup_asus_gpio1(struct hda_codec *codec, in alc660vd_fixup_asus_gpio1() argument
7504 struct alc_spec *spec = codec->spec; in alc660vd_fixup_asus_gpio1()
7508 alc_fixup_gpio(codec, action, 0x01); in alc660vd_fixup_asus_gpio1()
7531 static int patch_alc861vd(struct hda_codec *codec) in patch_alc861vd() argument
7536 err = alc_alloc_spec(codec, 0x0b); in patch_alc861vd()
7540 spec = codec->spec; in patch_alc861vd()
7545 snd_hda_pick_fixup(codec, NULL, alc861vd_fixup_tbl, alc861vd_fixups); in patch_alc861vd()
7546 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); in patch_alc861vd()
7549 err = alc861vd_parse_auto_config(codec); in patch_alc861vd()
7559 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); in patch_alc861vd()
7564 alc_free(codec); in patch_alc861vd()
7584 static int alc662_parse_auto_config(struct hda_codec *codec) in alc662_parse_auto_config() argument
7591 if (codec->core.vendor_id == 0x10ec0272 || codec->core.vendor_id == 0x10ec0663 || in alc662_parse_auto_config()
7592 codec->core.vendor_id == 0x10ec0665 || codec->core.vendor_id == 0x10ec0670 || in alc662_parse_auto_config()
7593 codec->core.vendor_id == 0x10ec0671) in alc662_parse_auto_config()
7597 return alc_parse_auto_config(codec, alc662_ignore, ssids); in alc662_parse_auto_config()
7600 static void alc272_fixup_mario(struct hda_codec *codec, in alc272_fixup_mario() argument
7605 if (snd_hda_override_amp_caps(codec, 0x2, HDA_OUTPUT, in alc272_fixup_mario()
7610 codec_warn(codec, "failed to override amp caps for NID 0x2\n"); in alc272_fixup_mario()
7623 static void alc_fixup_bass_chmap(struct hda_codec *codec, in alc_fixup_bass_chmap() argument
7627 struct alc_spec *spec = codec->spec; in alc_fixup_bass_chmap()
7633 static unsigned int gpio_led_power_filter(struct hda_codec *codec, in gpio_led_power_filter() argument
7637 struct alc_spec *spec = codec->spec; in gpio_led_power_filter()
7638 if (nid == codec->core.afg && power_state == AC_PWRST_D3 && spec->gpio_data) in gpio_led_power_filter()
7643 static void alc662_fixup_led_gpio1(struct hda_codec *codec, in alc662_fixup_led_gpio1() argument
7646 struct alc_spec *spec = codec->spec; in alc662_fixup_led_gpio1()
7648 alc_fixup_hp_gpio_led(codec, action, 0x01, 0); in alc662_fixup_led_gpio1()
7651 codec->power_filter = gpio_led_power_filter; in alc662_fixup_led_gpio1()
7655 static void alc662_usi_automute_hook(struct hda_codec *codec, in alc662_usi_automute_hook() argument
7658 struct alc_spec *spec = codec->spec; in alc662_usi_automute_hook()
7661 snd_hda_gen_hp_automute(codec, jack); in alc662_usi_automute_hook()
7665 snd_hda_codec_write(codec, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, in alc662_usi_automute_hook()
7669 static void alc662_fixup_usi_headset_mic(struct hda_codec *codec, in alc662_fixup_usi_headset_mic() argument
7672 struct alc_spec *spec = codec->spec; in alc662_fixup_usi_headset_mic()
7703 static void alc668_restore_default_value(struct hda_codec *codec) in alc668_restore_default_value() argument
7705 alc_process_coef_fw(codec, alc668_coefs); in alc668_restore_default_value()
8235 static int patch_alc662(struct hda_codec *codec) in patch_alc662() argument
8240 err = alc_alloc_spec(codec, 0x0b); in patch_alc662()
8244 spec = codec->spec; in patch_alc662()
8251 alc_fix_pll_init(codec, 0x20, 0x04, 15); in patch_alc662()
8253 switch (codec->core.vendor_id) { in patch_alc662()
8259 snd_hda_pick_fixup(codec, alc662_fixup_models, in patch_alc662()
8261 snd_hda_pick_pin_fixup(codec, alc662_pin_fixup_tbl, alc662_fixups); in patch_alc662()
8262 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); in patch_alc662()
8264 alc_auto_parse_customize_define(codec); in patch_alc662()
8266 if (has_cdefine_beep(codec)) in patch_alc662()
8269 if ((alc_get_coef0(codec) & (1 << 14)) && in patch_alc662()
8270 codec->bus->pci && codec->bus->pci->subsystem_vendor == 0x1025 && in patch_alc662()
8272 err = alc_codec_rename(codec, "ALC272X"); in patch_alc662()
8278 err = alc662_parse_auto_config(codec); in patch_alc662()
8283 switch (codec->core.vendor_id) { in patch_alc662()
8301 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); in patch_alc662()
8306 alc_free(codec); in patch_alc662()
8314 static int alc680_parse_auto_config(struct hda_codec *codec) in alc680_parse_auto_config() argument
8316 return alc_parse_auto_config(codec, NULL, NULL); in alc680_parse_auto_config()
8321 static int patch_alc680(struct hda_codec *codec) in patch_alc680() argument
8326 err = alc_alloc_spec(codec, 0); in patch_alc680()
8331 err = alc680_parse_auto_config(codec); in patch_alc680()
8333 alc_free(codec); in patch_alc680()