Lines Matching refs:codec
252 struct hda_codec *codec, in stac_playback_pcm_hook() argument
256 struct sigmatel_spec *spec = codec->spec; in stac_playback_pcm_hook()
262 struct hda_codec *codec, in stac_capture_pcm_hook() argument
266 struct sigmatel_spec *spec = codec->spec; in stac_capture_pcm_hook()
282 snd_hda_codec_write(codec, hinfo->nid, 0, in stac_capture_pcm_hook()
287 snd_hda_codec_write(codec, hinfo->nid, 0, in stac_capture_pcm_hook()
299 static void stac_gpio_set(struct hda_codec *codec, unsigned int mask, in stac_gpio_set() argument
303 hda_nid_t fg = codec->core.afg; in stac_gpio_set()
305 codec_dbg(codec, "%s msk %x dir %x gpio %x\n", __func__, mask, dir_mask, data); in stac_gpio_set()
307 gpiostate = snd_hda_codec_read(codec, fg, 0, in stac_gpio_set()
311 gpiomask = snd_hda_codec_read(codec, fg, 0, in stac_gpio_set()
315 gpiodir = snd_hda_codec_read(codec, fg, 0, in stac_gpio_set()
320 snd_hda_codec_write(codec, fg, 0, 0x7e7, 0); in stac_gpio_set()
322 snd_hda_codec_write(codec, fg, 0, in stac_gpio_set()
324 snd_hda_codec_read(codec, fg, 0, in stac_gpio_set()
329 snd_hda_codec_read(codec, fg, 0, in stac_gpio_set()
334 static void stac_capture_led_hook(struct hda_codec *codec, in stac_capture_led_hook() argument
338 struct sigmatel_spec *spec = codec->spec; in stac_capture_led_hook()
358 stac_gpio_set(codec, spec->gpio_mask, in stac_capture_led_hook()
363 static int stac_vrefout_set(struct hda_codec *codec, in stac_vrefout_set() argument
368 codec_dbg(codec, "%s, nid %x ctl %x\n", __func__, nid, new_vref); in stac_vrefout_set()
369 pinctl = snd_hda_codec_read(codec, nid, 0, in stac_vrefout_set()
379 error = snd_hda_set_pin_ctl_cache(codec, nid, pinctl); in stac_vrefout_set()
388 static unsigned int stac_vref_led_power_filter(struct hda_codec *codec, in stac_vref_led_power_filter() argument
392 if (nid == codec->core.afg && power_state == AC_PWRST_D3) in stac_vref_led_power_filter()
394 return snd_hda_gen_path_power_filter(codec, nid, power_state); in stac_vref_led_power_filter()
398 static void stac_update_led_status(struct hda_codec *codec, int enabled) in stac_update_led_status() argument
400 struct sigmatel_spec *spec = codec->spec; in stac_update_led_status()
415 stac_gpio_set(codec, spec->gpio_mask, in stac_update_led_status()
419 stac_vrefout_set(codec, spec->vref_mute_led_nid, in stac_update_led_status()
431 static void stac_update_outputs(struct hda_codec *codec) in stac_update_outputs() argument
433 struct sigmatel_spec *spec = codec->spec; in stac_update_outputs()
437 !(snd_hda_codec_read(codec, codec->core.afg, 0, in stac_update_outputs()
440 snd_hda_gen_update_outputs(codec); in stac_update_outputs()
450 stac_gpio_set(codec, spec->gpio_mask, spec->gpio_dir, in stac_update_outputs()
456 static void stac_toggle_power_map(struct hda_codec *codec, hda_nid_t nid, in stac_toggle_power_map() argument
459 struct sigmatel_spec *spec = codec->spec; in stac_toggle_power_map()
481 snd_hda_codec_write(codec, codec->core.afg, 0, in stac_toggle_power_map()
487 static void jack_update_power(struct hda_codec *codec, in jack_update_power() argument
490 struct sigmatel_spec *spec = codec->spec; in jack_update_power()
497 stac_toggle_power_map(codec, jack->nid, in jack_update_power()
498 snd_hda_jack_detect(codec, jack->nid), in jack_update_power()
506 if (!snd_hda_jack_tbl_get(codec, nid)) in jack_update_power()
508 stac_toggle_power_map(codec, nid, in jack_update_power()
509 snd_hda_jack_detect(codec, nid), in jack_update_power()
513 snd_hda_codec_write(codec, codec->core.afg, 0, in jack_update_power()
518 static void stac_vref_event(struct hda_codec *codec, in stac_vref_event() argument
523 data = snd_hda_codec_read(codec, codec->core.afg, 0, in stac_vref_event()
526 snd_hda_codec_write(codec, codec->core.afg, 0, 0x7e0, in stac_vref_event()
533 static void stac_init_power_map(struct hda_codec *codec) in stac_init_power_map() argument
535 struct sigmatel_spec *spec = codec->spec; in stac_init_power_map()
540 unsigned int def_conf = snd_hda_codec_get_pincfg(codec, nid); in stac_init_power_map()
544 is_jack_detectable(codec, nid)) { in stac_init_power_map()
545 snd_hda_jack_detect_enable_callback(codec, nid, in stac_init_power_map()
549 stac_toggle_power_map(codec, nid, false, false); in stac_init_power_map()
551 stac_toggle_power_map(codec, nid, true, false); in stac_init_power_map()
559 static inline bool get_int_hint(struct hda_codec *codec, const char *key, in get_int_hint() argument
562 return !snd_hda_get_int_hint(codec, key, valp); in get_int_hint()
566 static void stac_store_hints(struct hda_codec *codec) in stac_store_hints() argument
568 struct sigmatel_spec *spec = codec->spec; in stac_store_hints()
571 if (get_int_hint(codec, "gpio_mask", &spec->gpio_mask)) { in stac_store_hints()
575 if (get_int_hint(codec, "gpio_dir", &spec->gpio_dir)) in stac_store_hints()
577 if (get_int_hint(codec, "gpio_data", &spec->gpio_data)) in stac_store_hints()
579 if (get_int_hint(codec, "eapd_mask", &spec->eapd_mask)) in stac_store_hints()
581 if (get_int_hint(codec, "gpio_mute", &spec->gpio_mute)) in stac_store_hints()
583 val = snd_hda_get_bool_hint(codec, "eapd_switch"); in stac_store_hints()
597 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); in stac_aloopback_get() local
599 struct sigmatel_spec *spec = codec->spec; in stac_aloopback_get()
609 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); in stac_aloopback_put() local
610 struct sigmatel_spec *spec = codec->spec; in stac_aloopback_put()
628 dac_mode = snd_hda_codec_read(codec, codec->core.afg, 0, in stac_aloopback_put()
633 snd_hda_power_up(codec); in stac_aloopback_put()
636 snd_hda_power_down(codec); in stac_aloopback_put()
640 snd_hda_codec_write_cache(codec, codec->core.afg, 0, in stac_aloopback_put()
662 static bool hp_bnb2011_with_dock(struct hda_codec *codec) in hp_bnb2011_with_dock() argument
664 if (codec->core.vendor_id != 0x111d7605 && in hp_bnb2011_with_dock()
665 codec->core.vendor_id != 0x111d76d1) in hp_bnb2011_with_dock()
668 switch (codec->core.subsystem_id) { in hp_bnb2011_with_dock()
732 static void set_hp_led_gpio(struct hda_codec *codec) in set_hp_led_gpio() argument
734 struct sigmatel_spec *spec = codec->spec; in set_hp_led_gpio()
740 gpio = snd_hda_param_read(codec, codec->core.afg, AC_PAR_GPIO_CAP); in set_hp_led_gpio()
768 static int find_mute_led_cfg(struct hda_codec *codec, int default_polarity) in find_mute_led_cfg() argument
770 struct sigmatel_spec *spec = codec->spec; in find_mute_led_cfg()
773 if (get_int_hint(codec, "gpio_led", &spec->gpio_led)) { in find_mute_led_cfg()
774 get_int_hint(codec, "gpio_led_polarity", in find_mute_led_cfg()
784 max_gpio = snd_hda_param_read(codec, codec->core.afg, in find_mute_led_cfg()
795 set_hp_led_gpio(codec); in find_mute_led_cfg()
800 set_hp_led_gpio(codec); in find_mute_led_cfg()
814 if (!hp_blike_system(codec->core.subsystem_id) && in find_mute_led_cfg()
816 set_hp_led_gpio(codec); in find_mute_led_cfg()
824 static bool has_builtin_speaker(struct hda_codec *codec) in has_builtin_speaker() argument
826 struct sigmatel_spec *spec = codec->spec; in has_builtin_speaker()
839 unsigned int def_conf = snd_hda_codec_get_pincfg(codec, nid_pin[i]); in has_builtin_speaker()
851 static int stac_auto_create_beep_ctls(struct hda_codec *codec, in stac_auto_create_beep_ctls() argument
854 struct sigmatel_spec *spec = codec->spec; in stac_auto_create_beep_ctls()
855 u32 caps = query_amp_caps(codec, nid, HDA_OUTPUT); in stac_auto_create_beep_ctls()
898 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); in stac_dig_beep_switch_get() local
899 ucontrol->value.integer.value[0] = codec->beep->enabled; in stac_dig_beep_switch_get()
906 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); in stac_dig_beep_switch_put() local
907 return snd_hda_enable_beep_device(codec, ucontrol->value.integer.value[0]); in stac_dig_beep_switch_put()
918 static int stac_beep_switch_ctl(struct hda_codec *codec) in stac_beep_switch_ctl() argument
920 struct sigmatel_spec *spec = codec->spec; in stac_beep_switch_ctl()
935 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); in stac_smux_enum_info() local
936 struct sigmatel_spec *spec = codec->spec; in stac_smux_enum_info()
943 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); in stac_smux_enum_get() local
944 struct sigmatel_spec *spec = codec->spec; in stac_smux_enum_get()
954 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); in stac_smux_enum_put() local
955 struct sigmatel_spec *spec = codec->spec; in stac_smux_enum_put()
958 return snd_hda_input_mux_put(codec, &spec->spdif_mux, ucontrol, in stac_smux_enum_put()
976 static int stac_create_spdif_mux_ctls(struct hda_codec *codec) in stac_create_spdif_mux_ctls() argument
978 struct sigmatel_spec *spec = codec->spec; in stac_create_spdif_mux_ctls()
987 num_cons = snd_hda_get_num_conns(codec, cfg->dig_out_pins[0]); in stac_create_spdif_mux_ctls()
996 snd_hda_add_imux_item(codec, &spec->spdif_mux, labels[i], i, NULL); in stac_create_spdif_mux_ctls()
1364 static void stac9200_fixup_panasonic(struct hda_codec *codec, in stac9200_fixup_panasonic() argument
1367 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()
2079 static void stac92hd83xxx_fixup_hp(struct hda_codec *codec, in stac92hd83xxx_fixup_hp() argument
2082 struct sigmatel_spec *spec = codec->spec; in stac92hd83xxx_fixup_hp()
2087 if (hp_bnb2011_with_dock(codec)) { in stac92hd83xxx_fixup_hp()
2088 snd_hda_codec_set_pincfg(codec, 0xa, 0x2101201f); in stac92hd83xxx_fixup_hp()
2089 snd_hda_codec_set_pincfg(codec, 0xf, 0x2181205e); in stac92hd83xxx_fixup_hp()
2092 if (find_mute_led_cfg(codec, spec->default_polarity)) in stac92hd83xxx_fixup_hp()
2093 codec_dbg(codec, "mute LED gpio %d polarity %d\n", in stac92hd83xxx_fixup_hp()
2101 static void stac92hd83xxx_fixup_hp_zephyr(struct hda_codec *codec, in stac92hd83xxx_fixup_hp_zephyr() argument
2107 snd_hda_apply_pincfgs(codec, hp_zephyr_pin_configs); in stac92hd83xxx_fixup_hp_zephyr()
2108 snd_hda_add_verbs(codec, stac92hd83xxx_hp_zephyr_init); in stac92hd83xxx_fixup_hp_zephyr()
2111 static void stac92hd83xxx_fixup_hp_led(struct hda_codec *codec, in stac92hd83xxx_fixup_hp_led() argument
2114 struct sigmatel_spec *spec = codec->spec; in stac92hd83xxx_fixup_hp_led()
2120 static void stac92hd83xxx_fixup_hp_inv_led(struct hda_codec *codec, in stac92hd83xxx_fixup_hp_inv_led() argument
2123 struct sigmatel_spec *spec = codec->spec; in stac92hd83xxx_fixup_hp_inv_led()
2129 static void stac92hd83xxx_fixup_hp_mic_led(struct hda_codec *codec, in stac92hd83xxx_fixup_hp_mic_led() argument
2132 struct sigmatel_spec *spec = codec->spec; in stac92hd83xxx_fixup_hp_mic_led()
2138 codec->core.power_caps &= ~AC_PWRST_CLKSTOP; in stac92hd83xxx_fixup_hp_mic_led()
2143 static void stac92hd83xxx_fixup_hp_led_gpio10(struct hda_codec *codec, in stac92hd83xxx_fixup_hp_led_gpio10() argument
2146 struct sigmatel_spec *spec = codec->spec; in stac92hd83xxx_fixup_hp_led_gpio10()
2154 static void stac92hd83xxx_fixup_headset_jack(struct hda_codec *codec, in stac92hd83xxx_fixup_headset_jack() argument
2157 struct sigmatel_spec *spec = codec->spec; in stac92hd83xxx_fixup_headset_jack()
2163 static void stac92hd83xxx_fixup_gpio10_eapd(struct hda_codec *codec, in stac92hd83xxx_fixup_gpio10_eapd() argument
2167 struct sigmatel_spec *spec = codec->spec; in stac92hd83xxx_fixup_gpio10_eapd()
2176 static void hp_envy_ts_fixup_dac_bind(struct hda_codec *codec, in hp_envy_ts_fixup_dac_bind() argument
2180 struct sigmatel_spec *spec = codec->spec; in hp_envy_ts_fixup_dac_bind()
2935 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); in stac_hp_bass_gpio_get() local
2936 struct sigmatel_spec *spec = codec->spec; in stac_hp_bass_gpio_get()
2944 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); in stac_hp_bass_gpio_put() local
2945 struct sigmatel_spec *spec = codec->spec; in stac_hp_bass_gpio_put()
2953 stac_gpio_set(codec, spec->gpio_mask, spec->gpio_dir, spec->gpio_data); in stac_hp_bass_gpio_put()
2964 static int stac_add_hp_bass_switch(struct hda_codec *codec) in stac_add_hp_bass_switch() argument
2966 struct sigmatel_spec *spec = codec->spec; in stac_add_hp_bass_switch()
3038 static void stac92hd71bxx_fixup_ref(struct hda_codec *codec, in stac92hd71bxx_fixup_ref() argument
3041 struct sigmatel_spec *spec = codec->spec; in stac92hd71bxx_fixup_ref()
3046 snd_hda_apply_pincfgs(codec, ref92hd71bxx_pin_configs); in stac92hd71bxx_fixup_ref()
3050 static void stac92hd71bxx_fixup_hp_m4(struct hda_codec *codec, in stac92hd71bxx_fixup_hp_m4() argument
3053 struct sigmatel_spec *spec = codec->spec; in stac92hd71bxx_fixup_hp_m4()
3060 snd_hda_codec_write_cache(codec, codec->core.afg, 0, in stac92hd71bxx_fixup_hp_m4()
3062 jack = snd_hda_jack_detect_enable_callback(codec, codec->core.afg, in stac92hd71bxx_fixup_hp_m4()
3070 snd_hda_codec_set_pincfg(codec, 0x0e, 0x01813040); in stac92hd71bxx_fixup_hp_m4()
3073 static void stac92hd71bxx_fixup_hp_dv4(struct hda_codec *codec, in stac92hd71bxx_fixup_hp_dv4() argument
3076 struct sigmatel_spec *spec = codec->spec; in stac92hd71bxx_fixup_hp_dv4()
3083 static void stac92hd71bxx_fixup_hp_dv5(struct hda_codec *codec, in stac92hd71bxx_fixup_hp_dv5() argument
3090 snd_hda_codec_set_pincfg(codec, 0x0d, 0x90170010); in stac92hd71bxx_fixup_hp_dv5()
3095 cap = snd_hda_param_read(codec, 0x1, AC_PAR_GPIO_CAP); in stac92hd71bxx_fixup_hp_dv5()
3098 stac_add_hp_bass_switch(codec); in stac92hd71bxx_fixup_hp_dv5()
3103 static void stac92hd71bxx_fixup_hp_hdx(struct hda_codec *codec, in stac92hd71bxx_fixup_hp_hdx() argument
3106 struct sigmatel_spec *spec = codec->spec; in stac92hd71bxx_fixup_hp_hdx()
3113 static bool is_hp_output(struct hda_codec *codec, hda_nid_t pin) in is_hp_output() argument
3115 unsigned int pin_cfg = snd_hda_codec_get_pincfg(codec, pin); in is_hp_output()
3123 static void fixup_hp_headphone(struct hda_codec *codec, hda_nid_t pin) in fixup_hp_headphone() argument
3125 unsigned int pin_cfg = snd_hda_codec_get_pincfg(codec, pin); in fixup_hp_headphone()
3134 snd_hda_codec_set_pincfg(codec, pin, pin_cfg); in fixup_hp_headphone()
3137 static void stac92hd71bxx_fixup_hp(struct hda_codec *codec, in stac92hd71bxx_fixup_hp() argument
3140 struct sigmatel_spec *spec = codec->spec; in stac92hd71bxx_fixup_hp()
3148 if (is_hp_output(codec, 0x0a) && is_hp_output(codec, 0x0f)) { in stac92hd71bxx_fixup_hp()
3149 fixup_hp_headphone(codec, 0x0a); in stac92hd71bxx_fixup_hp()
3150 fixup_hp_headphone(codec, 0x0f); in stac92hd71bxx_fixup_hp()
3153 if (find_mute_led_cfg(codec, 1)) in stac92hd71bxx_fixup_hp()
3154 codec_dbg(codec, "mute LED gpio %d polarity %d\n", in stac92hd71bxx_fixup_hp()
3500 static void stac922x_fixup_intel_mac_auto(struct hda_codec *codec, in stac922x_fixup_intel_mac_auto() argument
3507 codec->fixup_id = HDA_FIXUP_ID_NOT_SET; in stac922x_fixup_intel_mac_auto()
3508 snd_hda_pick_fixup(codec, NULL, stac922x_intel_mac_fixup_tbl, in stac922x_fixup_intel_mac_auto()
3510 if (codec->fixup_id != HDA_FIXUP_ID_NOT_SET) in stac922x_fixup_intel_mac_auto()
3511 snd_hda_apply_fixup(codec, action); in stac922x_fixup_intel_mac_auto()
3514 static void stac922x_fixup_intel_mac_gpio(struct hda_codec *codec, in stac922x_fixup_intel_mac_gpio() argument
3518 struct sigmatel_spec *spec = codec->spec; in stac922x_fixup_intel_mac_gpio()
3806 static void stac927x_fixup_ref_no_jd(struct hda_codec *codec, in stac927x_fixup_ref_no_jd() argument
3811 codec->no_jack_detect = 1; in stac927x_fixup_ref_no_jd()
3814 static void stac927x_fixup_ref(struct hda_codec *codec, in stac927x_fixup_ref() argument
3817 struct sigmatel_spec *spec = codec->spec; in stac927x_fixup_ref()
3820 snd_hda_apply_pincfgs(codec, ref927x_pin_configs); in stac927x_fixup_ref()
3826 static void stac927x_fixup_dell_dmic(struct hda_codec *codec, in stac927x_fixup_dell_dmic() argument
3829 struct sigmatel_spec *spec = codec->spec; in stac927x_fixup_dell_dmic()
3834 if (codec->core.subsystem_id != 0x1028022f) { in stac927x_fixup_dell_dmic()
3840 snd_hda_add_verbs(codec, dell_3st_core_init); in stac927x_fixup_dell_dmic()
3844 static void stac927x_fixup_volknob(struct hda_codec *codec, in stac927x_fixup_volknob() argument
3847 struct sigmatel_spec *spec = codec->spec; in stac927x_fixup_volknob()
3850 snd_hda_add_verbs(codec, stac927x_volknob_core_init); in stac927x_fixup_volknob()
4073 static void stac9205_fixup_ref(struct hda_codec *codec, in stac9205_fixup_ref() argument
4076 struct sigmatel_spec *spec = codec->spec; in stac9205_fixup_ref()
4079 snd_hda_apply_pincfgs(codec, ref9205_pin_configs); in stac9205_fixup_ref()
4085 static void stac9205_fixup_dell_m43(struct hda_codec *codec, in stac9205_fixup_dell_m43() argument
4088 struct sigmatel_spec *spec = codec->spec; in stac9205_fixup_dell_m43()
4092 snd_hda_apply_pincfgs(codec, dell_9205_m43_pin_configs); in stac9205_fixup_dell_m43()
4095 snd_hda_codec_write_cache(codec, codec->core.afg, 0, in stac9205_fixup_dell_m43()
4097 jack = snd_hda_jack_detect_enable_callback(codec, codec->core.afg, in stac9205_fixup_dell_m43()
4113 static void stac9205_fixup_eapd(struct hda_codec *codec, in stac9205_fixup_eapd() argument
4116 struct sigmatel_spec *spec = codec->spec; in stac9205_fixup_eapd()
4202 static void stac92hd95_fixup_hp_led(struct hda_codec *codec, in stac92hd95_fixup_hp_led() argument
4205 struct sigmatel_spec *spec = codec->spec; in stac92hd95_fixup_hp_led()
4210 if (find_mute_led_cfg(codec, spec->default_polarity)) in stac92hd95_fixup_hp_led()
4211 codec_dbg(codec, "mute LED gpio %d polarity %d\n", in stac92hd95_fixup_hp_led()
4244 static int stac_parse_auto_config(struct hda_codec *codec) in stac_parse_auto_config() argument
4246 struct sigmatel_spec *spec = codec->spec; in stac_parse_auto_config()
4253 err = snd_hda_parse_pin_defcfg(codec, &spec->gen.autocfg, NULL, flags); in stac_parse_auto_config()
4263 err = snd_hda_gen_parse_auto_config(codec, &spec->gen.autocfg); in stac_parse_auto_config()
4268 err = snd_hda_gen_fix_pin_power(codec, spec->vref_mute_led_nid); in stac_parse_auto_config()
4275 err = stac_auto_create_beep_ctls(codec, in stac_parse_auto_config()
4287 err = stac_auto_create_beep_ctls(codec, nid); in stac_parse_auto_config()
4290 if (codec->beep) { in stac_parse_auto_config()
4292 codec->beep->linear_tone = spec->linear_tone_beep; in stac_parse_auto_config()
4294 caps = query_amp_caps(codec, nid, HDA_OUTPUT); in stac_parse_auto_config()
4296 err = stac_beep_switch_ctl(codec); in stac_parse_auto_config()
4308 snd_hda_get_bool_hint(codec, "loopback") == 1) { in stac_parse_auto_config()
4311 if (snd_hdac_regmap_add_vendor_verb(&codec->core, wr_verb)) in stac_parse_auto_config()
4318 err = stac_create_spdif_mux_ctls(codec); in stac_parse_auto_config()
4323 stac_init_power_map(codec); in stac_parse_auto_config()
4328 static int stac_init(struct hda_codec *codec) in stac_init() argument
4330 struct sigmatel_spec *spec = codec->spec; in stac_init()
4334 stac_store_hints(codec); in stac_init()
4342 stac_gpio_set(codec, spec->gpio_mask, spec->gpio_dir, spec->gpio_data); in stac_init()
4344 snd_hda_gen_init(codec); in stac_init()
4348 snd_hda_codec_write(codec, codec->core.afg, 0, in stac_init()
4357 snd_hda_codec_write(codec, spec->gen.all_adcs[i], 0, in stac_init()
4366 static void stac_shutup(struct hda_codec *codec) in stac_shutup() argument
4368 struct sigmatel_spec *spec = codec->spec; in stac_shutup()
4370 snd_hda_shutup_pins(codec); in stac_shutup()
4373 stac_gpio_set(codec, spec->gpio_mask, in stac_shutup()
4382 struct hda_codec *codec, hda_nid_t nid) in stac92hd_proc_hook() argument
4384 if (nid == codec->core.afg) in stac92hd_proc_hook()
4386 snd_hda_codec_read(codec, nid, 0, in stac92hd_proc_hook()
4391 struct hda_codec *codec, in analog_loop_proc_hook() argument
4395 snd_hda_codec_read(codec, codec->core.afg, 0, verb, 0)); in analog_loop_proc_hook()
4400 struct hda_codec *codec, hda_nid_t nid) in stac92hd7x_proc_hook() argument
4402 stac92hd_proc_hook(buffer, codec, nid); in stac92hd7x_proc_hook()
4403 if (nid == codec->core.afg) in stac92hd7x_proc_hook()
4404 analog_loop_proc_hook(buffer, codec, 0xfa0); in stac92hd7x_proc_hook()
4408 struct hda_codec *codec, hda_nid_t nid) in stac9205_proc_hook() argument
4410 if (nid == codec->core.afg) in stac9205_proc_hook()
4411 analog_loop_proc_hook(buffer, codec, 0xfe0); in stac9205_proc_hook()
4415 struct hda_codec *codec, hda_nid_t nid) in stac927x_proc_hook() argument
4417 if (nid == codec->core.afg) in stac927x_proc_hook()
4418 analog_loop_proc_hook(buffer, codec, 0xfeb); in stac927x_proc_hook()
4428 static int stac_suspend(struct hda_codec *codec) in stac_suspend() argument
4430 stac_shutup(codec); in stac_suspend()
4449 static int alloc_stac_spec(struct hda_codec *codec) in alloc_stac_spec() argument
4457 codec->spec = spec; in alloc_stac_spec()
4458 codec->no_trigger_sense = 1; /* seems common with STAC/IDT codecs */ in alloc_stac_spec()
4460 codec->patch_ops = stac_patch_ops; in alloc_stac_spec()
4464 static int patch_stac9200(struct hda_codec *codec) in patch_stac9200() argument
4469 err = alloc_stac_spec(codec); in patch_stac9200()
4473 spec = codec->spec; in patch_stac9200()
4477 codec->power_filter = snd_hda_codec_eapd_power_filter; in patch_stac9200()
4479 snd_hda_add_verbs(codec, stac9200_eapd_init); in patch_stac9200()
4481 snd_hda_pick_fixup(codec, stac9200_models, stac9200_fixup_tbl, in patch_stac9200()
4483 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); in patch_stac9200()
4485 err = stac_parse_auto_config(codec); in patch_stac9200()
4487 stac_free(codec); in patch_stac9200()
4491 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); in patch_stac9200()
4496 static int patch_stac925x(struct hda_codec *codec) in patch_stac925x() argument
4501 err = alloc_stac_spec(codec); in patch_stac925x()
4505 spec = codec->spec; in patch_stac925x()
4509 snd_hda_add_verbs(codec, stac925x_core_init); in patch_stac925x()
4511 snd_hda_pick_fixup(codec, stac925x_models, stac925x_fixup_tbl, in patch_stac925x()
4513 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); in patch_stac925x()
4515 err = stac_parse_auto_config(codec); in patch_stac925x()
4517 stac_free(codec); in patch_stac925x()
4521 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); in patch_stac925x()
4526 static int patch_stac92hd73xx(struct hda_codec *codec) in patch_stac92hd73xx() argument
4532 err = alloc_stac_spec(codec); in patch_stac92hd73xx()
4536 spec = codec->spec; in patch_stac92hd73xx()
4540 if ((codec->core.vendor_id & 0xfffffff0) != 0x111d7670) in patch_stac92hd73xx()
4541 codec->power_save_node = 1; in patch_stac92hd73xx()
4546 num_dacs = snd_hda_get_num_conns(codec, 0x0a) - 1; in patch_stac92hd73xx()
4548 codec_warn(codec, in patch_stac92hd73xx()
4582 snd_hda_pick_fixup(codec, stac92hd73xx_models, stac92hd73xx_fixup_tbl, in patch_stac92hd73xx()
4584 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); in patch_stac92hd73xx()
4587 snd_hda_add_verbs(codec, stac92hd73xx_core_init); in patch_stac92hd73xx()
4589 err = stac_parse_auto_config(codec); in patch_stac92hd73xx()
4591 stac_free(codec); in patch_stac92hd73xx()
4598 if (spec->eapd_switch && !has_builtin_speaker(codec)) in patch_stac92hd73xx()
4601 codec->proc_widget_hook = stac92hd7x_proc_hook; in patch_stac92hd73xx()
4603 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); in patch_stac92hd73xx()
4608 static void stac_setup_gpio(struct hda_codec *codec) in stac_setup_gpio() argument
4610 struct sigmatel_spec *spec = codec->spec; in stac_setup_gpio()
4619 codec->power_filter = stac_vref_led_power_filter; in stac_setup_gpio()
4633 static int patch_stac92hd83xxx(struct hda_codec *codec) in patch_stac92hd83xxx() argument
4638 err = alloc_stac_spec(codec); in patch_stac92hd83xxx()
4643 codec->core.power_caps &= ~AC_PWRST_EPSS; in patch_stac92hd83xxx()
4645 spec = codec->spec; in patch_stac92hd83xxx()
4646 codec->power_save_node = 1; in patch_stac92hd83xxx()
4657 snd_hda_add_verbs(codec, stac92hd83xxx_core_init); in patch_stac92hd83xxx()
4659 snd_hda_pick_fixup(codec, stac92hd83xxx_models, stac92hd83xxx_fixup_tbl, in patch_stac92hd83xxx()
4661 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); in patch_stac92hd83xxx()
4663 stac_setup_gpio(codec); in patch_stac92hd83xxx()
4665 err = stac_parse_auto_config(codec); in patch_stac92hd83xxx()
4667 stac_free(codec); in patch_stac92hd83xxx()
4671 codec->proc_widget_hook = stac92hd_proc_hook; in patch_stac92hd83xxx()
4673 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); in patch_stac92hd83xxx()
4682 static int patch_stac92hd95(struct hda_codec *codec) in patch_stac92hd95() argument
4687 err = alloc_stac_spec(codec); in patch_stac92hd95()
4692 codec->core.power_caps &= ~AC_PWRST_EPSS; in patch_stac92hd95()
4694 spec = codec->spec; in patch_stac92hd95()
4695 codec->power_save_node = 1; in patch_stac92hd95()
4705 snd_hda_pick_fixup(codec, stac92hd95_models, stac92hd95_fixup_tbl, in patch_stac92hd95()
4707 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); in patch_stac92hd95()
4709 stac_setup_gpio(codec); in patch_stac92hd95()
4711 err = stac_parse_auto_config(codec); in patch_stac92hd95()
4713 stac_free(codec); in patch_stac92hd95()
4717 codec->proc_widget_hook = stac92hd_proc_hook; in patch_stac92hd95()
4719 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); in patch_stac92hd95()
4724 static int patch_stac92hd71bxx(struct hda_codec *codec) in patch_stac92hd71bxx() argument
4730 err = alloc_stac_spec(codec); in patch_stac92hd71bxx()
4734 spec = codec->spec; in patch_stac92hd71bxx()
4748 switch (codec->core.vendor_id) { in patch_stac92hd71bxx()
4754 if ((codec->core.revision_id & 0xf) == 0 || in patch_stac92hd71bxx()
4755 (codec->core.revision_id & 0xf) == 1) in patch_stac92hd71bxx()
4760 snd_hda_codec_set_pincfg(codec, 0x0f, 0x40f000f0); in patch_stac92hd71bxx()
4761 snd_hda_codec_set_pincfg(codec, 0x19, 0x40f000f3); in patch_stac92hd71bxx()
4764 if ((codec->core.revision_id & 0xf) == 1) in patch_stac92hd71bxx()
4770 if (get_wcaps_type(get_wcaps(codec, 0x28)) == AC_WID_VOL_KNB) in patch_stac92hd71bxx()
4771 snd_hda_add_verbs(codec, stac92hd71bxx_core_init); in patch_stac92hd71bxx()
4773 if (get_wcaps(codec, 0xa) & AC_WCAP_IN_AMP) { in patch_stac92hd71bxx()
4776 snd_hda_codec_amp_init_stereo(codec, *p, HDA_INPUT, 0, in patch_stac92hd71bxx()
4789 snd_hda_pick_fixup(codec, stac92hd71bxx_models, stac92hd71bxx_fixup_tbl, in patch_stac92hd71bxx()
4791 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); in patch_stac92hd71bxx()
4793 stac_setup_gpio(codec); in patch_stac92hd71bxx()
4795 err = stac_parse_auto_config(codec); in patch_stac92hd71bxx()
4797 stac_free(codec); in patch_stac92hd71bxx()
4801 codec->proc_widget_hook = stac92hd7x_proc_hook; in patch_stac92hd71bxx()
4803 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); in patch_stac92hd71bxx()
4808 static int patch_stac922x(struct hda_codec *codec) in patch_stac922x() argument
4813 err = alloc_stac_spec(codec); in patch_stac922x()
4817 spec = codec->spec; in patch_stac922x()
4821 snd_hda_add_verbs(codec, stac922x_core_init); in patch_stac922x()
4824 snd_hda_override_amp_caps(codec, 0x12, HDA_OUTPUT, in patch_stac922x()
4830 snd_hda_pick_fixup(codec, stac922x_models, stac922x_fixup_tbl, in patch_stac922x()
4832 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); in patch_stac922x()
4834 err = stac_parse_auto_config(codec); in patch_stac922x()
4836 stac_free(codec); in patch_stac922x()
4840 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); in patch_stac922x()
4850 static int patch_stac927x(struct hda_codec *codec) in patch_stac927x() argument
4855 err = alloc_stac_spec(codec); in patch_stac927x()
4859 spec = codec->spec; in patch_stac927x()
4876 snd_hda_pick_fixup(codec, stac927x_models, stac927x_fixup_tbl, in patch_stac927x()
4878 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); in patch_stac927x()
4881 snd_hda_add_verbs(codec, stac927x_core_init); in patch_stac927x()
4883 err = stac_parse_auto_config(codec); in patch_stac927x()
4885 stac_free(codec); in patch_stac927x()
4889 codec->proc_widget_hook = stac927x_proc_hook; in patch_stac927x()
4901 codec->bus->needs_damn_long_delay = 1; in patch_stac927x()
4903 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); in patch_stac927x()
4908 static int patch_stac9205(struct hda_codec *codec) in patch_stac9205() argument
4913 err = alloc_stac_spec(codec); in patch_stac9205()
4917 spec = codec->spec; in patch_stac9205()
4924 snd_hda_add_verbs(codec, stac9205_core_init); in patch_stac9205()
4937 snd_hda_pick_fixup(codec, stac9205_models, stac9205_fixup_tbl, in patch_stac9205()
4939 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); in patch_stac9205()
4941 err = stac_parse_auto_config(codec); in patch_stac9205()
4943 stac_free(codec); in patch_stac9205()
4947 codec->proc_widget_hook = stac9205_proc_hook; in patch_stac9205()
4949 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); in patch_stac9205()
4995 static int patch_stac9872(struct hda_codec *codec) in patch_stac9872() argument
5000 err = alloc_stac_spec(codec); in patch_stac9872()
5004 spec = codec->spec; in patch_stac9872()
5008 snd_hda_add_verbs(codec, stac9872_core_init); in patch_stac9872()
5010 snd_hda_pick_fixup(codec, stac9872_models, stac9872_fixup_tbl, in patch_stac9872()
5012 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); in patch_stac9872()
5014 err = stac_parse_auto_config(codec); in patch_stac9872()
5016 stac_free(codec); in patch_stac9872()
5020 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); in patch_stac9872()