Lines Matching refs:codec
242 struct hda_codec *codec, in stac_playback_pcm_hook() argument
246 struct sigmatel_spec *spec = codec->spec; in stac_playback_pcm_hook()
252 struct hda_codec *codec, in stac_capture_pcm_hook() argument
256 struct sigmatel_spec *spec = codec->spec; in stac_capture_pcm_hook()
272 snd_hda_codec_write(codec, hinfo->nid, 0, in stac_capture_pcm_hook()
277 snd_hda_codec_write(codec, hinfo->nid, 0, in stac_capture_pcm_hook()
289 static void stac_gpio_set(struct hda_codec *codec, unsigned int mask, in stac_gpio_set() argument
293 hda_nid_t fg = codec->core.afg; in stac_gpio_set()
295 codec_dbg(codec, "%s msk %x dir %x gpio %x\n", __func__, mask, dir_mask, data); in stac_gpio_set()
297 gpiostate = snd_hda_codec_read(codec, fg, 0, in stac_gpio_set()
301 gpiomask = snd_hda_codec_read(codec, fg, 0, in stac_gpio_set()
305 gpiodir = snd_hda_codec_read(codec, fg, 0, in stac_gpio_set()
310 snd_hda_codec_write(codec, fg, 0, 0x7e7, 0); in stac_gpio_set()
312 snd_hda_codec_write(codec, fg, 0, in stac_gpio_set()
314 snd_hda_codec_read(codec, fg, 0, in stac_gpio_set()
319 snd_hda_codec_read(codec, fg, 0, in stac_gpio_set()
327 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent); in stac_capture_led_update() local
328 struct sigmatel_spec *spec = codec->spec; in stac_capture_led_update()
334 stac_gpio_set(codec, spec->gpio_mask, spec->gpio_dir, spec->gpio_data); in stac_capture_led_update()
338 static int stac_vrefout_set(struct hda_codec *codec, in stac_vrefout_set() argument
343 codec_dbg(codec, "%s, nid %x ctl %x\n", __func__, nid, new_vref); in stac_vrefout_set()
344 pinctl = snd_hda_codec_read(codec, nid, 0, in stac_vrefout_set()
354 error = snd_hda_set_pin_ctl_cache(codec, nid, pinctl); in stac_vrefout_set()
363 static unsigned int stac_vref_led_power_filter(struct hda_codec *codec, in stac_vref_led_power_filter() argument
367 if (nid == codec->core.afg && power_state == AC_PWRST_D3) in stac_vref_led_power_filter()
369 return snd_hda_gen_path_power_filter(codec, nid, power_state); in stac_vref_led_power_filter()
373 static void stac_update_led_status(struct hda_codec *codec, bool muted) in stac_update_led_status() argument
375 struct sigmatel_spec *spec = codec->spec; in stac_update_led_status()
389 stac_gpio_set(codec, spec->gpio_mask, in stac_update_led_status()
393 stac_vrefout_set(codec, spec->vref_mute_led_nid, in stac_update_led_status()
402 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent); in stac_vmaster_hook() local
404 stac_update_led_status(codec, brightness); in stac_vmaster_hook()
409 static void stac_update_outputs(struct hda_codec *codec) in stac_update_outputs() argument
411 struct sigmatel_spec *spec = codec->spec; in stac_update_outputs()
415 !(snd_hda_codec_read(codec, codec->core.afg, 0, in stac_update_outputs()
418 snd_hda_gen_update_outputs(codec); in stac_update_outputs()
428 stac_gpio_set(codec, spec->gpio_mask, spec->gpio_dir, in stac_update_outputs()
434 static void stac_toggle_power_map(struct hda_codec *codec, hda_nid_t nid, in stac_toggle_power_map() argument
437 struct sigmatel_spec *spec = codec->spec; in stac_toggle_power_map()
459 snd_hda_codec_write(codec, codec->core.afg, 0, in stac_toggle_power_map()
465 static void jack_update_power(struct hda_codec *codec, in jack_update_power() argument
468 struct sigmatel_spec *spec = codec->spec; in jack_update_power()
475 stac_toggle_power_map(codec, jack->nid, in jack_update_power()
476 snd_hda_jack_detect(codec, jack->nid), in jack_update_power()
484 if (!snd_hda_jack_tbl_get(codec, nid)) in jack_update_power()
486 stac_toggle_power_map(codec, nid, in jack_update_power()
487 snd_hda_jack_detect(codec, nid), in jack_update_power()
491 snd_hda_codec_write(codec, codec->core.afg, 0, in jack_update_power()
496 static void stac_vref_event(struct hda_codec *codec, in stac_vref_event() argument
501 data = snd_hda_codec_read(codec, codec->core.afg, 0, in stac_vref_event()
504 snd_hda_codec_write(codec, codec->core.afg, 0, 0x7e0, in stac_vref_event()
511 static void stac_init_power_map(struct hda_codec *codec) in stac_init_power_map() argument
513 struct sigmatel_spec *spec = codec->spec; in stac_init_power_map()
518 unsigned int def_conf = snd_hda_codec_get_pincfg(codec, nid); in stac_init_power_map()
522 is_jack_detectable(codec, nid)) { in stac_init_power_map()
523 snd_hda_jack_detect_enable_callback(codec, nid, in stac_init_power_map()
527 stac_toggle_power_map(codec, nid, false, false); in stac_init_power_map()
529 stac_toggle_power_map(codec, nid, true, false); in stac_init_power_map()
537 static inline bool get_int_hint(struct hda_codec *codec, const char *key, in get_int_hint() argument
540 return !snd_hda_get_int_hint(codec, key, valp); in get_int_hint()
544 static void stac_store_hints(struct hda_codec *codec) in stac_store_hints() argument
546 struct sigmatel_spec *spec = codec->spec; in stac_store_hints()
549 if (get_int_hint(codec, "gpio_mask", &spec->gpio_mask)) { in stac_store_hints()
553 if (get_int_hint(codec, "gpio_dir", &spec->gpio_dir)) in stac_store_hints()
555 if (get_int_hint(codec, "gpio_data", &spec->gpio_data)) in stac_store_hints()
557 if (get_int_hint(codec, "eapd_mask", &spec->eapd_mask)) in stac_store_hints()
559 if (get_int_hint(codec, "gpio_mute", &spec->gpio_mute)) in stac_store_hints()
561 val = snd_hda_get_bool_hint(codec, "eapd_switch"); in stac_store_hints()
575 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); in stac_aloopback_get() local
577 struct sigmatel_spec *spec = codec->spec; in stac_aloopback_get()
587 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); in stac_aloopback_put() local
588 struct sigmatel_spec *spec = codec->spec; in stac_aloopback_put()
606 dac_mode = snd_hda_codec_read(codec, codec->core.afg, 0, in stac_aloopback_put()
611 snd_hda_power_up(codec); in stac_aloopback_put()
614 snd_hda_power_down(codec); in stac_aloopback_put()
618 snd_hda_codec_write_cache(codec, codec->core.afg, 0, in stac_aloopback_put()
640 static bool hp_bnb2011_with_dock(struct hda_codec *codec) in hp_bnb2011_with_dock() argument
642 if (codec->core.vendor_id != 0x111d7605 && in hp_bnb2011_with_dock()
643 codec->core.vendor_id != 0x111d76d1) in hp_bnb2011_with_dock()
646 switch (codec->core.subsystem_id) { in hp_bnb2011_with_dock()
710 static void set_hp_led_gpio(struct hda_codec *codec) in set_hp_led_gpio() argument
712 struct sigmatel_spec *spec = codec->spec; in set_hp_led_gpio()
718 gpio = snd_hda_param_read(codec, codec->core.afg, AC_PAR_GPIO_CAP); in set_hp_led_gpio()
746 static int find_mute_led_cfg(struct hda_codec *codec, int default_polarity) in find_mute_led_cfg() argument
748 struct sigmatel_spec *spec = codec->spec; in find_mute_led_cfg()
751 if (get_int_hint(codec, "gpio_led", &spec->gpio_led)) { in find_mute_led_cfg()
752 get_int_hint(codec, "gpio_led_polarity", in find_mute_led_cfg()
762 max_gpio = snd_hda_param_read(codec, codec->core.afg, in find_mute_led_cfg()
773 set_hp_led_gpio(codec); in find_mute_led_cfg()
778 set_hp_led_gpio(codec); in find_mute_led_cfg()
792 if (!hp_blike_system(codec->core.subsystem_id) && in find_mute_led_cfg()
794 set_hp_led_gpio(codec); in find_mute_led_cfg()
802 static bool has_builtin_speaker(struct hda_codec *codec) in has_builtin_speaker() argument
804 struct sigmatel_spec *spec = codec->spec; in has_builtin_speaker()
817 unsigned int def_conf = snd_hda_codec_get_pincfg(codec, nid_pin[i]); in has_builtin_speaker()
829 static int stac_auto_create_beep_ctls(struct hda_codec *codec, in stac_auto_create_beep_ctls() argument
832 struct sigmatel_spec *spec = codec->spec; in stac_auto_create_beep_ctls()
833 u32 caps = query_amp_caps(codec, nid, HDA_OUTPUT); in stac_auto_create_beep_ctls()
876 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); in stac_dig_beep_switch_get() local
877 ucontrol->value.integer.value[0] = codec->beep->enabled; in stac_dig_beep_switch_get()
884 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); in stac_dig_beep_switch_put() local
885 return snd_hda_enable_beep_device(codec, ucontrol->value.integer.value[0]); in stac_dig_beep_switch_put()
896 static int stac_beep_switch_ctl(struct hda_codec *codec) in stac_beep_switch_ctl() argument
898 struct sigmatel_spec *spec = codec->spec; in stac_beep_switch_ctl()
913 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); in stac_smux_enum_info() local
914 struct sigmatel_spec *spec = codec->spec; in stac_smux_enum_info()
921 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); in stac_smux_enum_get() local
922 struct sigmatel_spec *spec = codec->spec; in stac_smux_enum_get()
932 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); in stac_smux_enum_put() local
933 struct sigmatel_spec *spec = codec->spec; in stac_smux_enum_put()
936 return snd_hda_input_mux_put(codec, &spec->spdif_mux, ucontrol, in stac_smux_enum_put()
954 static int stac_create_spdif_mux_ctls(struct hda_codec *codec) in stac_create_spdif_mux_ctls() argument
956 struct sigmatel_spec *spec = codec->spec; in stac_create_spdif_mux_ctls()
965 num_cons = snd_hda_get_num_conns(codec, cfg->dig_out_pins[0]); in stac_create_spdif_mux_ctls()
974 snd_hda_add_imux_item(codec, &spec->spdif_mux, labels[i], i, NULL); in stac_create_spdif_mux_ctls()
1354 static void stac9200_fixup_panasonic(struct hda_codec *codec, in stac9200_fixup_panasonic() argument
1357 struct sigmatel_spec *spec = codec->spec; in stac9200_fixup_panasonic()
1790 static void stac92hd73xx_fixup_ref(struct hda_codec *codec, in stac92hd73xx_fixup_ref() argument
1793 struct sigmatel_spec *spec = codec->spec; in stac92hd73xx_fixup_ref()
1798 snd_hda_apply_pincfgs(codec, ref92hd73xx_pin_configs); in stac92hd73xx_fixup_ref()
1802 static void stac92hd73xx_fixup_dell(struct hda_codec *codec) in stac92hd73xx_fixup_dell() argument
1804 struct sigmatel_spec *spec = codec->spec; in stac92hd73xx_fixup_dell()
1806 snd_hda_apply_pincfgs(codec, dell_m6_pin_configs); in stac92hd73xx_fixup_dell()
1810 static void stac92hd73xx_fixup_dell_eq(struct hda_codec *codec, in stac92hd73xx_fixup_dell_eq() argument
1813 struct sigmatel_spec *spec = codec->spec; in stac92hd73xx_fixup_dell_eq()
1818 stac92hd73xx_fixup_dell(codec); in stac92hd73xx_fixup_dell_eq()
1819 snd_hda_add_verbs(codec, dell_eq_core_init); in stac92hd73xx_fixup_dell_eq()
1824 static void stac92hd73xx_fixup_dell_m6_amic(struct hda_codec *codec, in stac92hd73xx_fixup_dell_m6_amic() argument
1830 stac92hd73xx_fixup_dell(codec); in stac92hd73xx_fixup_dell_m6_amic()
1831 snd_hda_codec_set_pincfg(codec, 0x0b, 0x90A70170); in stac92hd73xx_fixup_dell_m6_amic()
1835 static void stac92hd73xx_fixup_dell_m6_dmic(struct hda_codec *codec, in stac92hd73xx_fixup_dell_m6_dmic() argument
1841 stac92hd73xx_fixup_dell(codec); in stac92hd73xx_fixup_dell_m6_dmic()
1842 snd_hda_codec_set_pincfg(codec, 0x13, 0x90A60160); in stac92hd73xx_fixup_dell_m6_dmic()
1846 static void stac92hd73xx_fixup_dell_m6_both(struct hda_codec *codec, in stac92hd73xx_fixup_dell_m6_both() argument
1852 stac92hd73xx_fixup_dell(codec); in stac92hd73xx_fixup_dell_m6_both()
1853 snd_hda_codec_set_pincfg(codec, 0x0b, 0x90A70170); in stac92hd73xx_fixup_dell_m6_both()
1854 snd_hda_codec_set_pincfg(codec, 0x13, 0x90A60160); in stac92hd73xx_fixup_dell_m6_both()
1857 static void stac92hd73xx_fixup_alienware_m17x(struct hda_codec *codec, in stac92hd73xx_fixup_alienware_m17x() argument
1860 struct sigmatel_spec *spec = codec->spec; in stac92hd73xx_fixup_alienware_m17x()
1865 snd_hda_apply_pincfgs(codec, alienware_m17x_pin_configs); in stac92hd73xx_fixup_alienware_m17x()
1869 static void stac92hd73xx_fixup_no_jd(struct hda_codec *codec, in stac92hd73xx_fixup_no_jd() argument
1873 codec->no_jack_detect = 1; in stac92hd73xx_fixup_no_jd()
1877 static void stac92hd73xx_disable_automute(struct hda_codec *codec, in stac92hd73xx_disable_automute() argument
1880 struct sigmatel_spec *spec = codec->spec; in stac92hd73xx_disable_automute()
2100 static void stac92hd83xxx_fixup_hp(struct hda_codec *codec, in stac92hd83xxx_fixup_hp() argument
2103 struct sigmatel_spec *spec = codec->spec; in stac92hd83xxx_fixup_hp()
2108 if (hp_bnb2011_with_dock(codec)) { in stac92hd83xxx_fixup_hp()
2109 snd_hda_codec_set_pincfg(codec, 0xa, 0x2101201f); in stac92hd83xxx_fixup_hp()
2110 snd_hda_codec_set_pincfg(codec, 0xf, 0x2181205e); in stac92hd83xxx_fixup_hp()
2113 if (find_mute_led_cfg(codec, spec->default_polarity)) in stac92hd83xxx_fixup_hp()
2114 codec_dbg(codec, "mute LED gpio %d polarity %d\n", in stac92hd83xxx_fixup_hp()
2122 static void stac92hd83xxx_fixup_hp_zephyr(struct hda_codec *codec, in stac92hd83xxx_fixup_hp_zephyr() argument
2128 snd_hda_apply_pincfgs(codec, hp_zephyr_pin_configs); in stac92hd83xxx_fixup_hp_zephyr()
2129 snd_hda_add_verbs(codec, stac92hd83xxx_hp_zephyr_init); in stac92hd83xxx_fixup_hp_zephyr()
2132 static void stac92hd83xxx_fixup_hp_led(struct hda_codec *codec, in stac92hd83xxx_fixup_hp_led() argument
2135 struct sigmatel_spec *spec = codec->spec; in stac92hd83xxx_fixup_hp_led()
2141 static void stac92hd83xxx_fixup_hp_inv_led(struct hda_codec *codec, in stac92hd83xxx_fixup_hp_inv_led() argument
2144 struct sigmatel_spec *spec = codec->spec; in stac92hd83xxx_fixup_hp_inv_led()
2150 static void stac92hd83xxx_fixup_hp_mic_led(struct hda_codec *codec, in stac92hd83xxx_fixup_hp_mic_led() argument
2153 struct sigmatel_spec *spec = codec->spec; in stac92hd83xxx_fixup_hp_mic_led()
2158 codec->core.power_caps &= ~AC_PWRST_CLKSTOP; in stac92hd83xxx_fixup_hp_mic_led()
2162 static void stac92hd83xxx_fixup_hp_led_gpio10(struct hda_codec *codec, in stac92hd83xxx_fixup_hp_led_gpio10() argument
2165 struct sigmatel_spec *spec = codec->spec; in stac92hd83xxx_fixup_hp_led_gpio10()
2173 static void stac92hd83xxx_fixup_headset_jack(struct hda_codec *codec, in stac92hd83xxx_fixup_headset_jack() argument
2176 struct sigmatel_spec *spec = codec->spec; in stac92hd83xxx_fixup_headset_jack()
2182 static void stac92hd83xxx_fixup_gpio10_eapd(struct hda_codec *codec, in stac92hd83xxx_fixup_gpio10_eapd() argument
2186 struct sigmatel_spec *spec = codec->spec; in stac92hd83xxx_fixup_gpio10_eapd()
2195 static void hp_envy_ts_fixup_dac_bind(struct hda_codec *codec, in hp_envy_ts_fixup_dac_bind() argument
2199 struct sigmatel_spec *spec = codec->spec; in hp_envy_ts_fixup_dac_bind()
2954 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); in stac_hp_bass_gpio_get() local
2955 struct sigmatel_spec *spec = codec->spec; in stac_hp_bass_gpio_get()
2963 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); in stac_hp_bass_gpio_put() local
2964 struct sigmatel_spec *spec = codec->spec; in stac_hp_bass_gpio_put()
2972 stac_gpio_set(codec, spec->gpio_mask, spec->gpio_dir, spec->gpio_data); in stac_hp_bass_gpio_put()
2983 static int stac_add_hp_bass_switch(struct hda_codec *codec) in stac_add_hp_bass_switch() argument
2985 struct sigmatel_spec *spec = codec->spec; in stac_add_hp_bass_switch()
3057 static void stac92hd71bxx_fixup_ref(struct hda_codec *codec, in stac92hd71bxx_fixup_ref() argument
3060 struct sigmatel_spec *spec = codec->spec; in stac92hd71bxx_fixup_ref()
3065 snd_hda_apply_pincfgs(codec, ref92hd71bxx_pin_configs); in stac92hd71bxx_fixup_ref()
3069 static void stac92hd71bxx_fixup_hp_m4(struct hda_codec *codec, in stac92hd71bxx_fixup_hp_m4() argument
3072 struct sigmatel_spec *spec = codec->spec; in stac92hd71bxx_fixup_hp_m4()
3079 snd_hda_codec_write_cache(codec, codec->core.afg, 0, in stac92hd71bxx_fixup_hp_m4()
3081 jack = snd_hda_jack_detect_enable_callback(codec, codec->core.afg, in stac92hd71bxx_fixup_hp_m4()
3089 snd_hda_codec_set_pincfg(codec, 0x0e, 0x01813040); in stac92hd71bxx_fixup_hp_m4()
3092 static void stac92hd71bxx_fixup_hp_dv4(struct hda_codec *codec, in stac92hd71bxx_fixup_hp_dv4() argument
3095 struct sigmatel_spec *spec = codec->spec; in stac92hd71bxx_fixup_hp_dv4()
3102 static void stac92hd71bxx_fixup_hp_dv5(struct hda_codec *codec, in stac92hd71bxx_fixup_hp_dv5() argument
3109 snd_hda_codec_set_pincfg(codec, 0x0d, 0x90170010); in stac92hd71bxx_fixup_hp_dv5()
3114 cap = snd_hda_param_read(codec, 0x1, AC_PAR_GPIO_CAP); in stac92hd71bxx_fixup_hp_dv5()
3117 stac_add_hp_bass_switch(codec); in stac92hd71bxx_fixup_hp_dv5()
3122 static void stac92hd71bxx_fixup_hp_hdx(struct hda_codec *codec, in stac92hd71bxx_fixup_hp_hdx() argument
3125 struct sigmatel_spec *spec = codec->spec; in stac92hd71bxx_fixup_hp_hdx()
3132 static bool is_hp_output(struct hda_codec *codec, hda_nid_t pin) in is_hp_output() argument
3134 unsigned int pin_cfg = snd_hda_codec_get_pincfg(codec, pin); in is_hp_output()
3142 static void fixup_hp_headphone(struct hda_codec *codec, hda_nid_t pin) in fixup_hp_headphone() argument
3144 unsigned int pin_cfg = snd_hda_codec_get_pincfg(codec, pin); in fixup_hp_headphone()
3153 snd_hda_codec_set_pincfg(codec, pin, pin_cfg); in fixup_hp_headphone()
3156 static void stac92hd71bxx_fixup_hp(struct hda_codec *codec, in stac92hd71bxx_fixup_hp() argument
3159 struct sigmatel_spec *spec = codec->spec; in stac92hd71bxx_fixup_hp()
3167 if (is_hp_output(codec, 0x0a) && is_hp_output(codec, 0x0f)) { in stac92hd71bxx_fixup_hp()
3168 fixup_hp_headphone(codec, 0x0a); in stac92hd71bxx_fixup_hp()
3169 fixup_hp_headphone(codec, 0x0f); in stac92hd71bxx_fixup_hp()
3172 if (find_mute_led_cfg(codec, 1)) in stac92hd71bxx_fixup_hp()
3173 codec_dbg(codec, "mute LED gpio %d polarity %d\n", in stac92hd71bxx_fixup_hp()
3519 static void stac922x_fixup_intel_mac_auto(struct hda_codec *codec, in stac922x_fixup_intel_mac_auto() argument
3526 codec->fixup_id = HDA_FIXUP_ID_NOT_SET; in stac922x_fixup_intel_mac_auto()
3527 snd_hda_pick_fixup(codec, NULL, stac922x_intel_mac_fixup_tbl, in stac922x_fixup_intel_mac_auto()
3529 if (codec->fixup_id != HDA_FIXUP_ID_NOT_SET) in stac922x_fixup_intel_mac_auto()
3530 snd_hda_apply_fixup(codec, action); in stac922x_fixup_intel_mac_auto()
3533 static void stac922x_fixup_intel_mac_gpio(struct hda_codec *codec, in stac922x_fixup_intel_mac_gpio() argument
3537 struct sigmatel_spec *spec = codec->spec; in stac922x_fixup_intel_mac_gpio()
3825 static void stac927x_fixup_ref_no_jd(struct hda_codec *codec, in stac927x_fixup_ref_no_jd() argument
3830 codec->no_jack_detect = 1; in stac927x_fixup_ref_no_jd()
3833 static void stac927x_fixup_ref(struct hda_codec *codec, in stac927x_fixup_ref() argument
3836 struct sigmatel_spec *spec = codec->spec; in stac927x_fixup_ref()
3839 snd_hda_apply_pincfgs(codec, ref927x_pin_configs); in stac927x_fixup_ref()
3845 static void stac927x_fixup_dell_dmic(struct hda_codec *codec, in stac927x_fixup_dell_dmic() argument
3848 struct sigmatel_spec *spec = codec->spec; in stac927x_fixup_dell_dmic()
3853 if (codec->core.subsystem_id != 0x1028022f) { in stac927x_fixup_dell_dmic()
3859 snd_hda_add_verbs(codec, dell_3st_core_init); in stac927x_fixup_dell_dmic()
3863 static void stac927x_fixup_volknob(struct hda_codec *codec, in stac927x_fixup_volknob() argument
3866 struct sigmatel_spec *spec = codec->spec; in stac927x_fixup_volknob()
3869 snd_hda_add_verbs(codec, stac927x_volknob_core_init); in stac927x_fixup_volknob()
4099 static void stac9205_fixup_ref(struct hda_codec *codec, in stac9205_fixup_ref() argument
4102 struct sigmatel_spec *spec = codec->spec; in stac9205_fixup_ref()
4105 snd_hda_apply_pincfgs(codec, ref9205_pin_configs); in stac9205_fixup_ref()
4111 static void stac9205_fixup_dell_m43(struct hda_codec *codec, in stac9205_fixup_dell_m43() argument
4114 struct sigmatel_spec *spec = codec->spec; in stac9205_fixup_dell_m43()
4118 snd_hda_apply_pincfgs(codec, dell_9205_m43_pin_configs); in stac9205_fixup_dell_m43()
4121 snd_hda_codec_write_cache(codec, codec->core.afg, 0, in stac9205_fixup_dell_m43()
4123 jack = snd_hda_jack_detect_enable_callback(codec, codec->core.afg, in stac9205_fixup_dell_m43()
4139 static void stac9205_fixup_eapd(struct hda_codec *codec, in stac9205_fixup_eapd() argument
4142 struct sigmatel_spec *spec = codec->spec; in stac9205_fixup_eapd()
4228 static void stac92hd95_fixup_hp_led(struct hda_codec *codec, in stac92hd95_fixup_hp_led() argument
4231 struct sigmatel_spec *spec = codec->spec; in stac92hd95_fixup_hp_led()
4236 if (find_mute_led_cfg(codec, spec->default_polarity)) in stac92hd95_fixup_hp_led()
4237 codec_dbg(codec, "mute LED gpio %d polarity %d\n", in stac92hd95_fixup_hp_led()
4270 static int stac_parse_auto_config(struct hda_codec *codec) in stac_parse_auto_config() argument
4272 struct sigmatel_spec *spec = codec->spec; in stac_parse_auto_config()
4279 err = snd_hda_parse_pin_defcfg(codec, &spec->gen.autocfg, NULL, flags); in stac_parse_auto_config()
4290 snd_hda_gen_add_mute_led_cdev(codec, stac_vmaster_hook); in stac_parse_auto_config()
4292 err = snd_hda_gen_parse_auto_config(codec, &spec->gen.autocfg); in stac_parse_auto_config()
4297 err = snd_hda_gen_fix_pin_power(codec, spec->vref_mute_led_nid); in stac_parse_auto_config()
4304 err = stac_auto_create_beep_ctls(codec, in stac_parse_auto_config()
4316 err = stac_auto_create_beep_ctls(codec, nid); in stac_parse_auto_config()
4319 if (codec->beep) { in stac_parse_auto_config()
4321 codec->beep->linear_tone = spec->linear_tone_beep; in stac_parse_auto_config()
4323 codec->beep->keep_power_at_enable = 1; in stac_parse_auto_config()
4325 caps = query_amp_caps(codec, nid, HDA_OUTPUT); in stac_parse_auto_config()
4327 err = stac_beep_switch_ctl(codec); in stac_parse_auto_config()
4336 snd_hda_get_bool_hint(codec, "loopback") == 1) { in stac_parse_auto_config()
4339 if (snd_hdac_regmap_add_vendor_verb(&codec->core, wr_verb)) in stac_parse_auto_config()
4346 err = stac_create_spdif_mux_ctls(codec); in stac_parse_auto_config()
4351 stac_init_power_map(codec); in stac_parse_auto_config()
4356 static int stac_init(struct hda_codec *codec) in stac_init() argument
4358 struct sigmatel_spec *spec = codec->spec; in stac_init()
4362 stac_store_hints(codec); in stac_init()
4370 stac_gpio_set(codec, spec->gpio_mask, spec->gpio_dir, spec->gpio_data); in stac_init()
4372 snd_hda_gen_init(codec); in stac_init()
4376 snd_hda_codec_write(codec, codec->core.afg, 0, in stac_init()
4385 snd_hda_codec_write(codec, spec->gen.all_adcs[i], 0, in stac_init()
4396 struct hda_codec *codec, hda_nid_t nid) in stac92hd_proc_hook() argument
4398 if (nid == codec->core.afg) in stac92hd_proc_hook()
4400 snd_hda_codec_read(codec, nid, 0, in stac92hd_proc_hook()
4405 struct hda_codec *codec, in analog_loop_proc_hook() argument
4409 snd_hda_codec_read(codec, codec->core.afg, 0, verb, 0)); in analog_loop_proc_hook()
4414 struct hda_codec *codec, hda_nid_t nid) in stac92hd7x_proc_hook() argument
4416 stac92hd_proc_hook(buffer, codec, nid); in stac92hd7x_proc_hook()
4417 if (nid == codec->core.afg) in stac92hd7x_proc_hook()
4418 analog_loop_proc_hook(buffer, codec, 0xfa0); in stac92hd7x_proc_hook()
4422 struct hda_codec *codec, hda_nid_t nid) in stac9205_proc_hook() argument
4424 if (nid == codec->core.afg) in stac9205_proc_hook()
4425 analog_loop_proc_hook(buffer, codec, 0xfe0); in stac9205_proc_hook()
4429 struct hda_codec *codec, hda_nid_t nid) in stac927x_proc_hook() argument
4431 if (nid == codec->core.afg) in stac927x_proc_hook()
4432 analog_loop_proc_hook(buffer, codec, 0xfeb); in stac927x_proc_hook()
4441 static int stac_suspend(struct hda_codec *codec) in stac_suspend() argument
4443 struct sigmatel_spec *spec = codec->spec; in stac_suspend()
4445 snd_hda_shutup_pins(codec); in stac_suspend()
4448 stac_gpio_set(codec, spec->gpio_mask, in stac_suspend()
4455 static int alloc_stac_spec(struct hda_codec *codec) in alloc_stac_spec() argument
4463 codec->spec = spec; in alloc_stac_spec()
4464 codec->no_trigger_sense = 1; /* seems common with STAC/IDT codecs */ in alloc_stac_spec()
4469 static int probe_stac9200(struct hda_codec *codec) in probe_stac9200() argument
4474 spec = codec->spec; in probe_stac9200()
4478 codec->power_filter = snd_hda_codec_eapd_power_filter; in probe_stac9200()
4480 snd_hda_add_verbs(codec, stac9200_eapd_init); in probe_stac9200()
4482 snd_hda_pick_fixup(codec, stac9200_models, stac9200_fixup_tbl, in probe_stac9200()
4484 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); in probe_stac9200()
4486 err = stac_parse_auto_config(codec); in probe_stac9200()
4490 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); in probe_stac9200()
4495 static int probe_stac925x(struct hda_codec *codec) in probe_stac925x() argument
4500 spec = codec->spec; in probe_stac925x()
4504 snd_hda_add_verbs(codec, stac925x_core_init); in probe_stac925x()
4506 snd_hda_pick_fixup(codec, stac925x_models, stac925x_fixup_tbl, in probe_stac925x()
4508 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); in probe_stac925x()
4510 err = stac_parse_auto_config(codec); in probe_stac925x()
4514 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); in probe_stac925x()
4519 static int probe_stac92hd73xx(struct hda_codec *codec) in probe_stac92hd73xx() argument
4525 spec = codec->spec; in probe_stac92hd73xx()
4529 if ((codec->core.vendor_id & 0xfffffff0) != 0x111d7670) in probe_stac92hd73xx()
4530 codec->power_save_node = 1; in probe_stac92hd73xx()
4535 num_dacs = snd_hda_get_num_conns(codec, 0x0a) - 1; in probe_stac92hd73xx()
4537 codec_warn(codec, in probe_stac92hd73xx()
4571 snd_hda_pick_fixup(codec, stac92hd73xx_models, stac92hd73xx_fixup_tbl, in probe_stac92hd73xx()
4573 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); in probe_stac92hd73xx()
4576 snd_hda_add_verbs(codec, stac92hd73xx_core_init); in probe_stac92hd73xx()
4578 err = stac_parse_auto_config(codec); in probe_stac92hd73xx()
4585 if (spec->eapd_switch && !has_builtin_speaker(codec)) in probe_stac92hd73xx()
4588 codec->proc_widget_hook = stac92hd7x_proc_hook; in probe_stac92hd73xx()
4590 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); in probe_stac92hd73xx()
4595 static void stac_setup_gpio(struct hda_codec *codec) in stac_setup_gpio() argument
4597 struct sigmatel_spec *spec = codec->spec; in stac_setup_gpio()
4606 codec->power_filter = stac_vref_led_power_filter; in stac_setup_gpio()
4615 snd_hda_gen_add_micmute_led_cdev(codec, stac_capture_led_update); in stac_setup_gpio()
4619 static int probe_stac92hd83xxx(struct hda_codec *codec) in probe_stac92hd83xxx() argument
4625 codec->core.power_caps &= ~AC_PWRST_EPSS; in probe_stac92hd83xxx()
4627 spec = codec->spec; in probe_stac92hd83xxx()
4628 codec->power_save_node = 1; in probe_stac92hd83xxx()
4639 snd_hda_add_verbs(codec, stac92hd83xxx_core_init); in probe_stac92hd83xxx()
4641 snd_hda_pick_fixup(codec, stac92hd83xxx_models, stac92hd83xxx_fixup_tbl, in probe_stac92hd83xxx()
4643 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); in probe_stac92hd83xxx()
4645 stac_setup_gpio(codec); in probe_stac92hd83xxx()
4647 err = stac_parse_auto_config(codec); in probe_stac92hd83xxx()
4651 codec->proc_widget_hook = stac92hd_proc_hook; in probe_stac92hd83xxx()
4653 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); in probe_stac92hd83xxx()
4662 static int probe_stac92hd95(struct hda_codec *codec) in probe_stac92hd95() argument
4668 codec->core.power_caps &= ~AC_PWRST_EPSS; in probe_stac92hd95()
4670 spec = codec->spec; in probe_stac92hd95()
4671 codec->power_save_node = 1; in probe_stac92hd95()
4681 snd_hda_pick_fixup(codec, stac92hd95_models, stac92hd95_fixup_tbl, in probe_stac92hd95()
4683 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); in probe_stac92hd95()
4685 stac_setup_gpio(codec); in probe_stac92hd95()
4687 err = stac_parse_auto_config(codec); in probe_stac92hd95()
4691 codec->proc_widget_hook = stac92hd_proc_hook; in probe_stac92hd95()
4693 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); in probe_stac92hd95()
4698 static int probe_stac92hd71bxx(struct hda_codec *codec) in probe_stac92hd71bxx() argument
4704 spec = codec->spec; in probe_stac92hd71bxx()
4718 switch (codec->core.vendor_id) { in probe_stac92hd71bxx()
4724 if ((codec->core.revision_id & 0xf) == 0 || in probe_stac92hd71bxx()
4725 (codec->core.revision_id & 0xf) == 1) in probe_stac92hd71bxx()
4730 snd_hda_codec_set_pincfg(codec, 0x0f, 0x40f000f0); in probe_stac92hd71bxx()
4731 snd_hda_codec_set_pincfg(codec, 0x19, 0x40f000f3); in probe_stac92hd71bxx()
4734 if ((codec->core.revision_id & 0xf) == 1) in probe_stac92hd71bxx()
4740 if (get_wcaps_type(get_wcaps(codec, 0x28)) == AC_WID_VOL_KNB) in probe_stac92hd71bxx()
4741 snd_hda_add_verbs(codec, stac92hd71bxx_core_init); in probe_stac92hd71bxx()
4743 if (get_wcaps(codec, 0xa) & AC_WCAP_IN_AMP) { in probe_stac92hd71bxx()
4746 snd_hda_codec_amp_init_stereo(codec, *p, HDA_INPUT, 0, in probe_stac92hd71bxx()
4759 snd_hda_pick_fixup(codec, stac92hd71bxx_models, stac92hd71bxx_fixup_tbl, in probe_stac92hd71bxx()
4761 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); in probe_stac92hd71bxx()
4763 stac_setup_gpio(codec); in probe_stac92hd71bxx()
4765 err = stac_parse_auto_config(codec); in probe_stac92hd71bxx()
4769 codec->proc_widget_hook = stac92hd7x_proc_hook; in probe_stac92hd71bxx()
4771 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); in probe_stac92hd71bxx()
4776 static int probe_stac922x(struct hda_codec *codec) in probe_stac922x() argument
4781 spec = codec->spec; in probe_stac922x()
4785 snd_hda_add_verbs(codec, stac922x_core_init); in probe_stac922x()
4788 snd_hda_override_amp_caps(codec, 0x12, HDA_OUTPUT, in probe_stac922x()
4794 snd_hda_pick_fixup(codec, stac922x_models, stac922x_fixup_tbl, in probe_stac922x()
4796 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); in probe_stac922x()
4798 err = stac_parse_auto_config(codec); in probe_stac922x()
4802 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); in probe_stac922x()
4812 static int probe_stac927x(struct hda_codec *codec) in probe_stac927x() argument
4817 spec = codec->spec; in probe_stac927x()
4834 snd_hda_pick_fixup(codec, stac927x_models, stac927x_fixup_tbl, in probe_stac927x()
4836 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); in probe_stac927x()
4839 snd_hda_add_verbs(codec, stac927x_core_init); in probe_stac927x()
4841 err = stac_parse_auto_config(codec); in probe_stac927x()
4845 codec->proc_widget_hook = stac927x_proc_hook; in probe_stac927x()
4857 codec->bus->core.needs_damn_long_delay = 1; in probe_stac927x()
4859 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); in probe_stac927x()
4864 static int probe_stac9205(struct hda_codec *codec) in probe_stac9205() argument
4869 spec = codec->spec; in probe_stac9205()
4876 snd_hda_add_verbs(codec, stac9205_core_init); in probe_stac9205()
4889 snd_hda_pick_fixup(codec, stac9205_models, stac9205_fixup_tbl, in probe_stac9205()
4891 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); in probe_stac9205()
4893 err = stac_parse_auto_config(codec); in probe_stac9205()
4897 codec->proc_widget_hook = stac9205_proc_hook; in probe_stac9205()
4899 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); in probe_stac9205()
4945 static int probe_stac9872(struct hda_codec *codec) in probe_stac9872() argument
4950 spec = codec->spec; in probe_stac9872()
4954 snd_hda_add_verbs(codec, stac9872_core_init); in probe_stac9872()
4956 snd_hda_pick_fixup(codec, stac9872_models, stac9872_fixup_tbl, in probe_stac9872()
4958 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); in probe_stac9872()
4960 err = stac_parse_auto_config(codec); in probe_stac9872()
4964 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); in probe_stac9872()
4986 static int stac_probe(struct hda_codec *codec, const struct hda_device_id *id) in stac_probe() argument
4990 err = alloc_stac_spec(codec); in stac_probe()
4996 err = probe_stac9200(codec); in stac_probe()
4999 err = probe_stac9205(codec); in stac_probe()
5002 err = probe_stac922x(codec); in stac_probe()
5005 err = probe_stac925x(codec); in stac_probe()
5008 err = probe_stac927x(codec); in stac_probe()
5011 err = probe_stac9872(codec); in stac_probe()
5014 err = probe_stac92hd71bxx(codec); in stac_probe()
5017 err = probe_stac92hd73xx(codec); in stac_probe()
5020 err = probe_stac92hd83xxx(codec); in stac_probe()
5023 err = probe_stac92hd95(codec); in stac_probe()
5031 snd_hda_gen_remove(codec); in stac_probe()