• Home
  • Raw
  • Download

Lines Matching full:codec

3  * HD audio interface patch for Conexant HDA audio codec
74 static int cx_auto_parse_beep(struct hda_codec *codec) in cx_auto_parse_beep() argument
76 struct conexant_spec *spec = codec->spec; in cx_auto_parse_beep()
79 for_each_hda_codec_node(nid, codec) in cx_auto_parse_beep()
80 if (get_wcaps_type(get_wcaps(codec, nid)) == AC_WID_BEEP) in cx_auto_parse_beep()
85 #define cx_auto_parse_beep(codec) 0 argument
93 static void cx_auto_parse_eapd(struct hda_codec *codec) in cx_auto_parse_eapd() argument
95 struct conexant_spec *spec = codec->spec; in cx_auto_parse_eapd()
98 for_each_hda_codec_node(nid, codec) { in cx_auto_parse_eapd()
99 if (get_wcaps_type(get_wcaps(codec, nid)) != AC_WID_PIN) in cx_auto_parse_eapd()
101 if (!(snd_hda_query_pin_caps(codec, nid) & AC_PINCAP_EAPD)) in cx_auto_parse_eapd()
118 static void cx_auto_turn_eapd(struct hda_codec *codec, int num_pins, in cx_auto_turn_eapd() argument
123 if (snd_hda_query_pin_caps(codec, pins[i]) & AC_PINCAP_EAPD) in cx_auto_turn_eapd()
124 snd_hda_codec_write(codec, pins[i], 0, in cx_auto_turn_eapd()
133 struct hda_codec *codec = private_data; in cx_auto_vmaster_hook() local
134 struct conexant_spec *spec = codec->spec; in cx_auto_vmaster_hook()
136 cx_auto_turn_eapd(codec, spec->num_eapds, spec->eapds, enabled); in cx_auto_vmaster_hook()
143 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent); in cx_auto_vmaster_mute_led() local
144 struct conexant_spec *spec = codec->spec; in cx_auto_vmaster_mute_led()
146 snd_hda_codec_write(codec, spec->mute_led_eapd, 0, in cx_auto_vmaster_mute_led()
152 static void cxt_init_gpio_led(struct hda_codec *codec) in cxt_init_gpio_led() argument
154 struct conexant_spec *spec = codec->spec; in cxt_init_gpio_led()
158 snd_hda_codec_write(codec, 0x01, 0, AC_VERB_SET_GPIO_MASK, in cxt_init_gpio_led()
160 snd_hda_codec_write(codec, 0x01, 0, AC_VERB_SET_GPIO_DIRECTION, in cxt_init_gpio_led()
162 snd_hda_codec_write(codec, 0x01, 0, AC_VERB_SET_GPIO_DATA, in cxt_init_gpio_led()
167 static int cx_auto_init(struct hda_codec *codec) in cx_auto_init() argument
169 struct conexant_spec *spec = codec->spec; in cx_auto_init()
170 snd_hda_gen_init(codec); in cx_auto_init()
172 cx_auto_turn_eapd(codec, spec->num_eapds, spec->eapds, true); in cx_auto_init()
174 cxt_init_gpio_led(codec); in cx_auto_init()
175 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_INIT); in cx_auto_init()
180 static void cx_auto_reboot_notify(struct hda_codec *codec) in cx_auto_reboot_notify() argument
182 struct conexant_spec *spec = codec->spec; in cx_auto_reboot_notify()
184 /* Turn the problematic codec into D3 to avoid spurious noises in cx_auto_reboot_notify()
186 cx_auto_turn_eapd(codec, spec->num_eapds, spec->eapds, false); in cx_auto_reboot_notify()
187 snd_hda_gen_reboot_notify(codec); in cx_auto_reboot_notify()
190 static void cx_auto_free(struct hda_codec *codec) in cx_auto_free() argument
192 cx_auto_reboot_notify(codec); in cx_auto_free()
193 snd_hda_gen_free(codec); in cx_auto_free()
242 static void cxt_fixup_stereo_dmic(struct hda_codec *codec, in cxt_fixup_stereo_dmic() argument
245 struct conexant_spec *spec = codec->spec; in cxt_fixup_stereo_dmic()
249 static void cxt5066_increase_mic_boost(struct hda_codec *codec, in cxt5066_increase_mic_boost() argument
255 snd_hda_override_amp_caps(codec, 0x17, HDA_OUTPUT, in cxt5066_increase_mic_boost()
262 static void cxt_update_headset_mode(struct hda_codec *codec) in cxt_update_headset_mode() argument
264 /* The verbs used in this function were tested on a Conexant CX20751/2 codec. */ in cxt_update_headset_mode()
267 struct conexant_spec *spec = codec->spec; in cxt_update_headset_mode()
279 …snd_hda_codec_write_cache(codec, 0x1c, 0, 0x410, 0x7c); /* enable merged mode for analog int-mic */ in cxt_update_headset_mode()
282 …snd_hda_codec_write_cache(codec, 0x1c, 0, 0x410, 0x54); /* disable merged mode for analog int-mic … in cxt_update_headset_mode()
283 spec->gen.hp_jack_present = snd_hda_jack_detect(codec, spec->gen.autocfg.hp_pins[0]); in cxt_update_headset_mode()
286 snd_hda_gen_update_outputs(codec); in cxt_update_headset_mode()
289 static void cxt_update_headset_mode_hook(struct hda_codec *codec, in cxt_update_headset_mode_hook() argument
293 cxt_update_headset_mode(codec); in cxt_update_headset_mode_hook()
296 static void cxt_fixup_headphone_mic(struct hda_codec *codec, in cxt_fixup_headphone_mic() argument
299 struct conexant_spec *spec = codec->spec; in cxt_fixup_headphone_mic()
304 snd_hdac_regmap_add_vendor_verb(&codec->core, 0x410); in cxt_fixup_headphone_mic()
312 cxt_update_headset_mode(codec); in cxt_fixup_headphone_mic()
317 static void cxt_fixup_headset_mic(struct hda_codec *codec, in cxt_fixup_headset_mic() argument
320 struct conexant_spec *spec = codec->spec; in cxt_fixup_headset_mic()
338 #define update_mic_pin(codec, nid, val) \ argument
339 snd_hda_codec_write_cache(codec, nid, 0, \
351 static void olpc_xo_update_mic_boost(struct hda_codec *codec) in olpc_xo_update_mic_boost() argument
353 struct conexant_spec *spec = codec->spec; in olpc_xo_update_mic_boost()
360 val |= snd_hda_codec_amp_read(codec, 0x17, ch, HDA_OUTPUT, 0); in olpc_xo_update_mic_boost()
361 snd_hda_codec_write(codec, 0x17, 0, in olpc_xo_update_mic_boost()
366 static void olpc_xo_update_mic_pins(struct hda_codec *codec) in olpc_xo_update_mic_pins() argument
368 struct conexant_spec *spec = codec->spec; in olpc_xo_update_mic_pins()
379 update_mic_pin(codec, 0x1e, 0); in olpc_xo_update_mic_pins()
380 snd_hda_activate_path(codec, spec->dc_mode_path, false, false); in olpc_xo_update_mic_pins()
389 update_mic_pin(codec, 0x1a, spec->recording ? in olpc_xo_update_mic_pins()
390 snd_hda_codec_get_pin_target(codec, 0x1a) : 0); in olpc_xo_update_mic_pins()
391 update_mic_pin(codec, 0x1b, spec->recording ? in olpc_xo_update_mic_pins()
392 snd_hda_codec_get_pin_target(codec, 0x1b) : 0); in olpc_xo_update_mic_pins()
394 path = snd_hda_get_path_from_idx(codec, cur_input); in olpc_xo_update_mic_pins()
396 snd_hda_activate_path(codec, path, true, false); in olpc_xo_update_mic_pins()
399 path = snd_hda_get_path_from_idx(codec, cur_input); in olpc_xo_update_mic_pins()
401 snd_hda_activate_path(codec, path, false, false); in olpc_xo_update_mic_pins()
412 update_mic_pin(codec, 0x1a, val); in olpc_xo_update_mic_pins()
413 update_mic_pin(codec, 0x1b, 0); in olpc_xo_update_mic_pins()
415 update_mic_pin(codec, 0x1e, spec->recording ? PIN_IN : 0); in olpc_xo_update_mic_pins()
416 snd_hda_activate_path(codec, spec->dc_mode_path, true, false); in olpc_xo_update_mic_pins()
421 static void olpc_xo_automic(struct hda_codec *codec, in olpc_xo_automic() argument
424 struct conexant_spec *spec = codec->spec; in olpc_xo_automic()
428 snd_hda_gen_mic_autoswitch(codec, jack); in olpc_xo_automic()
429 olpc_xo_update_mic_pins(codec); in olpc_xo_automic()
431 olpc_xo_update_mic_boost(codec); in olpc_xo_automic()
436 struct hda_codec *codec, in olpc_xo_capture_hook() argument
440 struct conexant_spec *spec = codec->spec; in olpc_xo_capture_hook()
448 olpc_xo_update_mic_pins(codec); in olpc_xo_capture_hook()
452 olpc_xo_update_mic_pins(codec); in olpc_xo_capture_hook()
460 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); in olpc_xo_dc_mode_get() local
461 struct conexant_spec *spec = codec->spec; in olpc_xo_dc_mode_get()
469 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); in olpc_xo_dc_mode_put() local
470 struct conexant_spec *spec = codec->spec; in olpc_xo_dc_mode_put()
477 olpc_xo_update_mic_pins(codec); in olpc_xo_dc_mode_put()
478 olpc_xo_update_mic_boost(codec); in olpc_xo_dc_mode_put()
485 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); in olpc_xo_dc_bias_enum_get() local
486 struct conexant_spec *spec = codec->spec; in olpc_xo_dc_bias_enum_get()
500 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); in olpc_xo_dc_bias_enum_put() local
501 struct conexant_spec *spec = codec->spec; in olpc_xo_dc_bias_enum_put()
513 olpc_xo_update_mic_pins(codec); in olpc_xo_dc_bias_enum_put()
541 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); in olpc_xo_mic_boost_put() local
542 struct conexant_spec *spec = codec->spec; in olpc_xo_mic_boost_put()
545 olpc_xo_update_mic_boost(codec); in olpc_xo_mic_boost_put()
549 static void cxt_fixup_olpc_xo(struct hda_codec *codec, in cxt_fixup_olpc_xo() argument
552 struct conexant_spec *spec = codec->spec; in cxt_fixup_olpc_xo()
561 spec->dc_mode_path = snd_hda_add_new_path(codec, 0x1e, 0x14, 0); in cxt_fixup_olpc_xo()
563 snd_hda_add_new_ctls(codec, olpc_xo_mixers); in cxt_fixup_olpc_xo()
567 * with the DC input range of the codec. in cxt_fixup_olpc_xo()
569 snd_hda_codec_set_pin_target(codec, 0x1a, PIN_VREF50); in cxt_fixup_olpc_xo()
580 static void cxt_fixup_mute_led_eapd(struct hda_codec *codec, in cxt_fixup_mute_led_eapd() argument
583 struct conexant_spec *spec = codec->spec; in cxt_fixup_mute_led_eapd()
588 snd_hda_gen_add_mute_led_cdev(codec, cx_auto_vmaster_mute_led); in cxt_fixup_mute_led_eapd()
596 static void cxt_fixup_cap_mix_amp(struct hda_codec *codec, in cxt_fixup_cap_mix_amp() argument
599 snd_hda_override_amp_caps(codec, 0x17, HDA_INPUT, in cxt_fixup_cap_mix_amp()
610 static void cxt_fixup_cap_mix_amp_5047(struct hda_codec *codec, in cxt_fixup_cap_mix_amp_5047() argument
613 snd_hda_override_amp_caps(codec, 0x10, HDA_INPUT, in cxt_fixup_cap_mix_amp_5047()
620 static void cxt_fixup_hp_gate_mic_jack(struct hda_codec *codec, in cxt_fixup_hp_gate_mic_jack() argument
628 snd_hda_jack_set_gating_jack(codec, 0x19, 0x16); in cxt_fixup_hp_gate_mic_jack()
632 static void cxt_update_gpio_led(struct hda_codec *codec, unsigned int mask, in cxt_update_gpio_led() argument
635 struct conexant_spec *spec = codec->spec; in cxt_update_gpio_led()
645 codec_dbg(codec, "mask:%d enabled:%d gpio_led:%d\n", in cxt_update_gpio_led()
648 snd_hda_codec_write(codec, 0x01, 0, AC_VERB_SET_GPIO_DATA, in cxt_update_gpio_led()
656 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent); in cxt_gpio_mute_update() local
657 struct conexant_spec *spec = codec->spec; in cxt_gpio_mute_update()
659 cxt_update_gpio_led(codec, spec->gpio_mute_led_mask, brightness); in cxt_gpio_mute_update()
667 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent); in cxt_gpio_micmute_update() local
668 struct conexant_spec *spec = codec->spec; in cxt_gpio_micmute_update()
670 cxt_update_gpio_led(codec, spec->gpio_mic_led_mask, brightness); in cxt_gpio_micmute_update()
674 static void cxt_setup_mute_led(struct hda_codec *codec, in cxt_setup_mute_led() argument
677 struct conexant_spec *spec = codec->spec; in cxt_setup_mute_led()
682 snd_hda_gen_add_mute_led_cdev(codec, cxt_gpio_mute_update); in cxt_setup_mute_led()
686 snd_hda_gen_add_micmute_led_cdev(codec, cxt_gpio_micmute_update); in cxt_setup_mute_led()
691 static void cxt_fixup_mute_led_gpio(struct hda_codec *codec, in cxt_fixup_mute_led_gpio() argument
695 cxt_setup_mute_led(codec, 0x01, 0x02); in cxt_fixup_mute_led_gpio()
698 static void cxt_fixup_hp_zbook_mute_led(struct hda_codec *codec, in cxt_fixup_hp_zbook_mute_led() argument
702 cxt_setup_mute_led(codec, 0x10, 0x20); in cxt_fixup_hp_zbook_mute_led()
995 static void add_cx5051_fake_mutes(struct hda_codec *codec) in add_cx5051_fake_mutes() argument
997 struct conexant_spec *spec = codec->spec; in add_cx5051_fake_mutes()
1004 snd_hda_override_amp_caps(codec, *p, HDA_OUTPUT, in add_cx5051_fake_mutes()
1006 query_amp_caps(codec, *p, HDA_OUTPUT)); in add_cx5051_fake_mutes()
1010 static int patch_conexant_auto(struct hda_codec *codec) in patch_conexant_auto() argument
1015 codec_info(codec, "%s: BIOS auto-probing.\n", codec->core.chip_name); in patch_conexant_auto()
1021 codec->spec = spec; in patch_conexant_auto()
1022 codec->patch_ops = cx_auto_patch_ops; in patch_conexant_auto()
1024 cx_auto_parse_eapd(codec); in patch_conexant_auto()
1027 switch (codec->core.vendor_id) { in patch_conexant_auto()
1029 codec->single_adc_amp = 1; in patch_conexant_auto()
1032 snd_hda_pick_fixup(codec, cxt5045_fixup_models, in patch_conexant_auto()
1036 codec->pin_amp_workaround = 1; in patch_conexant_auto()
1039 snd_hda_pick_fixup(codec, cxt5047_fixup_models, in patch_conexant_auto()
1043 add_cx5051_fake_mutes(codec); in patch_conexant_auto()
1044 codec->pin_amp_workaround = 1; in patch_conexant_auto()
1045 snd_hda_pick_fixup(codec, cxt5051_fixup_models, in patch_conexant_auto()
1049 codec->power_save_node = 1; in patch_conexant_auto()
1052 codec->pin_amp_workaround = 1; in patch_conexant_auto()
1053 snd_hda_pick_fixup(codec, cxt5066_fixup_models, in patch_conexant_auto()
1061 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); in patch_conexant_auto()
1063 err = snd_hda_parse_pin_defcfg(codec, &spec->gen.autocfg, NULL, in patch_conexant_auto()
1068 err = snd_hda_gen_parse_auto_config(codec, &spec->gen.autocfg); in patch_conexant_auto()
1072 err = cx_auto_parse_beep(codec); in patch_conexant_auto()
1080 if (!codec->bus->core.sync_write) { in patch_conexant_auto()
1081 codec_info(codec, in patch_conexant_auto()
1083 codec->bus->core.sync_write = 1; in patch_conexant_auto()
1084 codec->bus->allow_bus_reset = 1; in patch_conexant_auto()
1087 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); in patch_conexant_auto()
1092 cx_auto_free(codec); in patch_conexant_auto()
1136 MODULE_DESCRIPTION("Conexant HD-audio codec");