Lines Matching refs:spec

63 static int set_beep_amp(struct conexant_spec *spec, hda_nid_t nid,
70 spec->gen.beep_nid = nid;
72 knew = snd_hda_gen_add_kctl(&spec->gen, NULL,
83 struct conexant_spec *spec = codec->spec;
88 return set_beep_amp(spec, nid, 0, HDA_OUTPUT);
102 struct conexant_spec *spec = codec->spec;
110 spec->eapds[spec->num_eapds++] = nid;
111 if (spec->num_eapds >= ARRAY_SIZE(spec->eapds))
121 if (spec->num_eapds > 2)
122 spec->dynamic_eapd = 1;
141 struct conexant_spec *spec = codec->spec;
143 cx_auto_turn_eapd(codec, spec->num_eapds, spec->eapds, enabled);
151 struct conexant_spec *spec = codec->spec;
153 snd_hda_codec_write(codec, spec->mute_led_eapd, 0,
161 struct conexant_spec *spec = codec->spec;
162 unsigned int mask = spec->gpio_mute_led_mask | spec->gpio_mic_led_mask;
170 spec->gpio_led);
197 struct conexant_spec *spec = codec->spec;
199 if (!spec->dynamic_eapd)
200 cx_auto_turn_eapd(codec, spec->num_eapds, spec->eapds, true);
205 if (spec->is_cx8070_sn6140)
213 struct conexant_spec *spec = codec->spec;
217 cx_auto_turn_eapd(codec, spec->num_eapds, spec->eapds, false);
256 struct conexant_spec *spec = codec->spec;
268 spec->headset_present_flag = CX_HEADSET_NOPRESENT;
272 if (spec->headset_present_flag == CX_HEADSET_NOPRESENT) {
273 spec->headset_present_flag = CX_HEADSET_PARTPRESENT;
274 } else if (spec->headset_present_flag == CX_HEADSET_PARTPRESENT) {
281 spec->headset_present_flag = CX_HEADSET_ALLPRESENT;
289 struct conexant_spec *spec = codec->spec;
291 if (spec->is_cx8070_sn6140)
356 struct conexant_spec *spec = codec->spec;
357 spec->gen.inv_dmic_split = 1;
378 struct conexant_spec *spec = codec->spec;
379 struct auto_pin_cfg *cfg = &spec->gen.autocfg;
381 hda_nid_t mux_pin = spec->gen.imux_pins[spec->gen.cur_mux[0]];
391 spec->gen.hp_jack_present = false;
394 spec->gen.hp_jack_present = snd_hda_jack_detect(codec, spec->gen.autocfg.hp_pins[0]);
410 struct conexant_spec *spec = codec->spec;
414 spec->parse_flags |= HDA_PINCFG_HEADPHONE_MIC;
418 WARN_ON(spec->gen.cap_sync_hook);
419 spec->gen.cap_sync_hook = cxt_update_headset_mode_hook;
420 spec->gen.automute_hook = cxt_update_headset_mode;
431 struct conexant_spec *spec = codec->spec;
435 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
464 struct conexant_spec *spec = codec->spec;
470 if (!spec->dc_enable)
479 struct conexant_spec *spec = codec->spec;
483 cur_input = spec->gen.input_paths[0][spec->gen.cur_mux[0]];
488 if (!spec->dc_enable) {
491 snd_hda_activate_path(codec, spec->dc_mode_path, false, false);
500 update_mic_pin(codec, 0x1a, spec->recording ?
502 update_mic_pin(codec, 0x1b, spec->recording ?
519 if (spec->recording)
520 val = olpc_xo_dc_bias.items[spec->dc_input_bias].index;
526 update_mic_pin(codec, 0x1e, spec->recording ? PIN_IN : 0);
527 snd_hda_activate_path(codec, spec->dc_mode_path, true, false);
535 struct conexant_spec *spec = codec->spec;
538 if (!spec->dc_enable)
541 if (spec->dc_enable)
551 struct conexant_spec *spec = codec->spec;
553 /* toggle spec->recording flag and update mic pins accordingly
558 spec->recording = 1;
562 spec->recording = 0;
572 struct conexant_spec *spec = codec->spec;
573 ucontrol->value.integer.value[0] = spec->dc_enable;
581 struct conexant_spec *spec = codec->spec;
584 if (dc_enable == spec->dc_enable)
587 spec->dc_enable = dc_enable;
597 struct conexant_spec *spec = codec->spec;
598 ucontrol->value.enumerated.item[0] = spec->dc_input_bias;
612 struct conexant_spec *spec = codec->spec;
619 if (spec->dc_input_bias == idx)
622 spec->dc_input_bias = idx;
623 if (spec->dc_enable)
653 struct conexant_spec *spec = codec->spec;
655 if (ret > 0 && spec->dc_enable)
663 struct conexant_spec *spec = codec->spec;
670 spec->gen.mic_autoswitch_hook = olpc_xo_automic;
671 spec->gen.pcm_capture_hook = olpc_xo_capture_hook;
672 spec->dc_mode_path = snd_hda_add_new_path(codec, 0x1e, 0x14, 0);
683 snd_array_for_each(&spec->gen.kctls, i, kctl) {
694 struct conexant_spec *spec = codec->spec;
697 spec->mute_led_eapd = 0x1b;
698 spec->dynamic_eapd = true;
746 struct conexant_spec *spec = codec->spec;
747 unsigned int oldval = spec->gpio_led;
749 if (spec->mute_led_polarity)
753 spec->gpio_led |= mask;
755 spec->gpio_led &= ~mask;
757 mask, led_on, spec->gpio_led);
758 if (spec->gpio_led != oldval)
760 spec->gpio_led);
768 struct conexant_spec *spec = codec->spec;
770 cxt_update_gpio_led(codec, spec->gpio_mute_led_mask, brightness);
779 struct conexant_spec *spec = codec->spec;
781 cxt_update_gpio_led(codec, spec->gpio_mic_led_mask, brightness);
788 struct conexant_spec *spec = codec->spec;
790 spec->gpio_led = 0;
791 spec->mute_led_polarity = 0;
794 spec->gpio_mute_led_mask = mute;
798 spec->gpio_mic_led_mask = mic_mute;
1138 struct conexant_spec *spec = codec->spec;
1148 spec->gen.dac_min_mute = true;
1153 struct conexant_spec *spec;
1158 spec = kzalloc(sizeof(*spec), GFP_KERNEL);
1159 if (!spec)
1161 snd_hda_gen_spec_init(&spec->gen);
1162 codec->spec = spec;
1169 spec->is_cx8070_sn6140 = true;
1170 spec->headset_present_flag = CX_HEADSET_NOPRESENT;
1175 spec->gen.own_eapd_ctl = 1;
1180 spec->gen.mixer_nid = 0x17;
1181 spec->gen.add_stereo_mix_input = HDA_HINT_STEREO_MIX_AUTO;
1187 spec->gen.mixer_nid = 0x19;
1188 spec->gen.add_stereo_mix_input = HDA_HINT_STEREO_MIX_AUTO;
1200 spec->gen.mixer_nid = 0x22;
1201 spec->gen.add_stereo_mix_input = HDA_HINT_STEREO_MIX_AUTO;
1215 if (!spec->gen.vmaster_mute.hook && spec->dynamic_eapd)
1216 spec->gen.vmaster_mute.hook = cx_auto_vmaster_hook;
1220 err = snd_hda_parse_pin_defcfg(codec, &spec->gen.autocfg, NULL,
1221 spec->parse_flags);
1229 err = snd_hda_gen_parse_auto_config(codec, &spec->gen.autocfg);