Lines Matching refs:codec

241 				   struct hda_codec *codec,  in stac_playback_pcm_hook()  argument
245 struct sigmatel_spec *spec = codec->spec; in stac_playback_pcm_hook()
251 struct hda_codec *codec, in stac_capture_pcm_hook() argument
255 struct sigmatel_spec *spec = codec->spec; in stac_capture_pcm_hook()
271 snd_hda_codec_write(codec, hinfo->nid, 0, in stac_capture_pcm_hook()
276 snd_hda_codec_write(codec, hinfo->nid, 0, in stac_capture_pcm_hook()
288 static void stac_gpio_set(struct hda_codec *codec, unsigned int mask, in stac_gpio_set() argument
292 hda_nid_t fg = codec->core.afg; in stac_gpio_set()
294 codec_dbg(codec, "%s msk %x dir %x gpio %x\n", __func__, mask, dir_mask, data); in stac_gpio_set()
296 gpiostate = snd_hda_codec_read(codec, fg, 0, in stac_gpio_set()
300 gpiomask = snd_hda_codec_read(codec, fg, 0, in stac_gpio_set()
304 gpiodir = snd_hda_codec_read(codec, fg, 0, in stac_gpio_set()
309 snd_hda_codec_write(codec, fg, 0, 0x7e7, 0); in stac_gpio_set()
311 snd_hda_codec_write(codec, fg, 0, in stac_gpio_set()
313 snd_hda_codec_read(codec, fg, 0, in stac_gpio_set()
318 snd_hda_codec_read(codec, fg, 0, in stac_gpio_set()
323 static void stac_capture_led_update(struct hda_codec *codec) in stac_capture_led_update() argument
325 struct sigmatel_spec *spec = codec->spec; in stac_capture_led_update()
331 stac_gpio_set(codec, spec->gpio_mask, spec->gpio_dir, spec->gpio_data); in stac_capture_led_update()
334 static int stac_vrefout_set(struct hda_codec *codec, in stac_vrefout_set() argument
339 codec_dbg(codec, "%s, nid %x ctl %x\n", __func__, nid, new_vref); in stac_vrefout_set()
340 pinctl = snd_hda_codec_read(codec, nid, 0, in stac_vrefout_set()
350 error = snd_hda_set_pin_ctl_cache(codec, nid, pinctl); in stac_vrefout_set()
359 static unsigned int stac_vref_led_power_filter(struct hda_codec *codec, in stac_vref_led_power_filter() argument
363 if (nid == codec->core.afg && power_state == AC_PWRST_D3) in stac_vref_led_power_filter()
365 return snd_hda_gen_path_power_filter(codec, nid, power_state); in stac_vref_led_power_filter()
369 static void stac_update_led_status(struct hda_codec *codec, int enabled) in stac_update_led_status() argument
371 struct sigmatel_spec *spec = codec->spec; in stac_update_led_status()
386 stac_gpio_set(codec, spec->gpio_mask, in stac_update_led_status()
390 stac_vrefout_set(codec, spec->vref_mute_led_nid, in stac_update_led_status()
402 static void stac_update_outputs(struct hda_codec *codec) in stac_update_outputs() argument
404 struct sigmatel_spec *spec = codec->spec; in stac_update_outputs()
408 !(snd_hda_codec_read(codec, codec->core.afg, 0, in stac_update_outputs()
411 snd_hda_gen_update_outputs(codec); in stac_update_outputs()
421 stac_gpio_set(codec, spec->gpio_mask, spec->gpio_dir, in stac_update_outputs()
427 static void stac_toggle_power_map(struct hda_codec *codec, hda_nid_t nid, in stac_toggle_power_map() argument
430 struct sigmatel_spec *spec = codec->spec; in stac_toggle_power_map()
452 snd_hda_codec_write(codec, codec->core.afg, 0, in stac_toggle_power_map()
458 static void jack_update_power(struct hda_codec *codec, in jack_update_power() argument
461 struct sigmatel_spec *spec = codec->spec; in jack_update_power()
468 stac_toggle_power_map(codec, jack->nid, in jack_update_power()
469 snd_hda_jack_detect(codec, jack->nid), in jack_update_power()
477 if (!snd_hda_jack_tbl_get(codec, nid)) in jack_update_power()
479 stac_toggle_power_map(codec, nid, in jack_update_power()
480 snd_hda_jack_detect(codec, nid), in jack_update_power()
484 snd_hda_codec_write(codec, codec->core.afg, 0, in jack_update_power()
489 static void stac_vref_event(struct hda_codec *codec, in stac_vref_event() argument
494 data = snd_hda_codec_read(codec, codec->core.afg, 0, in stac_vref_event()
497 snd_hda_codec_write(codec, codec->core.afg, 0, 0x7e0, in stac_vref_event()
504 static void stac_init_power_map(struct hda_codec *codec) in stac_init_power_map() argument
506 struct sigmatel_spec *spec = codec->spec; in stac_init_power_map()
511 unsigned int def_conf = snd_hda_codec_get_pincfg(codec, nid); in stac_init_power_map()
515 is_jack_detectable(codec, nid)) { in stac_init_power_map()
516 snd_hda_jack_detect_enable_callback(codec, nid, in stac_init_power_map()
520 stac_toggle_power_map(codec, nid, false, false); in stac_init_power_map()
522 stac_toggle_power_map(codec, nid, true, false); in stac_init_power_map()
530 static inline bool get_int_hint(struct hda_codec *codec, const char *key, in get_int_hint() argument
533 return !snd_hda_get_int_hint(codec, key, valp); in get_int_hint()
537 static void stac_store_hints(struct hda_codec *codec) in stac_store_hints() argument
539 struct sigmatel_spec *spec = codec->spec; in stac_store_hints()
542 if (get_int_hint(codec, "gpio_mask", &spec->gpio_mask)) { in stac_store_hints()
546 if (get_int_hint(codec, "gpio_dir", &spec->gpio_dir)) in stac_store_hints()
548 if (get_int_hint(codec, "gpio_data", &spec->gpio_data)) in stac_store_hints()
550 if (get_int_hint(codec, "eapd_mask", &spec->eapd_mask)) in stac_store_hints()
552 if (get_int_hint(codec, "gpio_mute", &spec->gpio_mute)) in stac_store_hints()
554 val = snd_hda_get_bool_hint(codec, "eapd_switch"); in stac_store_hints()
568 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); in stac_aloopback_get() local
570 struct sigmatel_spec *spec = codec->spec; in stac_aloopback_get()
580 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); in stac_aloopback_put() local
581 struct sigmatel_spec *spec = codec->spec; in stac_aloopback_put()
599 dac_mode = snd_hda_codec_read(codec, codec->core.afg, 0, in stac_aloopback_put()
604 snd_hda_power_up(codec); in stac_aloopback_put()
607 snd_hda_power_down(codec); in stac_aloopback_put()
611 snd_hda_codec_write_cache(codec, codec->core.afg, 0, in stac_aloopback_put()
633 static bool hp_bnb2011_with_dock(struct hda_codec *codec) in hp_bnb2011_with_dock() argument
635 if (codec->core.vendor_id != 0x111d7605 && in hp_bnb2011_with_dock()
636 codec->core.vendor_id != 0x111d76d1) in hp_bnb2011_with_dock()
639 switch (codec->core.subsystem_id) { in hp_bnb2011_with_dock()
703 static void set_hp_led_gpio(struct hda_codec *codec) in set_hp_led_gpio() argument
705 struct sigmatel_spec *spec = codec->spec; in set_hp_led_gpio()
711 gpio = snd_hda_param_read(codec, codec->core.afg, AC_PAR_GPIO_CAP); in set_hp_led_gpio()
739 static int find_mute_led_cfg(struct hda_codec *codec, int default_polarity) in find_mute_led_cfg() argument
741 struct sigmatel_spec *spec = codec->spec; in find_mute_led_cfg()
744 if (get_int_hint(codec, "gpio_led", &spec->gpio_led)) { in find_mute_led_cfg()
745 get_int_hint(codec, "gpio_led_polarity", in find_mute_led_cfg()
755 max_gpio = snd_hda_param_read(codec, codec->core.afg, in find_mute_led_cfg()
766 set_hp_led_gpio(codec); in find_mute_led_cfg()
771 set_hp_led_gpio(codec); in find_mute_led_cfg()
785 if (!hp_blike_system(codec->core.subsystem_id) && in find_mute_led_cfg()
787 set_hp_led_gpio(codec); in find_mute_led_cfg()
795 static bool has_builtin_speaker(struct hda_codec *codec) in has_builtin_speaker() argument
797 struct sigmatel_spec *spec = codec->spec; in has_builtin_speaker()
810 unsigned int def_conf = snd_hda_codec_get_pincfg(codec, nid_pin[i]); in has_builtin_speaker()
822 static int stac_auto_create_beep_ctls(struct hda_codec *codec, in stac_auto_create_beep_ctls() argument
825 struct sigmatel_spec *spec = codec->spec; in stac_auto_create_beep_ctls()
826 u32 caps = query_amp_caps(codec, nid, HDA_OUTPUT); in stac_auto_create_beep_ctls()
869 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); in stac_dig_beep_switch_get() local
870 ucontrol->value.integer.value[0] = codec->beep->enabled; in stac_dig_beep_switch_get()
877 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); in stac_dig_beep_switch_put() local
878 return snd_hda_enable_beep_device(codec, ucontrol->value.integer.value[0]); in stac_dig_beep_switch_put()
889 static int stac_beep_switch_ctl(struct hda_codec *codec) in stac_beep_switch_ctl() argument
891 struct sigmatel_spec *spec = codec->spec; in stac_beep_switch_ctl()
906 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); in stac_smux_enum_info() local
907 struct sigmatel_spec *spec = codec->spec; in stac_smux_enum_info()
914 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); in stac_smux_enum_get() local
915 struct sigmatel_spec *spec = codec->spec; in stac_smux_enum_get()
925 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); in stac_smux_enum_put() local
926 struct sigmatel_spec *spec = codec->spec; in stac_smux_enum_put()
929 return snd_hda_input_mux_put(codec, &spec->spdif_mux, ucontrol, in stac_smux_enum_put()
947 static int stac_create_spdif_mux_ctls(struct hda_codec *codec) in stac_create_spdif_mux_ctls() argument
949 struct sigmatel_spec *spec = codec->spec; in stac_create_spdif_mux_ctls()
958 num_cons = snd_hda_get_num_conns(codec, cfg->dig_out_pins[0]); in stac_create_spdif_mux_ctls()
967 snd_hda_add_imux_item(codec, &spec->spdif_mux, labels[i], i, NULL); in stac_create_spdif_mux_ctls()
1347 static void stac9200_fixup_panasonic(struct hda_codec *codec, in stac9200_fixup_panasonic() argument
1350 struct sigmatel_spec *spec = codec->spec; in stac9200_fixup_panasonic()
1775 static void stac92hd73xx_fixup_ref(struct hda_codec *codec, in stac92hd73xx_fixup_ref() argument
1778 struct sigmatel_spec *spec = codec->spec; in stac92hd73xx_fixup_ref()
1783 snd_hda_apply_pincfgs(codec, ref92hd73xx_pin_configs); in stac92hd73xx_fixup_ref()
1787 static void stac92hd73xx_fixup_dell(struct hda_codec *codec) in stac92hd73xx_fixup_dell() argument
1789 struct sigmatel_spec *spec = codec->spec; in stac92hd73xx_fixup_dell()
1791 snd_hda_apply_pincfgs(codec, dell_m6_pin_configs); in stac92hd73xx_fixup_dell()
1795 static void stac92hd73xx_fixup_dell_eq(struct hda_codec *codec, in stac92hd73xx_fixup_dell_eq() argument
1798 struct sigmatel_spec *spec = codec->spec; in stac92hd73xx_fixup_dell_eq()
1803 stac92hd73xx_fixup_dell(codec); in stac92hd73xx_fixup_dell_eq()
1804 snd_hda_add_verbs(codec, dell_eq_core_init); in stac92hd73xx_fixup_dell_eq()
1809 static void stac92hd73xx_fixup_dell_m6_amic(struct hda_codec *codec, in stac92hd73xx_fixup_dell_m6_amic() argument
1815 stac92hd73xx_fixup_dell(codec); in stac92hd73xx_fixup_dell_m6_amic()
1816 snd_hda_codec_set_pincfg(codec, 0x0b, 0x90A70170); in stac92hd73xx_fixup_dell_m6_amic()
1820 static void stac92hd73xx_fixup_dell_m6_dmic(struct hda_codec *codec, in stac92hd73xx_fixup_dell_m6_dmic() argument
1826 stac92hd73xx_fixup_dell(codec); in stac92hd73xx_fixup_dell_m6_dmic()
1827 snd_hda_codec_set_pincfg(codec, 0x13, 0x90A60160); in stac92hd73xx_fixup_dell_m6_dmic()
1831 static void stac92hd73xx_fixup_dell_m6_both(struct hda_codec *codec, in stac92hd73xx_fixup_dell_m6_both() argument
1837 stac92hd73xx_fixup_dell(codec); in stac92hd73xx_fixup_dell_m6_both()
1838 snd_hda_codec_set_pincfg(codec, 0x0b, 0x90A70170); in stac92hd73xx_fixup_dell_m6_both()
1839 snd_hda_codec_set_pincfg(codec, 0x13, 0x90A60160); in stac92hd73xx_fixup_dell_m6_both()
1842 static void stac92hd73xx_fixup_alienware_m17x(struct hda_codec *codec, in stac92hd73xx_fixup_alienware_m17x() argument
1845 struct sigmatel_spec *spec = codec->spec; in stac92hd73xx_fixup_alienware_m17x()
1850 snd_hda_apply_pincfgs(codec, alienware_m17x_pin_configs); in stac92hd73xx_fixup_alienware_m17x()
1854 static void stac92hd73xx_fixup_no_jd(struct hda_codec *codec, in stac92hd73xx_fixup_no_jd() argument
1858 codec->no_jack_detect = 1; in stac92hd73xx_fixup_no_jd()
1862 static void stac92hd73xx_disable_automute(struct hda_codec *codec, in stac92hd73xx_disable_automute() argument
1865 struct sigmatel_spec *spec = codec->spec; in stac92hd73xx_disable_automute()
2083 static void stac92hd83xxx_fixup_hp(struct hda_codec *codec, in stac92hd83xxx_fixup_hp() argument
2086 struct sigmatel_spec *spec = codec->spec; in stac92hd83xxx_fixup_hp()
2091 if (hp_bnb2011_with_dock(codec)) { in stac92hd83xxx_fixup_hp()
2092 snd_hda_codec_set_pincfg(codec, 0xa, 0x2101201f); in stac92hd83xxx_fixup_hp()
2093 snd_hda_codec_set_pincfg(codec, 0xf, 0x2181205e); in stac92hd83xxx_fixup_hp()
2096 if (find_mute_led_cfg(codec, spec->default_polarity)) in stac92hd83xxx_fixup_hp()
2097 codec_dbg(codec, "mute LED gpio %d polarity %d\n", in stac92hd83xxx_fixup_hp()
2105 static void stac92hd83xxx_fixup_hp_zephyr(struct hda_codec *codec, in stac92hd83xxx_fixup_hp_zephyr() argument
2111 snd_hda_apply_pincfgs(codec, hp_zephyr_pin_configs); in stac92hd83xxx_fixup_hp_zephyr()
2112 snd_hda_add_verbs(codec, stac92hd83xxx_hp_zephyr_init); in stac92hd83xxx_fixup_hp_zephyr()
2115 static void stac92hd83xxx_fixup_hp_led(struct hda_codec *codec, in stac92hd83xxx_fixup_hp_led() argument
2118 struct sigmatel_spec *spec = codec->spec; in stac92hd83xxx_fixup_hp_led()
2124 static void stac92hd83xxx_fixup_hp_inv_led(struct hda_codec *codec, in stac92hd83xxx_fixup_hp_inv_led() argument
2127 struct sigmatel_spec *spec = codec->spec; in stac92hd83xxx_fixup_hp_inv_led()
2133 static void stac92hd83xxx_fixup_hp_mic_led(struct hda_codec *codec, in stac92hd83xxx_fixup_hp_mic_led() argument
2136 struct sigmatel_spec *spec = codec->spec; in stac92hd83xxx_fixup_hp_mic_led()
2142 codec->core.power_caps &= ~AC_PWRST_CLKSTOP; in stac92hd83xxx_fixup_hp_mic_led()
2147 static void stac92hd83xxx_fixup_hp_led_gpio10(struct hda_codec *codec, in stac92hd83xxx_fixup_hp_led_gpio10() argument
2150 struct sigmatel_spec *spec = codec->spec; in stac92hd83xxx_fixup_hp_led_gpio10()
2158 static void stac92hd83xxx_fixup_headset_jack(struct hda_codec *codec, in stac92hd83xxx_fixup_headset_jack() argument
2161 struct sigmatel_spec *spec = codec->spec; in stac92hd83xxx_fixup_headset_jack()
2167 static void stac92hd83xxx_fixup_gpio10_eapd(struct hda_codec *codec, in stac92hd83xxx_fixup_gpio10_eapd() argument
2171 struct sigmatel_spec *spec = codec->spec; in stac92hd83xxx_fixup_gpio10_eapd()
2180 static void hp_envy_ts_fixup_dac_bind(struct hda_codec *codec, in hp_envy_ts_fixup_dac_bind() argument
2184 struct sigmatel_spec *spec = codec->spec; in hp_envy_ts_fixup_dac_bind()
2939 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); in stac_hp_bass_gpio_get() local
2940 struct sigmatel_spec *spec = codec->spec; in stac_hp_bass_gpio_get()
2948 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); in stac_hp_bass_gpio_put() local
2949 struct sigmatel_spec *spec = codec->spec; in stac_hp_bass_gpio_put()
2957 stac_gpio_set(codec, spec->gpio_mask, spec->gpio_dir, spec->gpio_data); in stac_hp_bass_gpio_put()
2968 static int stac_add_hp_bass_switch(struct hda_codec *codec) in stac_add_hp_bass_switch() argument
2970 struct sigmatel_spec *spec = codec->spec; in stac_add_hp_bass_switch()
3042 static void stac92hd71bxx_fixup_ref(struct hda_codec *codec, in stac92hd71bxx_fixup_ref() argument
3045 struct sigmatel_spec *spec = codec->spec; in stac92hd71bxx_fixup_ref()
3050 snd_hda_apply_pincfgs(codec, ref92hd71bxx_pin_configs); in stac92hd71bxx_fixup_ref()
3054 static void stac92hd71bxx_fixup_hp_m4(struct hda_codec *codec, in stac92hd71bxx_fixup_hp_m4() argument
3057 struct sigmatel_spec *spec = codec->spec; in stac92hd71bxx_fixup_hp_m4()
3064 snd_hda_codec_write_cache(codec, codec->core.afg, 0, in stac92hd71bxx_fixup_hp_m4()
3066 jack = snd_hda_jack_detect_enable_callback(codec, codec->core.afg, in stac92hd71bxx_fixup_hp_m4()
3074 snd_hda_codec_set_pincfg(codec, 0x0e, 0x01813040); in stac92hd71bxx_fixup_hp_m4()
3077 static void stac92hd71bxx_fixup_hp_dv4(struct hda_codec *codec, in stac92hd71bxx_fixup_hp_dv4() argument
3080 struct sigmatel_spec *spec = codec->spec; in stac92hd71bxx_fixup_hp_dv4()
3087 static void stac92hd71bxx_fixup_hp_dv5(struct hda_codec *codec, in stac92hd71bxx_fixup_hp_dv5() argument
3094 snd_hda_codec_set_pincfg(codec, 0x0d, 0x90170010); in stac92hd71bxx_fixup_hp_dv5()
3099 cap = snd_hda_param_read(codec, 0x1, AC_PAR_GPIO_CAP); in stac92hd71bxx_fixup_hp_dv5()
3102 stac_add_hp_bass_switch(codec); in stac92hd71bxx_fixup_hp_dv5()
3107 static void stac92hd71bxx_fixup_hp_hdx(struct hda_codec *codec, in stac92hd71bxx_fixup_hp_hdx() argument
3110 struct sigmatel_spec *spec = codec->spec; in stac92hd71bxx_fixup_hp_hdx()
3117 static bool is_hp_output(struct hda_codec *codec, hda_nid_t pin) in is_hp_output() argument
3119 unsigned int pin_cfg = snd_hda_codec_get_pincfg(codec, pin); in is_hp_output()
3127 static void fixup_hp_headphone(struct hda_codec *codec, hda_nid_t pin) in fixup_hp_headphone() argument
3129 unsigned int pin_cfg = snd_hda_codec_get_pincfg(codec, pin); in fixup_hp_headphone()
3138 snd_hda_codec_set_pincfg(codec, pin, pin_cfg); in fixup_hp_headphone()
3141 static void stac92hd71bxx_fixup_hp(struct hda_codec *codec, in stac92hd71bxx_fixup_hp() argument
3144 struct sigmatel_spec *spec = codec->spec; in stac92hd71bxx_fixup_hp()
3152 if (is_hp_output(codec, 0x0a) && is_hp_output(codec, 0x0f)) { in stac92hd71bxx_fixup_hp()
3153 fixup_hp_headphone(codec, 0x0a); in stac92hd71bxx_fixup_hp()
3154 fixup_hp_headphone(codec, 0x0f); in stac92hd71bxx_fixup_hp()
3157 if (find_mute_led_cfg(codec, 1)) in stac92hd71bxx_fixup_hp()
3158 codec_dbg(codec, "mute LED gpio %d polarity %d\n", in stac92hd71bxx_fixup_hp()
3504 static void stac922x_fixup_intel_mac_auto(struct hda_codec *codec, in stac922x_fixup_intel_mac_auto() argument
3511 codec->fixup_id = HDA_FIXUP_ID_NOT_SET; in stac922x_fixup_intel_mac_auto()
3512 snd_hda_pick_fixup(codec, NULL, stac922x_intel_mac_fixup_tbl, in stac922x_fixup_intel_mac_auto()
3514 if (codec->fixup_id != HDA_FIXUP_ID_NOT_SET) in stac922x_fixup_intel_mac_auto()
3515 snd_hda_apply_fixup(codec, action); in stac922x_fixup_intel_mac_auto()
3518 static void stac922x_fixup_intel_mac_gpio(struct hda_codec *codec, in stac922x_fixup_intel_mac_gpio() argument
3522 struct sigmatel_spec *spec = codec->spec; in stac922x_fixup_intel_mac_gpio()
3810 static void stac927x_fixup_ref_no_jd(struct hda_codec *codec, in stac927x_fixup_ref_no_jd() argument
3815 codec->no_jack_detect = 1; in stac927x_fixup_ref_no_jd()
3818 static void stac927x_fixup_ref(struct hda_codec *codec, in stac927x_fixup_ref() argument
3821 struct sigmatel_spec *spec = codec->spec; in stac927x_fixup_ref()
3824 snd_hda_apply_pincfgs(codec, ref927x_pin_configs); in stac927x_fixup_ref()
3830 static void stac927x_fixup_dell_dmic(struct hda_codec *codec, in stac927x_fixup_dell_dmic() argument
3833 struct sigmatel_spec *spec = codec->spec; in stac927x_fixup_dell_dmic()
3838 if (codec->core.subsystem_id != 0x1028022f) { in stac927x_fixup_dell_dmic()
3844 snd_hda_add_verbs(codec, dell_3st_core_init); in stac927x_fixup_dell_dmic()
3848 static void stac927x_fixup_volknob(struct hda_codec *codec, in stac927x_fixup_volknob() argument
3851 struct sigmatel_spec *spec = codec->spec; in stac927x_fixup_volknob()
3854 snd_hda_add_verbs(codec, stac927x_volknob_core_init); in stac927x_fixup_volknob()
4084 static void stac9205_fixup_ref(struct hda_codec *codec, in stac9205_fixup_ref() argument
4087 struct sigmatel_spec *spec = codec->spec; in stac9205_fixup_ref()
4090 snd_hda_apply_pincfgs(codec, ref9205_pin_configs); in stac9205_fixup_ref()
4096 static void stac9205_fixup_dell_m43(struct hda_codec *codec, in stac9205_fixup_dell_m43() argument
4099 struct sigmatel_spec *spec = codec->spec; in stac9205_fixup_dell_m43()
4103 snd_hda_apply_pincfgs(codec, dell_9205_m43_pin_configs); in stac9205_fixup_dell_m43()
4106 snd_hda_codec_write_cache(codec, codec->core.afg, 0, in stac9205_fixup_dell_m43()
4108 jack = snd_hda_jack_detect_enable_callback(codec, codec->core.afg, in stac9205_fixup_dell_m43()
4124 static void stac9205_fixup_eapd(struct hda_codec *codec, in stac9205_fixup_eapd() argument
4127 struct sigmatel_spec *spec = codec->spec; in stac9205_fixup_eapd()
4213 static void stac92hd95_fixup_hp_led(struct hda_codec *codec, in stac92hd95_fixup_hp_led() argument
4216 struct sigmatel_spec *spec = codec->spec; in stac92hd95_fixup_hp_led()
4221 if (find_mute_led_cfg(codec, spec->default_polarity)) in stac92hd95_fixup_hp_led()
4222 codec_dbg(codec, "mute LED gpio %d polarity %d\n", in stac92hd95_fixup_hp_led()
4255 static int stac_parse_auto_config(struct hda_codec *codec) in stac_parse_auto_config() argument
4257 struct sigmatel_spec *spec = codec->spec; in stac_parse_auto_config()
4264 err = snd_hda_parse_pin_defcfg(codec, &spec->gen.autocfg, NULL, flags); in stac_parse_auto_config()
4274 err = snd_hda_gen_parse_auto_config(codec, &spec->gen.autocfg); in stac_parse_auto_config()
4279 err = snd_hda_gen_fix_pin_power(codec, spec->vref_mute_led_nid); in stac_parse_auto_config()
4286 err = stac_auto_create_beep_ctls(codec, in stac_parse_auto_config()
4298 err = stac_auto_create_beep_ctls(codec, nid); in stac_parse_auto_config()
4301 if (codec->beep) { in stac_parse_auto_config()
4303 codec->beep->linear_tone = spec->linear_tone_beep; in stac_parse_auto_config()
4305 caps = query_amp_caps(codec, nid, HDA_OUTPUT); in stac_parse_auto_config()
4307 err = stac_beep_switch_ctl(codec); in stac_parse_auto_config()
4319 snd_hda_get_bool_hint(codec, "loopback") == 1) { in stac_parse_auto_config()
4322 if (snd_hdac_regmap_add_vendor_verb(&codec->core, wr_verb)) in stac_parse_auto_config()
4329 err = stac_create_spdif_mux_ctls(codec); in stac_parse_auto_config()
4334 stac_init_power_map(codec); in stac_parse_auto_config()
4339 static int stac_init(struct hda_codec *codec) in stac_init() argument
4341 struct sigmatel_spec *spec = codec->spec; in stac_init()
4345 stac_store_hints(codec); in stac_init()
4353 stac_gpio_set(codec, spec->gpio_mask, spec->gpio_dir, spec->gpio_data); in stac_init()
4355 snd_hda_gen_init(codec); in stac_init()
4359 snd_hda_codec_write(codec, codec->core.afg, 0, in stac_init()
4368 snd_hda_codec_write(codec, spec->gen.all_adcs[i], 0, in stac_init()
4377 static void stac_shutup(struct hda_codec *codec) in stac_shutup() argument
4379 struct sigmatel_spec *spec = codec->spec; in stac_shutup()
4381 snd_hda_shutup_pins(codec); in stac_shutup()
4384 stac_gpio_set(codec, spec->gpio_mask, in stac_shutup()
4393 struct hda_codec *codec, hda_nid_t nid) in stac92hd_proc_hook() argument
4395 if (nid == codec->core.afg) in stac92hd_proc_hook()
4397 snd_hda_codec_read(codec, nid, 0, in stac92hd_proc_hook()
4402 struct hda_codec *codec, in analog_loop_proc_hook() argument
4406 snd_hda_codec_read(codec, codec->core.afg, 0, verb, 0)); in analog_loop_proc_hook()
4411 struct hda_codec *codec, hda_nid_t nid) in stac92hd7x_proc_hook() argument
4413 stac92hd_proc_hook(buffer, codec, nid); in stac92hd7x_proc_hook()
4414 if (nid == codec->core.afg) in stac92hd7x_proc_hook()
4415 analog_loop_proc_hook(buffer, codec, 0xfa0); in stac92hd7x_proc_hook()
4419 struct hda_codec *codec, hda_nid_t nid) in stac9205_proc_hook() argument
4421 if (nid == codec->core.afg) in stac9205_proc_hook()
4422 analog_loop_proc_hook(buffer, codec, 0xfe0); in stac9205_proc_hook()
4426 struct hda_codec *codec, hda_nid_t nid) in stac927x_proc_hook() argument
4428 if (nid == codec->core.afg) in stac927x_proc_hook()
4429 analog_loop_proc_hook(buffer, codec, 0xfeb); in stac927x_proc_hook()
4439 static int stac_suspend(struct hda_codec *codec) in stac_suspend() argument
4441 stac_shutup(codec); in stac_suspend()
4460 static int alloc_stac_spec(struct hda_codec *codec) in alloc_stac_spec() argument
4468 codec->spec = spec; in alloc_stac_spec()
4469 codec->no_trigger_sense = 1; /* seems common with STAC/IDT codecs */ in alloc_stac_spec()
4471 codec->patch_ops = stac_patch_ops; in alloc_stac_spec()
4475 static int patch_stac9200(struct hda_codec *codec) in patch_stac9200() argument
4480 err = alloc_stac_spec(codec); in patch_stac9200()
4484 spec = codec->spec; in patch_stac9200()
4488 codec->power_filter = snd_hda_codec_eapd_power_filter; in patch_stac9200()
4490 snd_hda_add_verbs(codec, stac9200_eapd_init); in patch_stac9200()
4492 snd_hda_pick_fixup(codec, stac9200_models, stac9200_fixup_tbl, in patch_stac9200()
4494 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); in patch_stac9200()
4496 err = stac_parse_auto_config(codec); in patch_stac9200()
4498 stac_free(codec); in patch_stac9200()
4502 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); in patch_stac9200()
4507 static int patch_stac925x(struct hda_codec *codec) in patch_stac925x() argument
4512 err = alloc_stac_spec(codec); in patch_stac925x()
4516 spec = codec->spec; in patch_stac925x()
4520 snd_hda_add_verbs(codec, stac925x_core_init); in patch_stac925x()
4522 snd_hda_pick_fixup(codec, stac925x_models, stac925x_fixup_tbl, in patch_stac925x()
4524 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); in patch_stac925x()
4526 err = stac_parse_auto_config(codec); in patch_stac925x()
4528 stac_free(codec); in patch_stac925x()
4532 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); in patch_stac925x()
4537 static int patch_stac92hd73xx(struct hda_codec *codec) in patch_stac92hd73xx() argument
4543 err = alloc_stac_spec(codec); in patch_stac92hd73xx()
4547 spec = codec->spec; in patch_stac92hd73xx()
4551 if ((codec->core.vendor_id & 0xfffffff0) != 0x111d7670) in patch_stac92hd73xx()
4552 codec->power_save_node = 1; in patch_stac92hd73xx()
4557 num_dacs = snd_hda_get_num_conns(codec, 0x0a) - 1; in patch_stac92hd73xx()
4559 codec_warn(codec, in patch_stac92hd73xx()
4593 snd_hda_pick_fixup(codec, stac92hd73xx_models, stac92hd73xx_fixup_tbl, in patch_stac92hd73xx()
4595 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); in patch_stac92hd73xx()
4598 snd_hda_add_verbs(codec, stac92hd73xx_core_init); in patch_stac92hd73xx()
4600 err = stac_parse_auto_config(codec); in patch_stac92hd73xx()
4602 stac_free(codec); in patch_stac92hd73xx()
4609 if (spec->eapd_switch && !has_builtin_speaker(codec)) in patch_stac92hd73xx()
4612 codec->proc_widget_hook = stac92hd7x_proc_hook; in patch_stac92hd73xx()
4614 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); in patch_stac92hd73xx()
4619 static void stac_setup_gpio(struct hda_codec *codec) in stac_setup_gpio() argument
4621 struct sigmatel_spec *spec = codec->spec; in stac_setup_gpio()
4630 codec->power_filter = stac_vref_led_power_filter; in stac_setup_gpio()
4639 snd_hda_gen_add_micmute_led(codec, stac_capture_led_update); in stac_setup_gpio()
4643 static int patch_stac92hd83xxx(struct hda_codec *codec) in patch_stac92hd83xxx() argument
4648 err = alloc_stac_spec(codec); in patch_stac92hd83xxx()
4653 codec->core.power_caps &= ~AC_PWRST_EPSS; in patch_stac92hd83xxx()
4655 spec = codec->spec; in patch_stac92hd83xxx()
4656 codec->power_save_node = 1; in patch_stac92hd83xxx()
4667 snd_hda_add_verbs(codec, stac92hd83xxx_core_init); in patch_stac92hd83xxx()
4669 snd_hda_pick_fixup(codec, stac92hd83xxx_models, stac92hd83xxx_fixup_tbl, in patch_stac92hd83xxx()
4671 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); in patch_stac92hd83xxx()
4673 stac_setup_gpio(codec); in patch_stac92hd83xxx()
4675 err = stac_parse_auto_config(codec); in patch_stac92hd83xxx()
4677 stac_free(codec); in patch_stac92hd83xxx()
4681 codec->proc_widget_hook = stac92hd_proc_hook; in patch_stac92hd83xxx()
4683 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); in patch_stac92hd83xxx()
4692 static int patch_stac92hd95(struct hda_codec *codec) in patch_stac92hd95() argument
4697 err = alloc_stac_spec(codec); in patch_stac92hd95()
4702 codec->core.power_caps &= ~AC_PWRST_EPSS; in patch_stac92hd95()
4704 spec = codec->spec; in patch_stac92hd95()
4705 codec->power_save_node = 1; in patch_stac92hd95()
4715 snd_hda_pick_fixup(codec, stac92hd95_models, stac92hd95_fixup_tbl, in patch_stac92hd95()
4717 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); in patch_stac92hd95()
4719 stac_setup_gpio(codec); in patch_stac92hd95()
4721 err = stac_parse_auto_config(codec); in patch_stac92hd95()
4723 stac_free(codec); in patch_stac92hd95()
4727 codec->proc_widget_hook = stac92hd_proc_hook; in patch_stac92hd95()
4729 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); in patch_stac92hd95()
4734 static int patch_stac92hd71bxx(struct hda_codec *codec) in patch_stac92hd71bxx() argument
4740 err = alloc_stac_spec(codec); in patch_stac92hd71bxx()
4744 spec = codec->spec; in patch_stac92hd71bxx()
4758 switch (codec->core.vendor_id) { in patch_stac92hd71bxx()
4764 if ((codec->core.revision_id & 0xf) == 0 || in patch_stac92hd71bxx()
4765 (codec->core.revision_id & 0xf) == 1) in patch_stac92hd71bxx()
4770 snd_hda_codec_set_pincfg(codec, 0x0f, 0x40f000f0); in patch_stac92hd71bxx()
4771 snd_hda_codec_set_pincfg(codec, 0x19, 0x40f000f3); in patch_stac92hd71bxx()
4774 if ((codec->core.revision_id & 0xf) == 1) in patch_stac92hd71bxx()
4780 if (get_wcaps_type(get_wcaps(codec, 0x28)) == AC_WID_VOL_KNB) in patch_stac92hd71bxx()
4781 snd_hda_add_verbs(codec, stac92hd71bxx_core_init); in patch_stac92hd71bxx()
4783 if (get_wcaps(codec, 0xa) & AC_WCAP_IN_AMP) { in patch_stac92hd71bxx()
4786 snd_hda_codec_amp_init_stereo(codec, *p, HDA_INPUT, 0, in patch_stac92hd71bxx()
4799 snd_hda_pick_fixup(codec, stac92hd71bxx_models, stac92hd71bxx_fixup_tbl, in patch_stac92hd71bxx()
4801 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); in patch_stac92hd71bxx()
4803 stac_setup_gpio(codec); in patch_stac92hd71bxx()
4805 err = stac_parse_auto_config(codec); in patch_stac92hd71bxx()
4807 stac_free(codec); in patch_stac92hd71bxx()
4811 codec->proc_widget_hook = stac92hd7x_proc_hook; in patch_stac92hd71bxx()
4813 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); in patch_stac92hd71bxx()
4818 static int patch_stac922x(struct hda_codec *codec) in patch_stac922x() argument
4823 err = alloc_stac_spec(codec); in patch_stac922x()
4827 spec = codec->spec; in patch_stac922x()
4831 snd_hda_add_verbs(codec, stac922x_core_init); in patch_stac922x()
4834 snd_hda_override_amp_caps(codec, 0x12, HDA_OUTPUT, in patch_stac922x()
4840 snd_hda_pick_fixup(codec, stac922x_models, stac922x_fixup_tbl, in patch_stac922x()
4842 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); in patch_stac922x()
4844 err = stac_parse_auto_config(codec); in patch_stac922x()
4846 stac_free(codec); in patch_stac922x()
4850 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); in patch_stac922x()
4860 static int patch_stac927x(struct hda_codec *codec) in patch_stac927x() argument
4865 err = alloc_stac_spec(codec); in patch_stac927x()
4869 spec = codec->spec; in patch_stac927x()
4886 snd_hda_pick_fixup(codec, stac927x_models, stac927x_fixup_tbl, in patch_stac927x()
4888 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); in patch_stac927x()
4891 snd_hda_add_verbs(codec, stac927x_core_init); in patch_stac927x()
4893 err = stac_parse_auto_config(codec); in patch_stac927x()
4895 stac_free(codec); in patch_stac927x()
4899 codec->proc_widget_hook = stac927x_proc_hook; in patch_stac927x()
4911 codec->bus->needs_damn_long_delay = 1; in patch_stac927x()
4913 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); in patch_stac927x()
4918 static int patch_stac9205(struct hda_codec *codec) in patch_stac9205() argument
4923 err = alloc_stac_spec(codec); in patch_stac9205()
4927 spec = codec->spec; in patch_stac9205()
4934 snd_hda_add_verbs(codec, stac9205_core_init); in patch_stac9205()
4947 snd_hda_pick_fixup(codec, stac9205_models, stac9205_fixup_tbl, in patch_stac9205()
4949 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); in patch_stac9205()
4951 err = stac_parse_auto_config(codec); in patch_stac9205()
4953 stac_free(codec); in patch_stac9205()
4957 codec->proc_widget_hook = stac9205_proc_hook; in patch_stac9205()
4959 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); in patch_stac9205()
5005 static int patch_stac9872(struct hda_codec *codec) in patch_stac9872() argument
5010 err = alloc_stac_spec(codec); in patch_stac9872()
5014 spec = codec->spec; in patch_stac9872()
5018 snd_hda_add_verbs(codec, stac9872_core_init); in patch_stac9872()
5020 snd_hda_pick_fixup(codec, stac9872_models, stac9872_fixup_tbl, in patch_stac9872()
5022 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); in patch_stac9872()
5024 err = stac_parse_auto_config(codec); in patch_stac9872()
5026 stac_free(codec); in patch_stac9872()
5030 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); in patch_stac9872()