Lines Matching refs: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
75 static void ad198x_power_eapd_write(struct hda_codec *codec, hda_nid_t front, in ad198x_power_eapd_write() argument
78 if (snd_hda_query_pin_caps(codec, front) & AC_PINCAP_EAPD) in ad198x_power_eapd_write()
79 snd_hda_codec_write(codec, front, 0, AC_VERB_SET_EAPD_BTLENABLE, in ad198x_power_eapd_write()
80 !codec->inv_eapd ? 0x00 : 0x02); in ad198x_power_eapd_write()
81 if (snd_hda_query_pin_caps(codec, hp) & AC_PINCAP_EAPD) in ad198x_power_eapd_write()
82 snd_hda_codec_write(codec, hp, 0, AC_VERB_SET_EAPD_BTLENABLE, in ad198x_power_eapd_write()
83 !codec->inv_eapd ? 0x00 : 0x02); in ad198x_power_eapd_write()
86 static void ad198x_power_eapd(struct hda_codec *codec) in ad198x_power_eapd() argument
89 switch (codec->core.vendor_id) { in ad198x_power_eapd()
102 ad198x_power_eapd_write(codec, 0x12, 0x11); in ad198x_power_eapd()
106 ad198x_power_eapd_write(codec, 0x05, 0x06); in ad198x_power_eapd()
109 ad198x_power_eapd_write(codec, 0x1b, 0x1a); in ad198x_power_eapd()
114 static int ad198x_suspend(struct hda_codec *codec) in ad198x_suspend() argument
116 snd_hda_shutup_pins(codec); in ad198x_suspend()
117 ad198x_power_eapd(codec); in ad198x_suspend()
124 struct hda_codec *codec = private_data; in ad_vmaster_eapd_hook() local
125 struct ad198x_spec *spec = codec->spec; in ad_vmaster_eapd_hook()
129 if (codec->inv_eapd) in ad_vmaster_eapd_hook()
131 snd_hda_codec_write_cache(codec, spec->eapd_nid, 0, in ad_vmaster_eapd_hook()
140 static int ad198x_auto_build_controls(struct hda_codec *codec) in ad198x_auto_build_controls() argument
144 err = snd_hda_gen_build_controls(codec); in ad198x_auto_build_controls()
147 err = create_beep_ctls(codec); in ad198x_auto_build_controls()
164 static int ad198x_parse_auto_config(struct hda_codec *codec, bool indep_hp) in ad198x_parse_auto_config() argument
166 struct ad198x_spec *spec = codec->spec; in ad198x_parse_auto_config()
170 codec->spdif_status_reset = 1; in ad198x_parse_auto_config()
171 codec->no_trigger_sense = 1; in ad198x_parse_auto_config()
172 codec->no_sticky_stream = 1; in ad198x_parse_auto_config()
178 err = snd_hda_parse_pin_defcfg(codec, cfg, NULL, 0); in ad198x_parse_auto_config()
181 err = snd_hda_gen_parse_auto_config(codec, cfg); in ad198x_parse_auto_config()
192 static int alloc_ad_spec(struct hda_codec *codec) in alloc_ad_spec() argument
199 codec->spec = spec; in alloc_ad_spec()
201 codec->patch_ops = ad198x_auto_patch_ops; in alloc_ad_spec()
210 static void ad_fixup_inv_jack_detect(struct hda_codec *codec, in ad_fixup_inv_jack_detect() argument
213 struct ad198x_spec *spec = codec->spec; in ad_fixup_inv_jack_detect()
216 codec->inv_jack_detect = 1; in ad_fixup_inv_jack_detect()
224 static void ad1986a_fixup_eapd(struct hda_codec *codec, in ad1986a_fixup_eapd() argument
227 struct ad198x_spec *spec = codec->spec; in ad1986a_fixup_eapd()
230 codec->inv_eapd = 0; in ad1986a_fixup_eapd()
237 static void ad1986a_fixup_eapd_mix_in(struct hda_codec *codec, in ad1986a_fixup_eapd_mix_in() argument
240 struct ad198x_spec *spec = codec->spec; in ad1986a_fixup_eapd_mix_in()
243 ad1986a_fixup_eapd(codec, fix, action); in ad1986a_fixup_eapd_mix_in()
378 static int patch_ad1986a(struct hda_codec *codec) in patch_ad1986a() argument
391 err = alloc_ad_spec(codec); in patch_ad1986a()
394 spec = codec->spec; in patch_ad1986a()
397 codec->inv_eapd = 1; in patch_ad1986a()
416 snd_hda_pick_fixup(codec, ad1986a_fixup_models, ad1986a_fixup_tbl, in patch_ad1986a()
418 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); in patch_ad1986a()
420 err = ad198x_parse_auto_config(codec, false); in patch_ad1986a()
422 snd_hda_gen_free(codec); in patch_ad1986a()
426 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); in patch_ad1986a()
442 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); in ad1983_auto_smux_enum_info() local
443 struct ad198x_spec *spec = codec->spec; in ad1983_auto_smux_enum_info()
459 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); in ad1983_auto_smux_enum_get() local
460 struct ad198x_spec *spec = codec->spec; in ad1983_auto_smux_enum_get()
469 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); in ad1983_auto_smux_enum_put() local
470 struct ad198x_spec *spec = codec->spec; in ad1983_auto_smux_enum_put()
480 snd_hda_codec_write_cache(codec, dig_out, 0, in ad1983_auto_smux_enum_put()
493 static int ad1983_add_spdif_mux_ctl(struct hda_codec *codec) in ad1983_add_spdif_mux_ctl() argument
495 struct ad198x_spec *spec = codec->spec; in ad1983_add_spdif_mux_ctl()
501 num_conns = snd_hda_get_num_conns(codec, dig_out); in ad1983_add_spdif_mux_ctl()
510 static int patch_ad1983(struct hda_codec *codec) in patch_ad1983() argument
517 err = alloc_ad_spec(codec); in patch_ad1983()
520 spec = codec->spec; in patch_ad1983()
527 snd_hda_override_conn_list(codec, 0x0c, ARRAY_SIZE(conn_0c), conn_0c); in patch_ad1983()
528 snd_hda_override_conn_list(codec, 0x0d, ARRAY_SIZE(conn_0d), conn_0d); in patch_ad1983()
530 err = ad198x_parse_auto_config(codec, false); in patch_ad1983()
533 err = ad1983_add_spdif_mux_ctl(codec); in patch_ad1983()
539 snd_hda_gen_free(codec); in patch_ad1983()
548 static void ad1981_fixup_hp_eapd(struct hda_codec *codec, in ad1981_fixup_hp_eapd() argument
551 struct ad198x_spec *spec = codec->spec; in ad1981_fixup_hp_eapd()
562 static void ad1981_fixup_amp_override(struct hda_codec *codec, in ad1981_fixup_amp_override() argument
566 snd_hda_override_amp_caps(codec, 0x11, HDA_INPUT, in ad1981_fixup_amp_override()
600 static int patch_ad1981(struct hda_codec *codec) in patch_ad1981() argument
605 err = alloc_ad_spec(codec); in patch_ad1981()
608 spec = codec->spec; in patch_ad1981()
614 snd_hda_pick_fixup(codec, NULL, ad1981_fixup_tbl, ad1981_fixups); in patch_ad1981()
615 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); in patch_ad1981()
617 err = ad198x_parse_auto_config(codec, false); in patch_ad1981()
620 err = ad1983_add_spdif_mux_ctl(codec); in patch_ad1981()
624 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); in patch_ad1981()
629 snd_hda_gen_free(codec); in patch_ad1981()
722 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); in ad1988_auto_smux_enum_info() local
723 struct ad198x_spec *spec = codec->spec; in ad1988_auto_smux_enum_info()
737 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); in ad1988_auto_smux_enum_get() local
738 struct ad198x_spec *spec = codec->spec; in ad1988_auto_smux_enum_get()
747 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); in ad1988_auto_smux_enum_put() local
748 struct ad198x_spec *spec = codec->spec; in ad1988_auto_smux_enum_put()
758 mutex_lock(&codec->control_mutex); in ad1988_auto_smux_enum_put()
759 path = snd_hda_get_path_from_idx(codec, in ad1988_auto_smux_enum_put()
762 snd_hda_activate_path(codec, path, false, true); in ad1988_auto_smux_enum_put()
763 path = snd_hda_get_path_from_idx(codec, spec->smux_paths[val]); in ad1988_auto_smux_enum_put()
765 snd_hda_activate_path(codec, path, true, true); in ad1988_auto_smux_enum_put()
767 mutex_unlock(&codec->control_mutex); in ad1988_auto_smux_enum_put()
779 static int ad1988_auto_init(struct hda_codec *codec) in ad1988_auto_init() argument
781 struct ad198x_spec *spec = codec->spec; in ad1988_auto_init()
784 err = snd_hda_gen_init(codec); in ad1988_auto_init()
792 path = snd_hda_get_path_from_idx(codec, spec->smux_paths[i]); in ad1988_auto_init()
794 snd_hda_activate_path(codec, path, path->active, false); in ad1988_auto_init()
800 static int ad1988_add_spdif_mux_ctl(struct hda_codec *codec) in ad1988_add_spdif_mux_ctl() argument
802 struct ad198x_spec *spec = codec->spec; in ad1988_add_spdif_mux_ctl()
836 get_wcaps_type(get_wcaps(codec, 0x1d)) != AC_WID_AUD_MIX) in ad1988_add_spdif_mux_ctl()
839 num_conns = snd_hda_get_num_conns(codec, 0x0b) + 1; in ad1988_add_spdif_mux_ctl()
851 spec->smux_paths[i] = snd_hda_get_path_idx(codec, path); in ad1988_add_spdif_mux_ctl()
857 codec->patch_ops.init = ad1988_auto_init; in ad1988_add_spdif_mux_ctl()
892 static int patch_ad1988(struct hda_codec *codec) in patch_ad1988() argument
897 err = alloc_ad_spec(codec); in patch_ad1988()
900 spec = codec->spec; in patch_ad1988()
907 snd_hda_pick_fixup(codec, ad1988_fixup_models, NULL, ad1988_fixups); in patch_ad1988()
908 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); in patch_ad1988()
910 err = ad198x_parse_auto_config(codec, true); in patch_ad1988()
913 err = ad1988_add_spdif_mux_ctl(codec); in patch_ad1988()
917 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); in patch_ad1988()
922 snd_hda_gen_free(codec); in patch_ad1988()
956 static void ad1884_fixup_amp_override(struct hda_codec *codec, in ad1884_fixup_amp_override() argument
960 snd_hda_override_amp_caps(codec, 0x20, HDA_INPUT, in ad1884_fixup_amp_override()
970 struct hda_codec *codec = private_data; in ad1884_vmaster_hp_gpio_hook() local
971 struct ad198x_spec *spec = codec->spec; in ad1884_vmaster_hp_gpio_hook()
975 snd_hda_codec_write_cache(codec, 0x01, 0, in ad1884_vmaster_hp_gpio_hook()
980 static void ad1884_fixup_hp_eapd(struct hda_codec *codec, in ad1884_fixup_hp_eapd() argument
983 struct ad198x_spec *spec = codec->spec; in ad1884_fixup_hp_eapd()
989 snd_hda_codec_write_cache(codec, 0x01, 0, in ad1884_fixup_hp_eapd()
991 snd_hda_codec_write_cache(codec, 0x01, 0, in ad1884_fixup_hp_eapd()
993 snd_hda_codec_write_cache(codec, 0x01, 0, in ad1884_fixup_hp_eapd()
1005 static void ad1884_fixup_thinkpad(struct hda_codec *codec, in ad1884_fixup_thinkpad() argument
1008 struct ad198x_spec *spec = codec->spec; in ad1884_fixup_thinkpad()
1072 static int patch_ad1884(struct hda_codec *codec) in patch_ad1884() argument
1077 err = alloc_ad_spec(codec); in patch_ad1884()
1080 spec = codec->spec; in patch_ad1884()
1087 snd_hda_pick_fixup(codec, NULL, ad1884_fixup_tbl, ad1884_fixups); in patch_ad1884()
1088 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); in patch_ad1884()
1090 err = ad198x_parse_auto_config(codec, true); in patch_ad1884()
1093 err = ad1983_add_spdif_mux_ctl(codec); in patch_ad1884()
1097 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); in patch_ad1884()
1102 snd_hda_gen_free(codec); in patch_ad1884()
1118 static int patch_ad1882(struct hda_codec *codec) in patch_ad1882() argument
1123 err = alloc_ad_spec(codec); in patch_ad1882()
1126 spec = codec->spec; in patch_ad1882()
1132 err = ad198x_parse_auto_config(codec, true); in patch_ad1882()
1135 err = ad1988_add_spdif_mux_ctl(codec); in patch_ad1882()
1141 snd_hda_gen_free(codec); in patch_ad1882()