Lines Matching refs:codec
59 static int create_beep_ctls(struct hda_codec *codec) in create_beep_ctls() argument
61 struct ad198x_spec *spec = codec->spec; in create_beep_ctls()
70 kctl = snd_ctl_new1(knew, codec); in create_beep_ctls()
74 err = snd_hda_ctl_add(codec, 0, kctl); in create_beep_ctls()
81 #define create_beep_ctls(codec) 0 argument
84 static void ad198x_power_eapd_write(struct hda_codec *codec, hda_nid_t front, in ad198x_power_eapd_write() argument
87 if (snd_hda_query_pin_caps(codec, front) & AC_PINCAP_EAPD) in ad198x_power_eapd_write()
88 snd_hda_codec_write(codec, front, 0, AC_VERB_SET_EAPD_BTLENABLE, in ad198x_power_eapd_write()
89 !codec->inv_eapd ? 0x00 : 0x02); in ad198x_power_eapd_write()
90 if (snd_hda_query_pin_caps(codec, hp) & AC_PINCAP_EAPD) in ad198x_power_eapd_write()
91 snd_hda_codec_write(codec, hp, 0, AC_VERB_SET_EAPD_BTLENABLE, in ad198x_power_eapd_write()
92 !codec->inv_eapd ? 0x00 : 0x02); in ad198x_power_eapd_write()
95 static void ad198x_power_eapd(struct hda_codec *codec) in ad198x_power_eapd() argument
98 switch (codec->core.vendor_id) { in ad198x_power_eapd()
111 ad198x_power_eapd_write(codec, 0x12, 0x11); in ad198x_power_eapd()
115 ad198x_power_eapd_write(codec, 0x05, 0x06); in ad198x_power_eapd()
118 ad198x_power_eapd_write(codec, 0x1b, 0x1a); in ad198x_power_eapd()
123 static int ad_codec_suspend(struct hda_codec *codec) in ad_codec_suspend() argument
125 snd_hda_shutup_pins(codec); in ad_codec_suspend()
126 ad198x_power_eapd(codec); in ad_codec_suspend()
133 struct hda_codec *codec = private_data; in ad_vmaster_eapd_hook() local
134 struct ad198x_spec *spec = codec->spec; in ad_vmaster_eapd_hook()
138 if (codec->inv_eapd) in ad_vmaster_eapd_hook()
140 snd_hda_codec_write_cache(codec, spec->eapd_nid, 0, in ad_vmaster_eapd_hook()
149 static int ad_codec_build_controls(struct hda_codec *codec) in ad_codec_build_controls() argument
153 err = snd_hda_gen_build_controls(codec); in ad_codec_build_controls()
156 err = create_beep_ctls(codec); in ad_codec_build_controls()
162 static int ad198x_parse_auto_config(struct hda_codec *codec, bool indep_hp) in ad198x_parse_auto_config() argument
164 struct ad198x_spec *spec = codec->spec; in ad198x_parse_auto_config()
168 codec->spdif_status_reset = 1; in ad198x_parse_auto_config()
169 codec->no_trigger_sense = 1; in ad198x_parse_auto_config()
170 codec->no_sticky_stream = 1; in ad198x_parse_auto_config()
176 err = snd_hda_parse_pin_defcfg(codec, cfg, NULL, 0); in ad198x_parse_auto_config()
179 err = snd_hda_gen_parse_auto_config(codec, cfg); in ad198x_parse_auto_config()
190 static int alloc_ad_spec(struct hda_codec *codec) in alloc_ad_spec() argument
197 codec->spec = spec; in alloc_ad_spec()
207 static void ad_fixup_inv_jack_detect(struct hda_codec *codec, in ad_fixup_inv_jack_detect() argument
210 struct ad198x_spec *spec = codec->spec; in ad_fixup_inv_jack_detect()
213 codec->inv_jack_detect = 1; in ad_fixup_inv_jack_detect()
221 static void ad1986a_fixup_eapd(struct hda_codec *codec, in ad1986a_fixup_eapd() argument
224 struct ad198x_spec *spec = codec->spec; in ad1986a_fixup_eapd()
227 codec->inv_eapd = 0; in ad1986a_fixup_eapd()
234 static void ad1986a_fixup_eapd_mix_in(struct hda_codec *codec, in ad1986a_fixup_eapd_mix_in() argument
237 struct ad198x_spec *spec = codec->spec; in ad1986a_fixup_eapd_mix_in()
240 ad1986a_fixup_eapd(codec, fix, action); in ad1986a_fixup_eapd_mix_in()
375 static int ad1986a_probe(struct hda_codec *codec) in ad1986a_probe() argument
378 struct ad198x_spec *spec = codec->spec; in ad1986a_probe()
389 codec->inv_eapd = 1; in ad1986a_probe()
408 snd_hda_pick_fixup(codec, ad1986a_fixup_models, ad1986a_fixup_tbl, in ad1986a_probe()
410 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); in ad1986a_probe()
412 err = ad198x_parse_auto_config(codec, false); in ad1986a_probe()
416 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); in ad1986a_probe()
432 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); in ad1983_auto_smux_enum_info() local
433 struct ad198x_spec *spec = codec->spec; in ad1983_auto_smux_enum_info()
449 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); in ad1983_auto_smux_enum_get() local
450 struct ad198x_spec *spec = codec->spec; in ad1983_auto_smux_enum_get()
459 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); in ad1983_auto_smux_enum_put() local
460 struct ad198x_spec *spec = codec->spec; in ad1983_auto_smux_enum_put()
470 snd_hda_codec_write_cache(codec, dig_out, 0, in ad1983_auto_smux_enum_put()
483 static int ad1983_add_spdif_mux_ctl(struct hda_codec *codec) in ad1983_add_spdif_mux_ctl() argument
485 struct ad198x_spec *spec = codec->spec; in ad1983_add_spdif_mux_ctl()
491 num_conns = snd_hda_get_num_conns(codec, dig_out); in ad1983_add_spdif_mux_ctl()
500 static int ad1983_probe(struct hda_codec *codec) in ad1983_probe() argument
504 struct ad198x_spec *spec = codec->spec; in ad1983_probe()
512 snd_hda_override_conn_list(codec, 0x0c, ARRAY_SIZE(conn_0c), conn_0c); in ad1983_probe()
513 snd_hda_override_conn_list(codec, 0x0d, ARRAY_SIZE(conn_0d), conn_0d); in ad1983_probe()
515 err = ad198x_parse_auto_config(codec, false); in ad1983_probe()
518 err = ad1983_add_spdif_mux_ctl(codec); in ad1983_probe()
529 static void ad1981_fixup_hp_eapd(struct hda_codec *codec, in ad1981_fixup_hp_eapd() argument
532 struct ad198x_spec *spec = codec->spec; in ad1981_fixup_hp_eapd()
543 static void ad1981_fixup_amp_override(struct hda_codec *codec, in ad1981_fixup_amp_override() argument
547 snd_hda_override_amp_caps(codec, 0x11, HDA_INPUT, in ad1981_fixup_amp_override()
581 static int ad1981_probe(struct hda_codec *codec) in ad1981_probe() argument
583 struct ad198x_spec *spec = codec->spec; in ad1981_probe()
590 snd_hda_pick_fixup(codec, NULL, ad1981_fixup_tbl, ad1981_fixups); in ad1981_probe()
591 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); in ad1981_probe()
593 err = ad198x_parse_auto_config(codec, false); in ad1981_probe()
596 err = ad1983_add_spdif_mux_ctl(codec); in ad1981_probe()
600 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); in ad1981_probe()
694 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); in ad1988_auto_smux_enum_info() local
695 struct ad198x_spec *spec = codec->spec; in ad1988_auto_smux_enum_info()
709 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); in ad1988_auto_smux_enum_get() local
710 struct ad198x_spec *spec = codec->spec; in ad1988_auto_smux_enum_get()
719 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); in ad1988_auto_smux_enum_put() local
720 struct ad198x_spec *spec = codec->spec; in ad1988_auto_smux_enum_put()
730 mutex_lock(&codec->control_mutex); in ad1988_auto_smux_enum_put()
731 path = snd_hda_get_path_from_idx(codec, in ad1988_auto_smux_enum_put()
734 snd_hda_activate_path(codec, path, false, true); in ad1988_auto_smux_enum_put()
735 path = snd_hda_get_path_from_idx(codec, spec->smux_paths[val]); in ad1988_auto_smux_enum_put()
737 snd_hda_activate_path(codec, path, true, true); in ad1988_auto_smux_enum_put()
739 mutex_unlock(&codec->control_mutex); in ad1988_auto_smux_enum_put()
751 static int ad_codec_init(struct hda_codec *codec) in ad_codec_init() argument
753 struct ad198x_spec *spec = codec->spec; in ad_codec_init()
756 err = snd_hda_gen_init(codec); in ad_codec_init()
766 path = snd_hda_get_path_from_idx(codec, spec->smux_paths[i]); in ad_codec_init()
768 snd_hda_activate_path(codec, path, path->active, false); in ad_codec_init()
774 static int ad1988_add_spdif_mux_ctl(struct hda_codec *codec) in ad1988_add_spdif_mux_ctl() argument
776 struct ad198x_spec *spec = codec->spec; in ad1988_add_spdif_mux_ctl()
810 get_wcaps_type(get_wcaps(codec, 0x1d)) != AC_WID_AUD_MIX) in ad1988_add_spdif_mux_ctl()
813 num_conns = snd_hda_get_num_conns(codec, 0x0b) + 1; in ad1988_add_spdif_mux_ctl()
825 spec->smux_paths[i] = snd_hda_get_path_idx(codec, path); in ad1988_add_spdif_mux_ctl()
864 static int ad1988_probe(struct hda_codec *codec) in ad1988_probe() argument
866 struct ad198x_spec *spec = codec->spec; in ad1988_probe()
874 snd_hda_pick_fixup(codec, ad1988_fixup_models, NULL, ad1988_fixups); in ad1988_probe()
875 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); in ad1988_probe()
877 err = ad198x_parse_auto_config(codec, true); in ad1988_probe()
880 err = ad1988_add_spdif_mux_ctl(codec); in ad1988_probe()
884 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); in ad1988_probe()
919 static void ad1884_fixup_amp_override(struct hda_codec *codec, in ad1884_fixup_amp_override() argument
923 snd_hda_override_amp_caps(codec, 0x20, HDA_INPUT, in ad1884_fixup_amp_override()
933 struct hda_codec *codec = private_data; in ad1884_vmaster_hp_gpio_hook() local
934 struct ad198x_spec *spec = codec->spec; in ad1884_vmaster_hp_gpio_hook()
938 snd_hda_codec_write_cache(codec, 0x01, 0, in ad1884_vmaster_hp_gpio_hook()
943 static void ad1884_fixup_hp_eapd(struct hda_codec *codec, in ad1884_fixup_hp_eapd() argument
946 struct ad198x_spec *spec = codec->spec; in ad1884_fixup_hp_eapd()
952 snd_hda_codec_write_cache(codec, 0x01, 0, in ad1884_fixup_hp_eapd()
954 snd_hda_codec_write_cache(codec, 0x01, 0, in ad1884_fixup_hp_eapd()
956 snd_hda_codec_write_cache(codec, 0x01, 0, in ad1884_fixup_hp_eapd()
968 static void ad1884_fixup_thinkpad(struct hda_codec *codec, in ad1884_fixup_thinkpad() argument
971 struct ad198x_spec *spec = codec->spec; in ad1884_fixup_thinkpad()
1035 static int ad1884_probe(struct hda_codec *codec) in ad1884_probe() argument
1037 struct ad198x_spec *spec = codec->spec; in ad1884_probe()
1045 snd_hda_pick_fixup(codec, NULL, ad1884_fixup_tbl, ad1884_fixups); in ad1884_probe()
1046 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); in ad1884_probe()
1048 err = ad198x_parse_auto_config(codec, true); in ad1884_probe()
1051 err = ad1983_add_spdif_mux_ctl(codec); in ad1884_probe()
1055 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); in ad1884_probe()
1072 static int ad1882_probe(struct hda_codec *codec) in ad1882_probe() argument
1074 struct ad198x_spec *spec = codec->spec; in ad1882_probe()
1081 err = ad198x_parse_auto_config(codec, true); in ad1882_probe()
1084 err = ad1988_add_spdif_mux_ctl(codec); in ad1882_probe()
1093 static int ad_codec_probe(struct hda_codec *codec, in ad_codec_probe() argument
1099 err = alloc_ad_spec(codec); in ad_codec_probe()
1102 spec = codec->spec; in ad_codec_probe()
1107 err = ad1882_probe(codec); in ad_codec_probe()
1110 err = ad1884_probe(codec); in ad_codec_probe()
1113 err = ad1981_probe(codec); in ad_codec_probe()
1116 err = ad1983_probe(codec); in ad_codec_probe()
1119 err = ad1986a_probe(codec); in ad_codec_probe()
1122 err = ad1988_probe(codec); in ad_codec_probe()
1130 snd_hda_gen_remove(codec); in ad_codec_probe()