Lines Matching defs:codec

50 static int create_beep_ctls(struct hda_codec *codec)
52 struct ad198x_spec *spec = codec->spec;
61 kctl = snd_ctl_new1(knew, codec);
65 err = snd_hda_ctl_add(codec, 0, kctl);
72 #define create_beep_ctls(codec) 0
76 static void ad198x_power_eapd_write(struct hda_codec *codec, hda_nid_t front,
79 if (snd_hda_query_pin_caps(codec, front) & AC_PINCAP_EAPD)
80 snd_hda_codec_write(codec, front, 0, AC_VERB_SET_EAPD_BTLENABLE,
81 !codec->inv_eapd ? 0x00 : 0x02);
82 if (snd_hda_query_pin_caps(codec, hp) & AC_PINCAP_EAPD)
83 snd_hda_codec_write(codec, hp, 0, AC_VERB_SET_EAPD_BTLENABLE,
84 !codec->inv_eapd ? 0x00 : 0x02);
87 static void ad198x_power_eapd(struct hda_codec *codec)
90 switch (codec->core.vendor_id) {
103 ad198x_power_eapd_write(codec, 0x12, 0x11);
107 ad198x_power_eapd_write(codec, 0x05, 0x06);
110 ad198x_power_eapd_write(codec, 0x1b, 0x1a);
115 static int ad198x_suspend(struct hda_codec *codec)
117 snd_hda_shutup_pins(codec);
118 ad198x_power_eapd(codec);
126 struct hda_codec *codec = private_data;
127 struct ad198x_spec *spec = codec->spec;
131 if (codec->inv_eapd)
133 snd_hda_codec_write_cache(codec, spec->eapd_nid, 0,
142 static int ad198x_auto_build_controls(struct hda_codec *codec)
146 err = snd_hda_gen_build_controls(codec);
149 err = create_beep_ctls(codec);
168 static int ad198x_parse_auto_config(struct hda_codec *codec, bool indep_hp)
170 struct ad198x_spec *spec = codec->spec;
174 codec->spdif_status_reset = 1;
175 codec->no_trigger_sense = 1;
176 codec->no_sticky_stream = 1;
182 err = snd_hda_parse_pin_defcfg(codec, cfg, NULL, 0);
185 err = snd_hda_gen_parse_auto_config(codec, cfg);
196 static int alloc_ad_spec(struct hda_codec *codec)
203 codec->spec = spec;
205 codec->patch_ops = ad198x_auto_patch_ops;
214 static void ad_fixup_inv_jack_detect(struct hda_codec *codec,
217 struct ad198x_spec *spec = codec->spec;
220 codec->inv_jack_detect = 1;
228 static void ad1986a_fixup_eapd(struct hda_codec *codec,
231 struct ad198x_spec *spec = codec->spec;
234 codec->inv_eapd = 0;
241 static void ad1986a_fixup_eapd_mix_in(struct hda_codec *codec,
244 struct ad198x_spec *spec = codec->spec;
247 ad1986a_fixup_eapd(codec, fix, action);
382 static int patch_ad1986a(struct hda_codec *codec)
395 err = alloc_ad_spec(codec);
398 spec = codec->spec;
401 codec->inv_eapd = 1;
420 snd_hda_pick_fixup(codec, ad1986a_fixup_models, ad1986a_fixup_tbl,
422 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
424 err = ad198x_parse_auto_config(codec, false);
426 snd_hda_gen_free(codec);
430 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
446 struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
447 struct ad198x_spec *spec = codec->spec;
463 struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
464 struct ad198x_spec *spec = codec->spec;
473 struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
474 struct ad198x_spec *spec = codec->spec;
484 snd_hda_codec_write_cache(codec, dig_out, 0,
497 static int ad1983_add_spdif_mux_ctl(struct hda_codec *codec)
499 struct ad198x_spec *spec = codec->spec;
505 num_conns = snd_hda_get_num_conns(codec, dig_out);
514 static int patch_ad1983(struct hda_codec *codec)
521 err = alloc_ad_spec(codec);
524 spec = codec->spec;
531 snd_hda_override_conn_list(codec, 0x0c, ARRAY_SIZE(conn_0c), conn_0c);
532 snd_hda_override_conn_list(codec, 0x0d, ARRAY_SIZE(conn_0d), conn_0d);
534 err = ad198x_parse_auto_config(codec, false);
537 err = ad1983_add_spdif_mux_ctl(codec);
543 snd_hda_gen_free(codec);
552 static void ad1981_fixup_hp_eapd(struct hda_codec *codec,
555 struct ad198x_spec *spec = codec->spec;
566 static void ad1981_fixup_amp_override(struct hda_codec *codec,
570 snd_hda_override_amp_caps(codec, 0x11, HDA_INPUT,
604 static int patch_ad1981(struct hda_codec *codec)
609 err = alloc_ad_spec(codec);
612 spec = codec->spec;
618 snd_hda_pick_fixup(codec, NULL, ad1981_fixup_tbl, ad1981_fixups);
619 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
621 err = ad198x_parse_auto_config(codec, false);
624 err = ad1983_add_spdif_mux_ctl(codec);
628 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
633 snd_hda_gen_free(codec);
726 struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
727 struct ad198x_spec *spec = codec->spec;
741 struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
742 struct ad198x_spec *spec = codec->spec;
751 struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
752 struct ad198x_spec *spec = codec->spec;
762 mutex_lock(&codec->control_mutex);
763 path = snd_hda_get_path_from_idx(codec,
766 snd_hda_activate_path(codec, path, false, true);
767 path = snd_hda_get_path_from_idx(codec, spec->smux_paths[val]);
769 snd_hda_activate_path(codec, path, true, true);
771 mutex_unlock(&codec->control_mutex);
783 static int ad1988_auto_init(struct hda_codec *codec)
785 struct ad198x_spec *spec = codec->spec;
788 err = snd_hda_gen_init(codec);
796 path = snd_hda_get_path_from_idx(codec, spec->smux_paths[i]);
798 snd_hda_activate_path(codec, path, path->active, false);
804 static int ad1988_add_spdif_mux_ctl(struct hda_codec *codec)
806 struct ad198x_spec *spec = codec->spec;
840 get_wcaps_type(get_wcaps(codec, 0x1d)) != AC_WID_AUD_MIX)
843 num_conns = snd_hda_get_num_conns(codec, 0x0b) + 1;
855 spec->smux_paths[i] = snd_hda_get_path_idx(codec, path);
861 codec->patch_ops.init = ad1988_auto_init;
896 static int patch_ad1988(struct hda_codec *codec)
901 err = alloc_ad_spec(codec);
904 spec = codec->spec;
911 snd_hda_pick_fixup(codec, ad1988_fixup_models, NULL, ad1988_fixups);
912 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
914 err = ad198x_parse_auto_config(codec, true);
917 err = ad1988_add_spdif_mux_ctl(codec);
921 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
926 snd_hda_gen_free(codec);
960 static void ad1884_fixup_amp_override(struct hda_codec *codec,
964 snd_hda_override_amp_caps(codec, 0x20, HDA_INPUT,
974 struct hda_codec *codec = private_data;
975 struct ad198x_spec *spec = codec->spec;
979 snd_hda_codec_write_cache(codec, 0x01, 0,
984 static void ad1884_fixup_hp_eapd(struct hda_codec *codec,
987 struct ad198x_spec *spec = codec->spec;
993 snd_hda_codec_write_cache(codec, 0x01, 0,
995 snd_hda_codec_write_cache(codec, 0x01, 0,
997 snd_hda_codec_write_cache(codec, 0x01, 0,
1009 static void ad1884_fixup_thinkpad(struct hda_codec *codec,
1012 struct ad198x_spec *spec = codec->spec;
1076 static int patch_ad1884(struct hda_codec *codec)
1081 err = alloc_ad_spec(codec);
1084 spec = codec->spec;
1091 snd_hda_pick_fixup(codec, NULL, ad1884_fixup_tbl, ad1884_fixups);
1092 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
1094 err = ad198x_parse_auto_config(codec, true);
1097 err = ad1983_add_spdif_mux_ctl(codec);
1101 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
1106 snd_hda_gen_free(codec);
1122 static int patch_ad1882(struct hda_codec *codec)
1127 err = alloc_ad_spec(codec);
1130 spec = codec->spec;
1136 err = ad198x_parse_auto_config(codec, true);
1139 err = ad1988_add_spdif_mux_ctl(codec);
1145 snd_hda_gen_free(codec);
1174 MODULE_DESCRIPTION("Analog Devices HD-audio codec");