• Home
  • Raw
  • Download

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
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 int ad198x_suspend(struct hda_codec *codec) in ad198x_suspend() argument
117 snd_hda_shutup_pins(codec); in ad198x_suspend()
118 ad198x_power_eapd(codec); in ad198x_suspend()
126 struct hda_codec *codec = private_data; in ad_vmaster_eapd_hook() local
127 struct ad198x_spec *spec = codec->spec; in ad_vmaster_eapd_hook()
131 if (codec->inv_eapd) in ad_vmaster_eapd_hook()
133 snd_hda_codec_write_cache(codec, spec->eapd_nid, 0, in ad_vmaster_eapd_hook()
142 static int ad198x_auto_build_controls(struct hda_codec *codec) in ad198x_auto_build_controls() argument
146 err = snd_hda_gen_build_controls(codec); in ad198x_auto_build_controls()
149 err = create_beep_ctls(codec); in ad198x_auto_build_controls()
168 static int ad198x_parse_auto_config(struct hda_codec *codec, bool indep_hp) in ad198x_parse_auto_config() argument
170 struct ad198x_spec *spec = codec->spec; in ad198x_parse_auto_config()
174 codec->spdif_status_reset = 1; in ad198x_parse_auto_config()
175 codec->no_trigger_sense = 1; in ad198x_parse_auto_config()
176 codec->no_sticky_stream = 1; in ad198x_parse_auto_config()
182 err = snd_hda_parse_pin_defcfg(codec, cfg, NULL, 0); in ad198x_parse_auto_config()
185 err = snd_hda_gen_parse_auto_config(codec, cfg); in ad198x_parse_auto_config()
196 static int alloc_ad_spec(struct hda_codec *codec) in alloc_ad_spec() argument
203 codec->spec = spec; in alloc_ad_spec()
205 codec->patch_ops = ad198x_auto_patch_ops; in alloc_ad_spec()
214 static void ad_fixup_inv_jack_detect(struct hda_codec *codec, in ad_fixup_inv_jack_detect() argument
217 struct ad198x_spec *spec = codec->spec; in ad_fixup_inv_jack_detect()
220 codec->inv_jack_detect = 1; in ad_fixup_inv_jack_detect()
228 static void ad1986a_fixup_eapd(struct hda_codec *codec, in ad1986a_fixup_eapd() argument
231 struct ad198x_spec *spec = codec->spec; in ad1986a_fixup_eapd()
234 codec->inv_eapd = 0; in ad1986a_fixup_eapd()
241 static void ad1986a_fixup_eapd_mix_in(struct hda_codec *codec, in ad1986a_fixup_eapd_mix_in() argument
244 struct ad198x_spec *spec = codec->spec; in ad1986a_fixup_eapd_mix_in()
247 ad1986a_fixup_eapd(codec, fix, action); in ad1986a_fixup_eapd_mix_in()
382 static int patch_ad1986a(struct hda_codec *codec) in patch_ad1986a() argument
395 err = alloc_ad_spec(codec); in patch_ad1986a()
398 spec = codec->spec; in patch_ad1986a()
401 codec->inv_eapd = 1; in patch_ad1986a()
420 snd_hda_pick_fixup(codec, ad1986a_fixup_models, ad1986a_fixup_tbl, in patch_ad1986a()
422 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); in patch_ad1986a()
424 err = ad198x_parse_auto_config(codec, false); in patch_ad1986a()
426 snd_hda_gen_free(codec); in patch_ad1986a()
430 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); in patch_ad1986a()
446 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); in ad1983_auto_smux_enum_info() local
447 struct ad198x_spec *spec = codec->spec; in ad1983_auto_smux_enum_info()
463 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); in ad1983_auto_smux_enum_get() local
464 struct ad198x_spec *spec = codec->spec; in ad1983_auto_smux_enum_get()
473 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); in ad1983_auto_smux_enum_put() local
474 struct ad198x_spec *spec = codec->spec; in ad1983_auto_smux_enum_put()
484 snd_hda_codec_write_cache(codec, dig_out, 0, in ad1983_auto_smux_enum_put()
497 static int ad1983_add_spdif_mux_ctl(struct hda_codec *codec) in ad1983_add_spdif_mux_ctl() argument
499 struct ad198x_spec *spec = codec->spec; in ad1983_add_spdif_mux_ctl()
505 num_conns = snd_hda_get_num_conns(codec, dig_out); in ad1983_add_spdif_mux_ctl()
514 static int patch_ad1983(struct hda_codec *codec) in patch_ad1983() argument
521 err = alloc_ad_spec(codec); in patch_ad1983()
524 spec = codec->spec; in patch_ad1983()
531 snd_hda_override_conn_list(codec, 0x0c, ARRAY_SIZE(conn_0c), conn_0c); in patch_ad1983()
532 snd_hda_override_conn_list(codec, 0x0d, ARRAY_SIZE(conn_0d), conn_0d); in patch_ad1983()
534 err = ad198x_parse_auto_config(codec, false); in patch_ad1983()
537 err = ad1983_add_spdif_mux_ctl(codec); in patch_ad1983()
543 snd_hda_gen_free(codec); in patch_ad1983()
552 static void ad1981_fixup_hp_eapd(struct hda_codec *codec, in ad1981_fixup_hp_eapd() argument
555 struct ad198x_spec *spec = codec->spec; in ad1981_fixup_hp_eapd()
566 static void ad1981_fixup_amp_override(struct hda_codec *codec, in ad1981_fixup_amp_override() argument
570 snd_hda_override_amp_caps(codec, 0x11, HDA_INPUT, in ad1981_fixup_amp_override()
604 static int patch_ad1981(struct hda_codec *codec) in patch_ad1981() argument
609 err = alloc_ad_spec(codec); in patch_ad1981()
612 spec = codec->spec; in patch_ad1981()
618 snd_hda_pick_fixup(codec, NULL, ad1981_fixup_tbl, ad1981_fixups); in patch_ad1981()
619 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); in patch_ad1981()
621 err = ad198x_parse_auto_config(codec, false); in patch_ad1981()
624 err = ad1983_add_spdif_mux_ctl(codec); in patch_ad1981()
628 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); in patch_ad1981()
633 snd_hda_gen_free(codec); in patch_ad1981()
726 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); in ad1988_auto_smux_enum_info() local
727 struct ad198x_spec *spec = codec->spec; in ad1988_auto_smux_enum_info()
741 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); in ad1988_auto_smux_enum_get() local
742 struct ad198x_spec *spec = codec->spec; in ad1988_auto_smux_enum_get()
751 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); in ad1988_auto_smux_enum_put() local
752 struct ad198x_spec *spec = codec->spec; in ad1988_auto_smux_enum_put()
762 mutex_lock(&codec->control_mutex); in ad1988_auto_smux_enum_put()
763 path = snd_hda_get_path_from_idx(codec, in ad1988_auto_smux_enum_put()
766 snd_hda_activate_path(codec, path, false, true); in ad1988_auto_smux_enum_put()
767 path = snd_hda_get_path_from_idx(codec, spec->smux_paths[val]); in ad1988_auto_smux_enum_put()
769 snd_hda_activate_path(codec, path, true, true); in ad1988_auto_smux_enum_put()
771 mutex_unlock(&codec->control_mutex); in ad1988_auto_smux_enum_put()
783 static int ad1988_auto_init(struct hda_codec *codec) in ad1988_auto_init() argument
785 struct ad198x_spec *spec = codec->spec; in ad1988_auto_init()
788 err = snd_hda_gen_init(codec); in ad1988_auto_init()
796 path = snd_hda_get_path_from_idx(codec, spec->smux_paths[i]); in ad1988_auto_init()
798 snd_hda_activate_path(codec, path, path->active, false); in ad1988_auto_init()
804 static int ad1988_add_spdif_mux_ctl(struct hda_codec *codec) in ad1988_add_spdif_mux_ctl() argument
806 struct ad198x_spec *spec = codec->spec; in ad1988_add_spdif_mux_ctl()
840 get_wcaps_type(get_wcaps(codec, 0x1d)) != AC_WID_AUD_MIX) in ad1988_add_spdif_mux_ctl()
843 num_conns = snd_hda_get_num_conns(codec, 0x0b) + 1; in ad1988_add_spdif_mux_ctl()
855 spec->smux_paths[i] = snd_hda_get_path_idx(codec, path); in ad1988_add_spdif_mux_ctl()
861 codec->patch_ops.init = ad1988_auto_init; in ad1988_add_spdif_mux_ctl()
896 static int patch_ad1988(struct hda_codec *codec) in patch_ad1988() argument
901 err = alloc_ad_spec(codec); in patch_ad1988()
904 spec = codec->spec; in patch_ad1988()
911 snd_hda_pick_fixup(codec, ad1988_fixup_models, NULL, ad1988_fixups); in patch_ad1988()
912 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); in patch_ad1988()
914 err = ad198x_parse_auto_config(codec, true); in patch_ad1988()
917 err = ad1988_add_spdif_mux_ctl(codec); in patch_ad1988()
921 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); in patch_ad1988()
926 snd_hda_gen_free(codec); in patch_ad1988()
960 static void ad1884_fixup_amp_override(struct hda_codec *codec, in ad1884_fixup_amp_override() argument
964 snd_hda_override_amp_caps(codec, 0x20, HDA_INPUT, in ad1884_fixup_amp_override()
974 struct hda_codec *codec = private_data; in ad1884_vmaster_hp_gpio_hook() local
975 struct ad198x_spec *spec = codec->spec; in ad1884_vmaster_hp_gpio_hook()
979 snd_hda_codec_write_cache(codec, 0x01, 0, in ad1884_vmaster_hp_gpio_hook()
984 static void ad1884_fixup_hp_eapd(struct hda_codec *codec, in ad1884_fixup_hp_eapd() argument
987 struct ad198x_spec *spec = codec->spec; in ad1884_fixup_hp_eapd()
993 snd_hda_codec_write_cache(codec, 0x01, 0, in ad1884_fixup_hp_eapd()
995 snd_hda_codec_write_cache(codec, 0x01, 0, in ad1884_fixup_hp_eapd()
997 snd_hda_codec_write_cache(codec, 0x01, 0, in ad1884_fixup_hp_eapd()
1009 static void ad1884_fixup_thinkpad(struct hda_codec *codec, in ad1884_fixup_thinkpad() argument
1012 struct ad198x_spec *spec = codec->spec; in ad1884_fixup_thinkpad()
1076 static int patch_ad1884(struct hda_codec *codec) in patch_ad1884() argument
1081 err = alloc_ad_spec(codec); in patch_ad1884()
1084 spec = codec->spec; in patch_ad1884()
1091 snd_hda_pick_fixup(codec, NULL, ad1884_fixup_tbl, ad1884_fixups); in patch_ad1884()
1092 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); in patch_ad1884()
1094 err = ad198x_parse_auto_config(codec, true); in patch_ad1884()
1097 err = ad1983_add_spdif_mux_ctl(codec); in patch_ad1884()
1101 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); in patch_ad1884()
1106 snd_hda_gen_free(codec); in patch_ad1884()
1122 static int patch_ad1882(struct hda_codec *codec) in patch_ad1882() argument
1127 err = alloc_ad_spec(codec); in patch_ad1882()
1130 spec = codec->spec; in patch_ad1882()
1136 err = ad198x_parse_auto_config(codec, true); in patch_ad1882()
1139 err = ad1988_add_spdif_mux_ctl(codec); in patch_ad1882()
1145 snd_hda_gen_free(codec); in patch_ad1882()