Lines Matching full:codec

3  * HD audio codec driver for AD1882, AD1884, AD1981HD, AD1983, AD1984,
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 guard(mutex)(&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()
750 static int ad_codec_init(struct hda_codec *codec) in ad_codec_init() argument
752 struct ad198x_spec *spec = codec->spec; in ad_codec_init()
755 err = snd_hda_gen_init(codec); in ad_codec_init()
765 path = snd_hda_get_path_from_idx(codec, spec->smux_paths[i]); in ad_codec_init()
767 snd_hda_activate_path(codec, path, path->active, false); in ad_codec_init()
773 static int ad1988_add_spdif_mux_ctl(struct hda_codec *codec) in ad1988_add_spdif_mux_ctl() argument
775 struct ad198x_spec *spec = codec->spec; in ad1988_add_spdif_mux_ctl()
809 get_wcaps_type(get_wcaps(codec, 0x1d)) != AC_WID_AUD_MIX) in ad1988_add_spdif_mux_ctl()
812 num_conns = snd_hda_get_num_conns(codec, 0x0b) + 1; in ad1988_add_spdif_mux_ctl()
824 spec->smux_paths[i] = snd_hda_get_path_idx(codec, path); in ad1988_add_spdif_mux_ctl()
863 static int ad1988_probe(struct hda_codec *codec) in ad1988_probe() argument
865 struct ad198x_spec *spec = codec->spec; in ad1988_probe()
873 snd_hda_pick_fixup(codec, ad1988_fixup_models, NULL, ad1988_fixups); in ad1988_probe()
874 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); in ad1988_probe()
876 err = ad198x_parse_auto_config(codec, true); in ad1988_probe()
879 err = ad1988_add_spdif_mux_ctl(codec); in ad1988_probe()
883 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); in ad1988_probe()
918 static void ad1884_fixup_amp_override(struct hda_codec *codec, in ad1884_fixup_amp_override() argument
922 snd_hda_override_amp_caps(codec, 0x20, HDA_INPUT, in ad1884_fixup_amp_override()
932 struct hda_codec *codec = private_data; in ad1884_vmaster_hp_gpio_hook() local
933 struct ad198x_spec *spec = codec->spec; in ad1884_vmaster_hp_gpio_hook()
937 snd_hda_codec_write_cache(codec, 0x01, 0, in ad1884_vmaster_hp_gpio_hook()
942 static void ad1884_fixup_hp_eapd(struct hda_codec *codec, in ad1884_fixup_hp_eapd() argument
945 struct ad198x_spec *spec = codec->spec; in ad1884_fixup_hp_eapd()
951 snd_hda_codec_write_cache(codec, 0x01, 0, in ad1884_fixup_hp_eapd()
953 snd_hda_codec_write_cache(codec, 0x01, 0, in ad1884_fixup_hp_eapd()
955 snd_hda_codec_write_cache(codec, 0x01, 0, in ad1884_fixup_hp_eapd()
967 static void ad1884_fixup_thinkpad(struct hda_codec *codec, in ad1884_fixup_thinkpad() argument
970 struct ad198x_spec *spec = codec->spec; in ad1884_fixup_thinkpad()
1034 static int ad1884_probe(struct hda_codec *codec) in ad1884_probe() argument
1036 struct ad198x_spec *spec = codec->spec; in ad1884_probe()
1044 snd_hda_pick_fixup(codec, NULL, ad1884_fixup_tbl, ad1884_fixups); in ad1884_probe()
1045 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); in ad1884_probe()
1047 err = ad198x_parse_auto_config(codec, true); in ad1884_probe()
1050 err = ad1983_add_spdif_mux_ctl(codec); in ad1884_probe()
1054 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); in ad1884_probe()
1071 static int ad1882_probe(struct hda_codec *codec) in ad1882_probe() argument
1073 struct ad198x_spec *spec = codec->spec; in ad1882_probe()
1080 err = ad198x_parse_auto_config(codec, true); in ad1882_probe()
1083 err = ad1988_add_spdif_mux_ctl(codec); in ad1882_probe()
1092 static int ad_codec_probe(struct hda_codec *codec, in ad_codec_probe() argument
1098 err = alloc_ad_spec(codec); in ad_codec_probe()
1101 spec = codec->spec; in ad_codec_probe()
1106 err = ad1882_probe(codec); in ad_codec_probe()
1109 err = ad1884_probe(codec); in ad_codec_probe()
1112 err = ad1981_probe(codec); in ad_codec_probe()
1115 err = ad1983_probe(codec); in ad_codec_probe()
1118 err = ad1986a_probe(codec); in ad_codec_probe()
1121 err = ad1988_probe(codec); in ad_codec_probe()
1129 snd_hda_gen_remove(codec); in ad_codec_probe()
1169 MODULE_DESCRIPTION("Analog Devices HD-audio codec");