Lines Matching defs:spec

56 static int set_beep_amp(struct conexant_spec *spec, hda_nid_t nid,
63 spec->gen.beep_nid = nid;
65 knew = snd_hda_gen_add_kctl(&spec->gen, NULL,
76 struct conexant_spec *spec = codec->spec;
81 return set_beep_amp(spec, nid, 0, HDA_OUTPUT);
95 struct conexant_spec *spec = codec->spec;
103 spec->eapds[spec->num_eapds++] = nid;
104 if (spec->num_eapds >= ARRAY_SIZE(spec->eapds))
114 if (spec->num_eapds > 2)
115 spec->dynamic_eapd = 1;
134 struct conexant_spec *spec = codec->spec;
136 cx_auto_turn_eapd(codec, spec->num_eapds, spec->eapds, enabled);
144 struct conexant_spec *spec = codec->spec;
146 snd_hda_codec_write(codec, spec->mute_led_eapd, 0,
154 struct conexant_spec *spec = codec->spec;
155 unsigned int mask = spec->gpio_mute_led_mask | spec->gpio_mic_led_mask;
163 spec->gpio_led);
190 struct conexant_spec *spec = codec->spec;
192 if (!spec->dynamic_eapd)
193 cx_auto_turn_eapd(codec, spec->num_eapds, spec->eapds, true);
198 if (spec->is_cx11880_sn6140)
206 struct conexant_spec *spec = codec->spec;
210 cx_auto_turn_eapd(codec, spec->num_eapds, spec->eapds, false);
313 struct conexant_spec *spec = codec->spec;
314 spec->gen.inv_dmic_split = 1;
348 struct conexant_spec *spec = codec->spec;
349 struct auto_pin_cfg *cfg = &spec->gen.autocfg;
351 hda_nid_t mux_pin = spec->gen.imux_pins[spec->gen.cur_mux[0]];
361 spec->gen.hp_jack_present = false;
364 spec->gen.hp_jack_present = snd_hda_jack_detect(codec, spec->gen.autocfg.hp_pins[0]);
380 struct conexant_spec *spec = codec->spec;
384 spec->parse_flags |= HDA_PINCFG_HEADPHONE_MIC;
388 WARN_ON(spec->gen.cap_sync_hook);
389 spec->gen.cap_sync_hook = cxt_update_headset_mode_hook;
390 spec->gen.automute_hook = cxt_update_headset_mode;
401 struct conexant_spec *spec = codec->spec;
405 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
434 struct conexant_spec *spec = codec->spec;
440 if (!spec->dc_enable)
449 struct conexant_spec *spec = codec->spec;
453 cur_input = spec->gen.input_paths[0][spec->gen.cur_mux[0]];
458 if (!spec->dc_enable) {
461 snd_hda_activate_path(codec, spec->dc_mode_path, false, false);
470 update_mic_pin(codec, 0x1a, spec->recording ?
472 update_mic_pin(codec, 0x1b, spec->recording ?
489 if (spec->recording)
490 val = olpc_xo_dc_bias.items[spec->dc_input_bias].index;
496 update_mic_pin(codec, 0x1e, spec->recording ? PIN_IN : 0);
497 snd_hda_activate_path(codec, spec->dc_mode_path, true, false);
505 struct conexant_spec *spec = codec->spec;
508 if (!spec->dc_enable)
511 if (spec->dc_enable)
521 struct conexant_spec *spec = codec->spec;
523 /* toggle spec->recording flag and update mic pins accordingly
528 spec->recording = 1;
532 spec->recording = 0;
542 struct conexant_spec *spec = codec->spec;
543 ucontrol->value.integer.value[0] = spec->dc_enable;
551 struct conexant_spec *spec = codec->spec;
554 if (dc_enable == spec->dc_enable)
557 spec->dc_enable = dc_enable;
567 struct conexant_spec *spec = codec->spec;
568 ucontrol->value.enumerated.item[0] = spec->dc_input_bias;
582 struct conexant_spec *spec = codec->spec;
589 if (spec->dc_input_bias == idx)
592 spec->dc_input_bias = idx;
593 if (spec->dc_enable)
623 struct conexant_spec *spec = codec->spec;
625 if (ret > 0 && spec->dc_enable)
633 struct conexant_spec *spec = codec->spec;
640 spec->gen.mic_autoswitch_hook = olpc_xo_automic;
641 spec->gen.pcm_capture_hook = olpc_xo_capture_hook;
642 spec->dc_mode_path = snd_hda_add_new_path(codec, 0x1e, 0x14, 0);
653 snd_array_for_each(&spec->gen.kctls, i, kctl) {
664 struct conexant_spec *spec = codec->spec;
667 spec->mute_led_eapd = 0x1b;
668 spec->dynamic_eapd = true;
716 struct conexant_spec *spec = codec->spec;
717 unsigned int oldval = spec->gpio_led;
719 if (spec->mute_led_polarity)
723 spec->gpio_led |= mask;
725 spec->gpio_led &= ~mask;
727 mask, led_on, spec->gpio_led);
728 if (spec->gpio_led != oldval)
730 spec->gpio_led);
738 struct conexant_spec *spec = codec->spec;
740 cxt_update_gpio_led(codec, spec->gpio_mute_led_mask, brightness);
749 struct conexant_spec *spec = codec->spec;
751 cxt_update_gpio_led(codec, spec->gpio_mic_led_mask, brightness);
758 struct conexant_spec *spec = codec->spec;
760 spec->gpio_led = 0;
761 spec->mute_led_polarity = 0;
764 spec->gpio_mute_led_mask = mute;
768 spec->gpio_mic_led_mask = mic_mute;
1158 struct conexant_spec *spec = codec->spec;
1168 spec->gen.dac_min_mute = true;
1173 struct conexant_spec *spec;
1178 spec = kzalloc(sizeof(*spec), GFP_KERNEL);
1179 if (!spec)
1181 snd_hda_gen_spec_init(&spec->gen);
1182 codec->spec = spec;
1188 spec->is_cx11880_sn6140 = true;
1194 spec->gen.own_eapd_ctl = 1;
1199 spec->gen.mixer_nid = 0x17;
1200 spec->gen.add_stereo_mix_input = HDA_HINT_STEREO_MIX_AUTO;
1206 spec->gen.mixer_nid = 0x19;
1207 spec->gen.add_stereo_mix_input = HDA_HINT_STEREO_MIX_AUTO;
1219 spec->gen.mixer_nid = 0x22;
1220 spec->gen.add_stereo_mix_input = HDA_HINT_STEREO_MIX_AUTO;
1234 if (!spec->gen.vmaster_mute.hook && spec->dynamic_eapd)
1235 spec->gen.vmaster_mute.hook = cx_auto_vmaster_hook;
1239 err = snd_hda_parse_pin_defcfg(codec, &spec->gen.autocfg, NULL,
1240 spec->parse_flags);
1248 err = snd_hda_gen_parse_auto_config(codec, &spec->gen.autocfg);