Lines Matching full:codec
50 static int create_beep_ctls(struct hda_codec *codec) in create_beep_ctls() argument
52 struct ad198x_spec *spec = codec->spec; in create_beep_ctls()
61 kctl = snd_ctl_new1(knew, codec); in create_beep_ctls()
65 err = snd_hda_ctl_add(codec, 0, kctl); in create_beep_ctls()
72 #define create_beep_ctls(codec) 0 argument
76 static void ad198x_power_eapd_write(struct hda_codec *codec, hda_nid_t front, in ad198x_power_eapd_write() argument
79 if (snd_hda_query_pin_caps(codec, front) & AC_PINCAP_EAPD) in ad198x_power_eapd_write()
80 snd_hda_codec_write(codec, front, 0, AC_VERB_SET_EAPD_BTLENABLE, in ad198x_power_eapd_write()
81 !codec->inv_eapd ? 0x00 : 0x02); in ad198x_power_eapd_write()
82 if (snd_hda_query_pin_caps(codec, hp) & AC_PINCAP_EAPD) in ad198x_power_eapd_write()
83 snd_hda_codec_write(codec, hp, 0, AC_VERB_SET_EAPD_BTLENABLE, in ad198x_power_eapd_write()
84 !codec->inv_eapd ? 0x00 : 0x02); in ad198x_power_eapd_write()
87 static void ad198x_power_eapd(struct hda_codec *codec) in ad198x_power_eapd() argument
90 switch (codec->core.vendor_id) { in ad198x_power_eapd()
103 ad198x_power_eapd_write(codec, 0x12, 0x11); in ad198x_power_eapd()
107 ad198x_power_eapd_write(codec, 0x05, 0x06); in ad198x_power_eapd()
110 ad198x_power_eapd_write(codec, 0x1b, 0x1a); in ad198x_power_eapd()
115 static void ad198x_shutup(struct hda_codec *codec) in ad198x_shutup() argument
117 snd_hda_shutup_pins(codec); in ad198x_shutup()
118 ad198x_power_eapd(codec); in ad198x_shutup()
122 static int ad198x_suspend(struct hda_codec *codec) in ad198x_suspend() argument
124 ad198x_shutup(codec); in ad198x_suspend()
132 struct hda_codec *codec = private_data; in ad_vmaster_eapd_hook() local
133 struct ad198x_spec *spec = codec->spec; in ad_vmaster_eapd_hook()
137 if (codec->inv_eapd) in ad_vmaster_eapd_hook()
139 snd_hda_codec_write_cache(codec, spec->eapd_nid, 0, in ad_vmaster_eapd_hook()
148 static int ad198x_auto_build_controls(struct hda_codec *codec) in ad198x_auto_build_controls() argument
152 err = snd_hda_gen_build_controls(codec); in ad198x_auto_build_controls()
155 err = create_beep_ctls(codec); in ad198x_auto_build_controls()
175 static int ad198x_parse_auto_config(struct hda_codec *codec, bool indep_hp) in ad198x_parse_auto_config() argument
177 struct ad198x_spec *spec = codec->spec; in ad198x_parse_auto_config()
181 codec->spdif_status_reset = 1; in ad198x_parse_auto_config()
182 codec->no_trigger_sense = 1; in ad198x_parse_auto_config()
183 codec->no_sticky_stream = 1; in ad198x_parse_auto_config()
189 err = snd_hda_parse_pin_defcfg(codec, cfg, NULL, 0); in ad198x_parse_auto_config()
192 err = snd_hda_gen_parse_auto_config(codec, cfg); in ad198x_parse_auto_config()
203 static int alloc_ad_spec(struct hda_codec *codec) in alloc_ad_spec() argument
210 codec->spec = spec; in alloc_ad_spec()
212 codec->patch_ops = ad198x_auto_patch_ops; in alloc_ad_spec()
221 static void ad_fixup_inv_jack_detect(struct hda_codec *codec, in ad_fixup_inv_jack_detect() argument
224 struct ad198x_spec *spec = codec->spec; in ad_fixup_inv_jack_detect()
227 codec->inv_jack_detect = 1; in ad_fixup_inv_jack_detect()
235 static void ad1986a_fixup_eapd(struct hda_codec *codec, in ad1986a_fixup_eapd() argument
238 struct ad198x_spec *spec = codec->spec; in ad1986a_fixup_eapd()
241 codec->inv_eapd = 0; in ad1986a_fixup_eapd()
248 static void ad1986a_fixup_eapd_mix_in(struct hda_codec *codec, in ad1986a_fixup_eapd_mix_in() argument
251 struct ad198x_spec *spec = codec->spec; in ad1986a_fixup_eapd_mix_in()
254 ad1986a_fixup_eapd(codec, fix, action); in ad1986a_fixup_eapd_mix_in()
389 static int patch_ad1986a(struct hda_codec *codec) in patch_ad1986a() argument
402 err = alloc_ad_spec(codec); in patch_ad1986a()
405 spec = codec->spec; in patch_ad1986a()
408 codec->inv_eapd = 1; in patch_ad1986a()
427 snd_hda_pick_fixup(codec, ad1986a_fixup_models, ad1986a_fixup_tbl, in patch_ad1986a()
429 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); in patch_ad1986a()
431 err = ad198x_parse_auto_config(codec, false); in patch_ad1986a()
433 snd_hda_gen_free(codec); in patch_ad1986a()
437 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); in patch_ad1986a()
453 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); in ad1983_auto_smux_enum_info() local
454 struct ad198x_spec *spec = codec->spec; in ad1983_auto_smux_enum_info()
470 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); in ad1983_auto_smux_enum_get() local
471 struct ad198x_spec *spec = codec->spec; in ad1983_auto_smux_enum_get()
480 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); in ad1983_auto_smux_enum_put() local
481 struct ad198x_spec *spec = codec->spec; in ad1983_auto_smux_enum_put()
491 snd_hda_codec_write_cache(codec, dig_out, 0, in ad1983_auto_smux_enum_put()
504 static int ad1983_add_spdif_mux_ctl(struct hda_codec *codec) in ad1983_add_spdif_mux_ctl() argument
506 struct ad198x_spec *spec = codec->spec; in ad1983_add_spdif_mux_ctl()
512 num_conns = snd_hda_get_num_conns(codec, dig_out); in ad1983_add_spdif_mux_ctl()
521 static int patch_ad1983(struct hda_codec *codec) in patch_ad1983() argument
528 err = alloc_ad_spec(codec); in patch_ad1983()
531 spec = codec->spec; in patch_ad1983()
538 snd_hda_override_conn_list(codec, 0x0c, ARRAY_SIZE(conn_0c), conn_0c); in patch_ad1983()
539 snd_hda_override_conn_list(codec, 0x0d, ARRAY_SIZE(conn_0d), conn_0d); in patch_ad1983()
541 err = ad198x_parse_auto_config(codec, false); in patch_ad1983()
544 err = ad1983_add_spdif_mux_ctl(codec); in patch_ad1983()
550 snd_hda_gen_free(codec); in patch_ad1983()
559 static void ad1981_fixup_hp_eapd(struct hda_codec *codec, in ad1981_fixup_hp_eapd() argument
562 struct ad198x_spec *spec = codec->spec; in ad1981_fixup_hp_eapd()
573 static void ad1981_fixup_amp_override(struct hda_codec *codec, in ad1981_fixup_amp_override() argument
577 snd_hda_override_amp_caps(codec, 0x11, HDA_INPUT, in ad1981_fixup_amp_override()
611 static int patch_ad1981(struct hda_codec *codec) in patch_ad1981() argument
616 err = alloc_ad_spec(codec); in patch_ad1981()
619 spec = codec->spec; in patch_ad1981()
625 snd_hda_pick_fixup(codec, NULL, ad1981_fixup_tbl, ad1981_fixups); in patch_ad1981()
626 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); in patch_ad1981()
628 err = ad198x_parse_auto_config(codec, false); in patch_ad1981()
631 err = ad1983_add_spdif_mux_ctl(codec); in patch_ad1981()
635 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); in patch_ad1981()
640 snd_hda_gen_free(codec); in patch_ad1981()
733 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); in ad1988_auto_smux_enum_info() local
734 struct ad198x_spec *spec = codec->spec; in ad1988_auto_smux_enum_info()
748 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); in ad1988_auto_smux_enum_get() local
749 struct ad198x_spec *spec = codec->spec; in ad1988_auto_smux_enum_get()
758 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); in ad1988_auto_smux_enum_put() local
759 struct ad198x_spec *spec = codec->spec; in ad1988_auto_smux_enum_put()
769 mutex_lock(&codec->control_mutex); in ad1988_auto_smux_enum_put()
770 path = snd_hda_get_path_from_idx(codec, in ad1988_auto_smux_enum_put()
773 snd_hda_activate_path(codec, path, false, true); in ad1988_auto_smux_enum_put()
774 path = snd_hda_get_path_from_idx(codec, spec->smux_paths[val]); in ad1988_auto_smux_enum_put()
776 snd_hda_activate_path(codec, path, true, true); in ad1988_auto_smux_enum_put()
778 mutex_unlock(&codec->control_mutex); in ad1988_auto_smux_enum_put()
790 static int ad1988_auto_init(struct hda_codec *codec) in ad1988_auto_init() argument
792 struct ad198x_spec *spec = codec->spec; in ad1988_auto_init()
795 err = snd_hda_gen_init(codec); in ad1988_auto_init()
803 path = snd_hda_get_path_from_idx(codec, spec->smux_paths[i]); in ad1988_auto_init()
805 snd_hda_activate_path(codec, path, path->active, false); in ad1988_auto_init()
811 static int ad1988_add_spdif_mux_ctl(struct hda_codec *codec) in ad1988_add_spdif_mux_ctl() argument
813 struct ad198x_spec *spec = codec->spec; in ad1988_add_spdif_mux_ctl()
847 get_wcaps_type(get_wcaps(codec, 0x1d)) != AC_WID_AUD_MIX) in ad1988_add_spdif_mux_ctl()
850 num_conns = snd_hda_get_num_conns(codec, 0x0b) + 1; in ad1988_add_spdif_mux_ctl()
862 spec->smux_paths[i] = snd_hda_get_path_idx(codec, path); in ad1988_add_spdif_mux_ctl()
868 codec->patch_ops.init = ad1988_auto_init; in ad1988_add_spdif_mux_ctl()
903 static int patch_ad1988(struct hda_codec *codec) in patch_ad1988() argument
908 err = alloc_ad_spec(codec); in patch_ad1988()
911 spec = codec->spec; in patch_ad1988()
918 snd_hda_pick_fixup(codec, ad1988_fixup_models, NULL, ad1988_fixups); in patch_ad1988()
919 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); in patch_ad1988()
921 err = ad198x_parse_auto_config(codec, true); in patch_ad1988()
924 err = ad1988_add_spdif_mux_ctl(codec); in patch_ad1988()
928 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); in patch_ad1988()
933 snd_hda_gen_free(codec); in patch_ad1988()
967 static void ad1884_fixup_amp_override(struct hda_codec *codec, in ad1884_fixup_amp_override() argument
971 snd_hda_override_amp_caps(codec, 0x20, HDA_INPUT, in ad1884_fixup_amp_override()
981 struct hda_codec *codec = private_data; in ad1884_vmaster_hp_gpio_hook() local
982 struct ad198x_spec *spec = codec->spec; in ad1884_vmaster_hp_gpio_hook()
986 snd_hda_codec_write_cache(codec, 0x01, 0, in ad1884_vmaster_hp_gpio_hook()
991 static void ad1884_fixup_hp_eapd(struct hda_codec *codec, in ad1884_fixup_hp_eapd() argument
994 struct ad198x_spec *spec = codec->spec; in ad1884_fixup_hp_eapd()
1000 snd_hda_codec_write_cache(codec, 0x01, 0, in ad1884_fixup_hp_eapd()
1002 snd_hda_codec_write_cache(codec, 0x01, 0, in ad1884_fixup_hp_eapd()
1004 snd_hda_codec_write_cache(codec, 0x01, 0, in ad1884_fixup_hp_eapd()
1016 static void ad1884_fixup_thinkpad(struct hda_codec *codec, in ad1884_fixup_thinkpad() argument
1019 struct ad198x_spec *spec = codec->spec; in ad1884_fixup_thinkpad()
1083 static int patch_ad1884(struct hda_codec *codec) in patch_ad1884() argument
1088 err = alloc_ad_spec(codec); in patch_ad1884()
1091 spec = codec->spec; in patch_ad1884()
1098 snd_hda_pick_fixup(codec, NULL, ad1884_fixup_tbl, ad1884_fixups); in patch_ad1884()
1099 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); in patch_ad1884()
1101 err = ad198x_parse_auto_config(codec, true); in patch_ad1884()
1104 err = ad1983_add_spdif_mux_ctl(codec); in patch_ad1884()
1108 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); in patch_ad1884()
1113 snd_hda_gen_free(codec); in patch_ad1884()
1129 static int patch_ad1882(struct hda_codec *codec) in patch_ad1882() argument
1134 err = alloc_ad_spec(codec); in patch_ad1882()
1137 spec = codec->spec; in patch_ad1882()
1143 err = ad198x_parse_auto_config(codec, true); in patch_ad1882()
1146 err = ad1988_add_spdif_mux_ctl(codec); in patch_ad1882()
1152 snd_hda_gen_free(codec); in patch_ad1882()
1181 MODULE_DESCRIPTION("Analog Devices HD-audio codec");