Lines Matching refs:codec

242 				   struct hda_codec *codec,
246 struct sigmatel_spec *spec = codec->spec;
252 struct hda_codec *codec,
256 struct sigmatel_spec *spec = codec->spec;
272 snd_hda_codec_write(codec, hinfo->nid, 0,
277 snd_hda_codec_write(codec, hinfo->nid, 0,
289 static void stac_gpio_set(struct hda_codec *codec, unsigned int mask,
293 hda_nid_t fg = codec->core.afg;
295 codec_dbg(codec, "%s msk %x dir %x gpio %x\n", __func__, mask, dir_mask, data);
297 gpiostate = snd_hda_codec_read(codec, fg, 0,
301 gpiomask = snd_hda_codec_read(codec, fg, 0,
305 gpiodir = snd_hda_codec_read(codec, fg, 0,
310 snd_hda_codec_write(codec, fg, 0, 0x7e7, 0);
312 snd_hda_codec_write(codec, fg, 0,
314 snd_hda_codec_read(codec, fg, 0,
319 snd_hda_codec_read(codec, fg, 0,
327 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
328 struct sigmatel_spec *spec = codec->spec;
334 stac_gpio_set(codec, spec->gpio_mask, spec->gpio_dir, spec->gpio_data);
338 static int stac_vrefout_set(struct hda_codec *codec,
343 codec_dbg(codec, "%s, nid %x ctl %x\n", __func__, nid, new_vref);
344 pinctl = snd_hda_codec_read(codec, nid, 0,
354 error = snd_hda_set_pin_ctl_cache(codec, nid, pinctl);
361 /* prevent codec AFG to D3 state when vref-out pin is used for mute LED */
363 static unsigned int stac_vref_led_power_filter(struct hda_codec *codec,
367 if (nid == codec->core.afg && power_state == AC_PWRST_D3)
369 return snd_hda_gen_path_power_filter(codec, nid, power_state);
373 static void stac_update_led_status(struct hda_codec *codec, bool muted)
375 struct sigmatel_spec *spec = codec->spec;
389 stac_gpio_set(codec, spec->gpio_mask,
393 stac_vrefout_set(codec, spec->vref_mute_led_nid,
402 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
404 stac_update_led_status(codec, brightness);
409 static void stac_update_outputs(struct hda_codec *codec)
411 struct sigmatel_spec *spec = codec->spec;
415 !(snd_hda_codec_read(codec, codec->core.afg, 0,
418 snd_hda_gen_update_outputs(codec);
428 stac_gpio_set(codec, spec->gpio_mask, spec->gpio_dir,
434 static void stac_toggle_power_map(struct hda_codec *codec, hda_nid_t nid,
437 struct sigmatel_spec *spec = codec->spec;
459 snd_hda_codec_write(codec, codec->core.afg, 0,
465 static void jack_update_power(struct hda_codec *codec,
468 struct sigmatel_spec *spec = codec->spec;
475 stac_toggle_power_map(codec, jack->nid,
476 snd_hda_jack_detect(codec, jack->nid),
484 if (!snd_hda_jack_tbl_get(codec, nid))
486 stac_toggle_power_map(codec, nid,
487 snd_hda_jack_detect(codec, nid),
491 snd_hda_codec_write(codec, codec->core.afg, 0,
496 static void stac_vref_event(struct hda_codec *codec,
501 data = snd_hda_codec_read(codec, codec->core.afg, 0,
504 snd_hda_codec_write(codec, codec->core.afg, 0, 0x7e0,
511 static void stac_init_power_map(struct hda_codec *codec)
513 struct sigmatel_spec *spec = codec->spec;
518 unsigned int def_conf = snd_hda_codec_get_pincfg(codec, nid);
522 is_jack_detectable(codec, nid)) {
523 snd_hda_jack_detect_enable_callback(codec, nid,
527 stac_toggle_power_map(codec, nid, false, false);
529 stac_toggle_power_map(codec, nid, true, false);
537 static inline bool get_int_hint(struct hda_codec *codec, const char *key,
540 return !snd_hda_get_int_hint(codec, key, valp);
544 static void stac_store_hints(struct hda_codec *codec)
546 struct sigmatel_spec *spec = codec->spec;
549 if (get_int_hint(codec, "gpio_mask", &spec->gpio_mask)) {
553 if (get_int_hint(codec, "gpio_dir", &spec->gpio_dir))
555 if (get_int_hint(codec, "gpio_data", &spec->gpio_data))
557 if (get_int_hint(codec, "eapd_mask", &spec->eapd_mask))
559 if (get_int_hint(codec, "gpio_mute", &spec->gpio_mute))
561 val = snd_hda_get_bool_hint(codec, "eapd_switch");
575 struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
577 struct sigmatel_spec *spec = codec->spec;
587 struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
588 struct sigmatel_spec *spec = codec->spec;
606 dac_mode = snd_hda_codec_read(codec, codec->core.afg, 0,
611 snd_hda_power_up(codec);
614 snd_hda_power_down(codec);
618 snd_hda_codec_write_cache(codec, codec->core.afg, 0,
640 static bool hp_bnb2011_with_dock(struct hda_codec *codec)
642 if (codec->core.vendor_id != 0x111d7605 &&
643 codec->core.vendor_id != 0x111d76d1)
646 switch (codec->core.subsystem_id) {
710 static void set_hp_led_gpio(struct hda_codec *codec)
712 struct sigmatel_spec *spec = codec->spec;
718 gpio = snd_hda_param_read(codec, codec->core.afg, AC_PAR_GPIO_CAP);
733 * If _G portion is missing it is assigned based on the codec ID
746 static int find_mute_led_cfg(struct hda_codec *codec, int default_polarity)
748 struct sigmatel_spec *spec = codec->spec;
751 if (get_int_hint(codec, "gpio_led", &spec->gpio_led)) {
752 get_int_hint(codec, "gpio_led_polarity",
762 max_gpio = snd_hda_param_read(codec, codec->core.afg,
773 set_hp_led_gpio(codec);
778 set_hp_led_gpio(codec);
792 if (!hp_blike_system(codec->core.subsystem_id) &&
794 set_hp_led_gpio(codec);
802 static bool has_builtin_speaker(struct hda_codec *codec)
804 struct sigmatel_spec *spec = codec->spec;
817 unsigned int def_conf = snd_hda_codec_get_pincfg(codec, nid_pin[i]);
829 static int stac_auto_create_beep_ctls(struct hda_codec *codec,
832 struct sigmatel_spec *spec = codec->spec;
833 u32 caps = query_amp_caps(codec, nid, HDA_OUTPUT);
876 struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
877 ucontrol->value.integer.value[0] = codec->beep->enabled;
884 struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
885 return snd_hda_enable_beep_device(codec, ucontrol->value.integer.value[0]);
896 static int stac_beep_switch_ctl(struct hda_codec *codec)
898 struct sigmatel_spec *spec = codec->spec;
913 struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
914 struct sigmatel_spec *spec = codec->spec;
921 struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
922 struct sigmatel_spec *spec = codec->spec;
932 struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
933 struct sigmatel_spec *spec = codec->spec;
936 return snd_hda_input_mux_put(codec, &spec->spdif_mux, ucontrol,
954 static int stac_create_spdif_mux_ctls(struct hda_codec *codec)
956 struct sigmatel_spec *spec = codec->spec;
965 num_cons = snd_hda_get_num_conns(codec, cfg->dig_out_pins[0]);
974 snd_hda_add_imux_item(codec, &spec->spdif_mux, labels[i], i, NULL);
1354 static void stac9200_fixup_panasonic(struct hda_codec *codec,
1357 struct sigmatel_spec *spec = codec->spec;
1695 /* gateway machines are checked via codec ssid */
1790 static void stac92hd73xx_fixup_ref(struct hda_codec *codec,
1793 struct sigmatel_spec *spec = codec->spec;
1798 snd_hda_apply_pincfgs(codec, ref92hd73xx_pin_configs);
1802 static void stac92hd73xx_fixup_dell(struct hda_codec *codec)
1804 struct sigmatel_spec *spec = codec->spec;
1806 snd_hda_apply_pincfgs(codec, dell_m6_pin_configs);
1810 static void stac92hd73xx_fixup_dell_eq(struct hda_codec *codec,
1813 struct sigmatel_spec *spec = codec->spec;
1818 stac92hd73xx_fixup_dell(codec);
1819 snd_hda_add_verbs(codec, dell_eq_core_init);
1824 static void stac92hd73xx_fixup_dell_m6_amic(struct hda_codec *codec,
1830 stac92hd73xx_fixup_dell(codec);
1831 snd_hda_codec_set_pincfg(codec, 0x0b, 0x90A70170);
1835 static void stac92hd73xx_fixup_dell_m6_dmic(struct hda_codec *codec,
1841 stac92hd73xx_fixup_dell(codec);
1842 snd_hda_codec_set_pincfg(codec, 0x13, 0x90A60160);
1846 static void stac92hd73xx_fixup_dell_m6_both(struct hda_codec *codec,
1852 stac92hd73xx_fixup_dell(codec);
1853 snd_hda_codec_set_pincfg(codec, 0x0b, 0x90A70170);
1854 snd_hda_codec_set_pincfg(codec, 0x13, 0x90A60160);
1857 static void stac92hd73xx_fixup_alienware_m17x(struct hda_codec *codec,
1860 struct sigmatel_spec *spec = codec->spec;
1865 snd_hda_apply_pincfgs(codec, alienware_m17x_pin_configs);
1869 static void stac92hd73xx_fixup_no_jd(struct hda_codec *codec,
1873 codec->no_jack_detect = 1;
1877 static void stac92hd73xx_disable_automute(struct hda_codec *codec,
1880 struct sigmatel_spec *spec = codec->spec;
2000 /* codec SSID matching */
2100 static void stac92hd83xxx_fixup_hp(struct hda_codec *codec,
2103 struct sigmatel_spec *spec = codec->spec;
2108 if (hp_bnb2011_with_dock(codec)) {
2109 snd_hda_codec_set_pincfg(codec, 0xa, 0x2101201f);
2110 snd_hda_codec_set_pincfg(codec, 0xf, 0x2181205e);
2113 if (find_mute_led_cfg(codec, spec->default_polarity))
2114 codec_dbg(codec, "mute LED gpio %d polarity %d\n",
2122 static void stac92hd83xxx_fixup_hp_zephyr(struct hda_codec *codec,
2128 snd_hda_apply_pincfgs(codec, hp_zephyr_pin_configs);
2129 snd_hda_add_verbs(codec, stac92hd83xxx_hp_zephyr_init);
2132 static void stac92hd83xxx_fixup_hp_led(struct hda_codec *codec,
2135 struct sigmatel_spec *spec = codec->spec;
2141 static void stac92hd83xxx_fixup_hp_inv_led(struct hda_codec *codec,
2144 struct sigmatel_spec *spec = codec->spec;
2150 static void stac92hd83xxx_fixup_hp_mic_led(struct hda_codec *codec,
2153 struct sigmatel_spec *spec = codec->spec;
2159 codec->core.power_caps &= ~AC_PWRST_CLKSTOP;
2164 static void stac92hd83xxx_fixup_hp_led_gpio10(struct hda_codec *codec,
2167 struct sigmatel_spec *spec = codec->spec;
2175 static void stac92hd83xxx_fixup_headset_jack(struct hda_codec *codec,
2178 struct sigmatel_spec *spec = codec->spec;
2184 static void stac92hd83xxx_fixup_gpio10_eapd(struct hda_codec *codec,
2188 struct sigmatel_spec *spec = codec->spec;
2197 static void hp_envy_ts_fixup_dac_bind(struct hda_codec *codec,
2201 struct sigmatel_spec *spec = codec->spec;
2956 struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
2957 struct sigmatel_spec *spec = codec->spec;
2965 struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
2966 struct sigmatel_spec *spec = codec->spec;
2974 stac_gpio_set(codec, spec->gpio_mask, spec->gpio_dir, spec->gpio_data);
2985 static int stac_add_hp_bass_switch(struct hda_codec *codec)
2987 struct sigmatel_spec *spec = codec->spec;
3059 static void stac92hd71bxx_fixup_ref(struct hda_codec *codec,
3062 struct sigmatel_spec *spec = codec->spec;
3067 snd_hda_apply_pincfgs(codec, ref92hd71bxx_pin_configs);
3071 static void stac92hd71bxx_fixup_hp_m4(struct hda_codec *codec,
3074 struct sigmatel_spec *spec = codec->spec;
3081 snd_hda_codec_write_cache(codec, codec->core.afg, 0,
3083 jack = snd_hda_jack_detect_enable_callback(codec, codec->core.afg,
3091 snd_hda_codec_set_pincfg(codec, 0x0e, 0x01813040);
3094 static void stac92hd71bxx_fixup_hp_dv4(struct hda_codec *codec,
3097 struct sigmatel_spec *spec = codec->spec;
3104 static void stac92hd71bxx_fixup_hp_dv5(struct hda_codec *codec,
3111 snd_hda_codec_set_pincfg(codec, 0x0d, 0x90170010);
3116 cap = snd_hda_param_read(codec, 0x1, AC_PAR_GPIO_CAP);
3119 stac_add_hp_bass_switch(codec);
3124 static void stac92hd71bxx_fixup_hp_hdx(struct hda_codec *codec,
3127 struct sigmatel_spec *spec = codec->spec;
3134 static bool is_hp_output(struct hda_codec *codec, hda_nid_t pin)
3136 unsigned int pin_cfg = snd_hda_codec_get_pincfg(codec, pin);
3144 static void fixup_hp_headphone(struct hda_codec *codec, hda_nid_t pin)
3146 unsigned int pin_cfg = snd_hda_codec_get_pincfg(codec, pin);
3155 snd_hda_codec_set_pincfg(codec, pin, pin_cfg);
3158 static void stac92hd71bxx_fixup_hp(struct hda_codec *codec,
3161 struct sigmatel_spec *spec = codec->spec;
3169 if (is_hp_output(codec, 0x0a) && is_hp_output(codec, 0x0f)) {
3170 fixup_hp_headphone(codec, 0x0a);
3171 fixup_hp_headphone(codec, 0x0f);
3174 if (find_mute_led_cfg(codec, 1))
3175 codec_dbg(codec, "mute LED gpio %d polarity %d\n",
3500 /* codec SSIDs for Intel Mac sharing the same PCI SSID 8384:7680 */
3520 /* remap the fixup from codec SSID and apply it */
3521 static void stac922x_fixup_intel_mac_auto(struct hda_codec *codec,
3528 codec->fixup_id = HDA_FIXUP_ID_NOT_SET;
3529 snd_hda_pick_fixup(codec, NULL, stac922x_intel_mac_fixup_tbl,
3531 if (codec->fixup_id != HDA_FIXUP_ID_NOT_SET)
3532 snd_hda_apply_fixup(codec, action);
3535 static void stac922x_fixup_intel_mac_gpio(struct hda_codec *codec,
3539 struct sigmatel_spec *spec = codec->spec;
3827 static void stac927x_fixup_ref_no_jd(struct hda_codec *codec,
3832 codec->no_jack_detect = 1;
3835 static void stac927x_fixup_ref(struct hda_codec *codec,
3838 struct sigmatel_spec *spec = codec->spec;
3841 snd_hda_apply_pincfgs(codec, ref927x_pin_configs);
3847 static void stac927x_fixup_dell_dmic(struct hda_codec *codec,
3850 struct sigmatel_spec *spec = codec->spec;
3855 if (codec->core.subsystem_id != 0x1028022f) {
3861 snd_hda_add_verbs(codec, dell_3st_core_init);
3865 static void stac927x_fixup_volknob(struct hda_codec *codec,
3868 struct sigmatel_spec *spec = codec->spec;
3871 snd_hda_add_verbs(codec, stac927x_volknob_core_init);
4101 static void stac9205_fixup_ref(struct hda_codec *codec,
4104 struct sigmatel_spec *spec = codec->spec;
4107 snd_hda_apply_pincfgs(codec, ref9205_pin_configs);
4113 static void stac9205_fixup_dell_m43(struct hda_codec *codec,
4116 struct sigmatel_spec *spec = codec->spec;
4120 snd_hda_apply_pincfgs(codec, dell_9205_m43_pin_configs);
4123 snd_hda_codec_write_cache(codec, codec->core.afg, 0,
4125 jack = snd_hda_jack_detect_enable_callback(codec, codec->core.afg,
4141 static void stac9205_fixup_eapd(struct hda_codec *codec,
4144 struct sigmatel_spec *spec = codec->spec;
4230 static void stac92hd95_fixup_hp_led(struct hda_codec *codec,
4233 struct sigmatel_spec *spec = codec->spec;
4238 if (find_mute_led_cfg(codec, spec->default_polarity))
4239 codec_dbg(codec, "mute LED gpio %d polarity %d\n",
4272 static int stac_parse_auto_config(struct hda_codec *codec)
4274 struct sigmatel_spec *spec = codec->spec;
4281 err = snd_hda_parse_pin_defcfg(codec, &spec->gen.autocfg, NULL, flags);
4291 err = snd_hda_gen_parse_auto_config(codec, &spec->gen.autocfg);
4296 err = snd_hda_gen_fix_pin_power(codec, spec->vref_mute_led_nid);
4303 err = stac_auto_create_beep_ctls(codec,
4315 err = stac_auto_create_beep_ctls(codec, nid);
4318 if (codec->beep) {
4320 codec->beep->linear_tone = spec->linear_tone_beep;
4322 codec->beep->keep_power_at_enable = 1;
4324 caps = query_amp_caps(codec, nid, HDA_OUTPUT);
4326 err = stac_beep_switch_ctl(codec);
4335 snd_hda_gen_add_mute_led_cdev(codec, stac_vmaster_hook);
4338 snd_hda_get_bool_hint(codec, "loopback") == 1) {
4341 if (snd_hdac_regmap_add_vendor_verb(&codec->core, wr_verb))
4348 err = stac_create_spdif_mux_ctls(codec);
4353 stac_init_power_map(codec);
4358 static int stac_init(struct hda_codec *codec)
4360 struct sigmatel_spec *spec = codec->spec;
4364 stac_store_hints(codec);
4372 stac_gpio_set(codec, spec->gpio_mask, spec->gpio_dir, spec->gpio_data);
4374 snd_hda_gen_init(codec);
4378 snd_hda_codec_write(codec, codec->core.afg, 0,
4387 snd_hda_codec_write(codec, spec->gen.all_adcs[i], 0,
4396 static void stac_shutup(struct hda_codec *codec)
4398 struct sigmatel_spec *spec = codec->spec;
4400 snd_hda_shutup_pins(codec);
4403 stac_gpio_set(codec, spec->gpio_mask,
4412 struct hda_codec *codec, hda_nid_t nid)
4414 if (nid == codec->core.afg)
4416 snd_hda_codec_read(codec, nid, 0,
4421 struct hda_codec *codec,
4425 snd_hda_codec_read(codec, codec->core.afg, 0, verb, 0));
4430 struct hda_codec *codec, hda_nid_t nid)
4432 stac92hd_proc_hook(buffer, codec, nid);
4433 if (nid == codec->core.afg)
4434 analog_loop_proc_hook(buffer, codec, 0xfa0);
4438 struct hda_codec *codec, hda_nid_t nid)
4440 if (nid == codec->core.afg)
4441 analog_loop_proc_hook(buffer, codec, 0xfe0);
4445 struct hda_codec *codec, hda_nid_t nid)
4447 if (nid == codec->core.afg)
4448 analog_loop_proc_hook(buffer, codec, 0xfeb);
4458 static int stac_suspend(struct hda_codec *codec)
4460 stac_shutup(codec);
4479 static int alloc_stac_spec(struct hda_codec *codec)
4487 codec->spec = spec;
4488 codec->no_trigger_sense = 1; /* seems common with STAC/IDT codecs */
4490 codec->patch_ops = stac_patch_ops;
4494 static int patch_stac9200(struct hda_codec *codec)
4499 err = alloc_stac_spec(codec);
4503 spec = codec->spec;
4507 codec->power_filter = snd_hda_codec_eapd_power_filter;
4509 snd_hda_add_verbs(codec, stac9200_eapd_init);
4511 snd_hda_pick_fixup(codec, stac9200_models, stac9200_fixup_tbl,
4513 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
4515 err = stac_parse_auto_config(codec);
4517 stac_free(codec);
4521 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
4526 static int patch_stac925x(struct hda_codec *codec)
4531 err = alloc_stac_spec(codec);
4535 spec = codec->spec;
4539 snd_hda_add_verbs(codec, stac925x_core_init);
4541 snd_hda_pick_fixup(codec, stac925x_models, stac925x_fixup_tbl,
4543 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
4545 err = stac_parse_auto_config(codec);
4547 stac_free(codec);
4551 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
4556 static int patch_stac92hd73xx(struct hda_codec *codec)
4562 err = alloc_stac_spec(codec);
4566 spec = codec->spec;
4570 if ((codec->core.vendor_id & 0xfffffff0) != 0x111d7670)
4571 codec->power_save_node = 1;
4576 num_dacs = snd_hda_get_num_conns(codec, 0x0a) - 1;
4578 codec_warn(codec,
4612 snd_hda_pick_fixup(codec, stac92hd73xx_models, stac92hd73xx_fixup_tbl,
4614 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
4617 snd_hda_add_verbs(codec, stac92hd73xx_core_init);
4619 err = stac_parse_auto_config(codec);
4621 stac_free(codec);
4628 if (spec->eapd_switch && !has_builtin_speaker(codec))
4631 codec->proc_widget_hook = stac92hd7x_proc_hook;
4633 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
4638 static void stac_setup_gpio(struct hda_codec *codec)
4640 struct sigmatel_spec *spec = codec->spec;
4649 codec->power_filter = stac_vref_led_power_filter;
4658 snd_hda_gen_add_micmute_led_cdev(codec, stac_capture_led_update);
4662 static int patch_stac92hd83xxx(struct hda_codec *codec)
4667 err = alloc_stac_spec(codec);
4672 codec->core.power_caps &= ~AC_PWRST_EPSS;
4674 spec = codec->spec;
4675 codec->power_save_node = 1;
4686 snd_hda_add_verbs(codec, stac92hd83xxx_core_init);
4688 snd_hda_pick_fixup(codec, stac92hd83xxx_models, stac92hd83xxx_fixup_tbl,
4690 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
4692 stac_setup_gpio(codec);
4694 err = stac_parse_auto_config(codec);
4696 stac_free(codec);
4700 codec->proc_widget_hook = stac92hd_proc_hook;
4702 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
4711 static int patch_stac92hd95(struct hda_codec *codec)
4716 err = alloc_stac_spec(codec);
4721 codec->core.power_caps &= ~AC_PWRST_EPSS;
4723 spec = codec->spec;
4724 codec->power_save_node = 1;
4734 snd_hda_pick_fixup(codec, stac92hd95_models, stac92hd95_fixup_tbl,
4736 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
4738 stac_setup_gpio(codec);
4740 err = stac_parse_auto_config(codec);
4742 stac_free(codec);
4746 codec->proc_widget_hook = stac92hd_proc_hook;
4748 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
4753 static int patch_stac92hd71bxx(struct hda_codec *codec)
4759 err = alloc_stac_spec(codec);
4763 spec = codec->spec;
4765 /* codec->power_save_node = 1; */
4777 switch (codec->core.vendor_id) {
4783 if ((codec->core.revision_id & 0xf) == 0 ||
4784 (codec->core.revision_id & 0xf) == 1)
4789 snd_hda_codec_set_pincfg(codec, 0x0f, 0x40f000f0);
4790 snd_hda_codec_set_pincfg(codec, 0x19, 0x40f000f3);
4793 if ((codec->core.revision_id & 0xf) == 1)
4799 if (get_wcaps_type(get_wcaps(codec, 0x28)) == AC_WID_VOL_KNB)
4800 snd_hda_add_verbs(codec, stac92hd71bxx_core_init);
4802 if (get_wcaps(codec, 0xa) & AC_WCAP_IN_AMP) {
4805 snd_hda_codec_amp_init_stereo(codec, *p, HDA_INPUT, 0,
4818 snd_hda_pick_fixup(codec, stac92hd71bxx_models, stac92hd71bxx_fixup_tbl,
4820 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
4822 stac_setup_gpio(codec);
4824 err = stac_parse_auto_config(codec);
4826 stac_free(codec);
4830 codec->proc_widget_hook = stac92hd7x_proc_hook;
4832 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
4837 static int patch_stac922x(struct hda_codec *codec)
4842 err = alloc_stac_spec(codec);
4846 spec = codec->spec;
4850 snd_hda_add_verbs(codec, stac922x_core_init);
4853 snd_hda_override_amp_caps(codec, 0x12, HDA_OUTPUT,
4859 snd_hda_pick_fixup(codec, stac922x_models, stac922x_fixup_tbl,
4861 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
4863 err = stac_parse_auto_config(codec);
4865 stac_free(codec);
4869 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
4879 static int patch_stac927x(struct hda_codec *codec)
4884 err = alloc_stac_spec(codec);
4888 spec = codec->spec;
4905 snd_hda_pick_fixup(codec, stac927x_models, stac927x_fixup_tbl,
4907 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
4910 snd_hda_add_verbs(codec, stac927x_core_init);
4912 err = stac_parse_auto_config(codec);
4914 stac_free(codec);
4918 codec->proc_widget_hook = stac927x_proc_hook;
4930 codec->bus->core.needs_damn_long_delay = 1;
4932 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
4937 static int patch_stac9205(struct hda_codec *codec)
4942 err = alloc_stac_spec(codec);
4946 spec = codec->spec;
4953 snd_hda_add_verbs(codec, stac9205_core_init);
4966 snd_hda_pick_fixup(codec, stac9205_models, stac9205_fixup_tbl,
4968 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
4970 err = stac_parse_auto_config(codec);
4972 stac_free(codec);
4976 codec->proc_widget_hook = stac9205_proc_hook;
4978 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
5024 static int patch_stac9872(struct hda_codec *codec)
5029 err = alloc_stac_spec(codec);
5033 spec = codec->spec;
5037 snd_hda_add_verbs(codec, stac9872_core_init);
5039 snd_hda_pick_fixup(codec, stac9872_models, stac9872_fixup_tbl,
5041 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
5043 err = stac_parse_auto_config(codec);
5045 stac_free(codec);
5049 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
5168 MODULE_DESCRIPTION("IDT/Sigmatel HD-audio codec");