Lines Matching full:spec
56 static int set_beep_amp(struct conexant_spec *spec, hda_nid_t nid, in set_beep_amp() argument
63 spec->gen.beep_nid = nid; in set_beep_amp()
65 knew = snd_hda_gen_add_kctl(&spec->gen, NULL, in set_beep_amp()
76 struct conexant_spec *spec = codec->spec; in cx_auto_parse_beep() local
81 return set_beep_amp(spec, nid, 0, HDA_OUTPUT); in cx_auto_parse_beep()
95 struct conexant_spec *spec = codec->spec; in cx_auto_parse_eapd() local
103 spec->eapds[spec->num_eapds++] = nid; in cx_auto_parse_eapd()
104 if (spec->num_eapds >= ARRAY_SIZE(spec->eapds)) in cx_auto_parse_eapd()
114 if (spec->num_eapds > 2) in cx_auto_parse_eapd()
115 spec->dynamic_eapd = 1; in cx_auto_parse_eapd()
134 struct conexant_spec *spec = codec->spec; in cx_auto_vmaster_hook() local
136 cx_auto_turn_eapd(codec, spec->num_eapds, spec->eapds, enabled); in cx_auto_vmaster_hook()
144 struct conexant_spec *spec = codec->spec; in cx_auto_vmaster_mute_led() local
146 snd_hda_codec_write(codec, spec->mute_led_eapd, 0, in cx_auto_vmaster_mute_led()
154 struct conexant_spec *spec = codec->spec; in cx_auto_init() local
156 if (!spec->dynamic_eapd) in cx_auto_init()
157 cx_auto_turn_eapd(codec, spec->num_eapds, spec->eapds, true); in cx_auto_init()
166 struct conexant_spec *spec = codec->spec; in cx_auto_reboot_notify() local
170 cx_auto_turn_eapd(codec, spec->num_eapds, spec->eapds, false); in cx_auto_reboot_notify()
228 struct conexant_spec *spec = codec->spec; in cxt_fixup_stereo_dmic() local
229 spec->gen.inv_dmic_split = 1; in cxt_fixup_stereo_dmic()
250 struct conexant_spec *spec = codec->spec; in cxt_update_headset_mode() local
251 struct auto_pin_cfg *cfg = &spec->gen.autocfg; in cxt_update_headset_mode()
253 hda_nid_t mux_pin = spec->gen.imux_pins[spec->gen.cur_mux[0]]; in cxt_update_headset_mode()
263 spec->gen.hp_jack_present = false; in cxt_update_headset_mode()
266 spec->gen.hp_jack_present = snd_hda_jack_detect(codec, spec->gen.autocfg.hp_pins[0]); in cxt_update_headset_mode()
282 struct conexant_spec *spec = codec->spec; in cxt_fixup_headphone_mic() local
286 spec->parse_flags |= HDA_PINCFG_HEADPHONE_MIC; in cxt_fixup_headphone_mic()
290 WARN_ON(spec->gen.cap_sync_hook); in cxt_fixup_headphone_mic()
291 spec->gen.cap_sync_hook = cxt_update_headset_mode_hook; in cxt_fixup_headphone_mic()
292 spec->gen.automute_hook = cxt_update_headset_mode; in cxt_fixup_headphone_mic()
303 struct conexant_spec *spec = codec->spec; in cxt_fixup_headset_mic() local
307 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC; in cxt_fixup_headset_mic()
336 struct conexant_spec *spec = codec->spec; in olpc_xo_update_mic_boost() local
342 if (!spec->dc_enable) in olpc_xo_update_mic_boost()
351 struct conexant_spec *spec = codec->spec; in olpc_xo_update_mic_pins() local
355 cur_input = spec->gen.input_paths[0][spec->gen.cur_mux[0]]; in olpc_xo_update_mic_pins()
360 if (!spec->dc_enable) { in olpc_xo_update_mic_pins()
363 snd_hda_activate_path(codec, spec->dc_mode_path, false, false); in olpc_xo_update_mic_pins()
372 update_mic_pin(codec, 0x1a, spec->recording ? in olpc_xo_update_mic_pins()
374 update_mic_pin(codec, 0x1b, spec->recording ? in olpc_xo_update_mic_pins()
391 if (spec->recording) in olpc_xo_update_mic_pins()
392 val = olpc_xo_dc_bias.items[spec->dc_input_bias].index; in olpc_xo_update_mic_pins()
398 update_mic_pin(codec, 0x1e, spec->recording ? PIN_IN : 0); in olpc_xo_update_mic_pins()
399 snd_hda_activate_path(codec, spec->dc_mode_path, true, false); in olpc_xo_update_mic_pins()
407 struct conexant_spec *spec = codec->spec; in olpc_xo_automic() local
410 if (!spec->dc_enable) in olpc_xo_automic()
413 if (spec->dc_enable) in olpc_xo_automic()
423 struct conexant_spec *spec = codec->spec; in olpc_xo_capture_hook() local
425 /* toggle spec->recording flag and update mic pins accordingly in olpc_xo_capture_hook()
430 spec->recording = 1; in olpc_xo_capture_hook()
434 spec->recording = 0; in olpc_xo_capture_hook()
444 struct conexant_spec *spec = codec->spec; in olpc_xo_dc_mode_get() local
445 ucontrol->value.integer.value[0] = spec->dc_enable; in olpc_xo_dc_mode_get()
453 struct conexant_spec *spec = codec->spec; in olpc_xo_dc_mode_put() local
456 if (dc_enable == spec->dc_enable) in olpc_xo_dc_mode_put()
459 spec->dc_enable = dc_enable; in olpc_xo_dc_mode_put()
469 struct conexant_spec *spec = codec->spec; in olpc_xo_dc_bias_enum_get() local
470 ucontrol->value.enumerated.item[0] = spec->dc_input_bias; in olpc_xo_dc_bias_enum_get()
484 struct conexant_spec *spec = codec->spec; in olpc_xo_dc_bias_enum_put() local
491 if (spec->dc_input_bias == idx) in olpc_xo_dc_bias_enum_put()
494 spec->dc_input_bias = idx; in olpc_xo_dc_bias_enum_put()
495 if (spec->dc_enable) in olpc_xo_dc_bias_enum_put()
525 struct conexant_spec *spec = codec->spec; in olpc_xo_mic_boost_put() local
527 if (ret > 0 && spec->dc_enable) in olpc_xo_mic_boost_put()
535 struct conexant_spec *spec = codec->spec; in cxt_fixup_olpc_xo() local
542 spec->gen.mic_autoswitch_hook = olpc_xo_automic; in cxt_fixup_olpc_xo()
543 spec->gen.pcm_capture_hook = olpc_xo_capture_hook; in cxt_fixup_olpc_xo()
544 spec->dc_mode_path = snd_hda_add_new_path(codec, 0x1e, 0x14, 0); in cxt_fixup_olpc_xo()
555 snd_array_for_each(&spec->gen.kctls, i, kctl) { in cxt_fixup_olpc_xo()
566 struct conexant_spec *spec = codec->spec; in cxt_fixup_mute_led_eapd() local
569 spec->mute_led_eapd = 0x1b; in cxt_fixup_mute_led_eapd()
570 spec->dynamic_eapd = 1; in cxt_fixup_mute_led_eapd()
618 struct conexant_spec *spec = codec->spec; in cxt_update_gpio_led() local
619 unsigned int oldval = spec->gpio_led; in cxt_update_gpio_led()
621 if (spec->mute_led_polarity) in cxt_update_gpio_led()
625 spec->gpio_led |= mask; in cxt_update_gpio_led()
627 spec->gpio_led &= ~mask; in cxt_update_gpio_led()
629 mask, led_on, spec->gpio_led); in cxt_update_gpio_led()
630 if (spec->gpio_led != oldval) in cxt_update_gpio_led()
632 spec->gpio_led); in cxt_update_gpio_led()
640 struct conexant_spec *spec = codec->spec; in cxt_gpio_mute_update() local
642 cxt_update_gpio_led(codec, spec->gpio_mute_led_mask, brightness); in cxt_gpio_mute_update()
651 struct conexant_spec *spec = codec->spec; in cxt_gpio_micmute_update() local
653 cxt_update_gpio_led(codec, spec->gpio_mic_led_mask, brightness); in cxt_gpio_micmute_update()
661 struct conexant_spec *spec = codec->spec; in cxt_fixup_mute_led_gpio() local
670 spec->gpio_led = 0; in cxt_fixup_mute_led_gpio()
671 spec->mute_led_polarity = 0; in cxt_fixup_mute_led_gpio()
672 spec->gpio_mute_led_mask = 0x01; in cxt_fixup_mute_led_gpio()
673 spec->gpio_mic_led_mask = 0x02; in cxt_fixup_mute_led_gpio()
677 if (spec->gpio_led) in cxt_fixup_mute_led_gpio()
679 spec->gpio_led); in cxt_fixup_mute_led_gpio()
968 struct conexant_spec *spec = codec->spec; in add_cx5051_fake_mutes() local
978 spec->gen.dac_min_mute = true; in add_cx5051_fake_mutes()
983 struct conexant_spec *spec; in patch_conexant_auto() local
988 spec = kzalloc(sizeof(*spec), GFP_KERNEL); in patch_conexant_auto()
989 if (!spec) in patch_conexant_auto()
991 snd_hda_gen_spec_init(&spec->gen); in patch_conexant_auto()
992 codec->spec = spec; in patch_conexant_auto()
996 spec->gen.own_eapd_ctl = 1; in patch_conexant_auto()
1001 spec->gen.mixer_nid = 0x17; in patch_conexant_auto()
1002 spec->gen.add_stereo_mix_input = HDA_HINT_STEREO_MIX_AUTO; in patch_conexant_auto()
1008 spec->gen.mixer_nid = 0x19; in patch_conexant_auto()
1009 spec->gen.add_stereo_mix_input = HDA_HINT_STEREO_MIX_AUTO; in patch_conexant_auto()
1029 if (!spec->gen.vmaster_mute.hook && spec->dynamic_eapd) in patch_conexant_auto()
1030 spec->gen.vmaster_mute.hook = cx_auto_vmaster_hook; in patch_conexant_auto()
1034 err = snd_hda_parse_pin_defcfg(codec, &spec->gen.autocfg, NULL, in patch_conexant_auto()
1035 spec->parse_flags); in patch_conexant_auto()
1039 err = snd_hda_gen_parse_auto_config(codec, &spec->gen.autocfg); in patch_conexant_auto()