Lines Matching +full:codec +full:- +full:1

1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * Universal Interface for Intel High Definition Audio Codec
59 STAC_92HD73XX_NO_JD, /* no jack-detection */
149 STAC_D965_REF_NO_JD, /* no jack-detection */
173 unsigned int eapd_switch: 1;
174 unsigned int linear_tone_beep:1;
175 unsigned int headset_jack:1; /* 4-pin headset jack (hp + mono mic) */
176 unsigned int volknob_init:1; /* special volume-knob initialization */
177 unsigned int powerdown_adcs:1;
178 unsigned int have_spdif_mux:1;
188 unsigned int vref_mute_led_nid; /* pin NID for mute-LED vref control */
214 /* SPDIF-out mux */
242 struct hda_codec *codec, in stac_playback_pcm_hook() argument
246 struct sigmatel_spec *spec = codec->spec; in stac_playback_pcm_hook()
247 if (action == HDA_GEN_PCM_ACT_OPEN && spec->stream_delay) in stac_playback_pcm_hook()
248 msleep(spec->stream_delay); in stac_playback_pcm_hook()
252 struct hda_codec *codec, in stac_capture_pcm_hook() argument
256 struct sigmatel_spec *spec = codec->spec; in stac_capture_pcm_hook()
259 if (!spec->powerdown_adcs) in stac_capture_pcm_hook()
262 for (i = 0; i < spec->gen.num_all_adcs; i++) { in stac_capture_pcm_hook()
263 if (spec->gen.all_adcs[i] == hinfo->nid) { in stac_capture_pcm_hook()
272 snd_hda_codec_write(codec, hinfo->nid, 0, in stac_capture_pcm_hook()
274 spec->active_adcs |= (1 << idx); in stac_capture_pcm_hook()
277 snd_hda_codec_write(codec, hinfo->nid, 0, in stac_capture_pcm_hook()
279 spec->active_adcs &= ~(1 << idx); in stac_capture_pcm_hook()
289 static void stac_gpio_set(struct hda_codec *codec, unsigned int mask, in stac_gpio_set() argument
293 hda_nid_t fg = codec->core.afg; in stac_gpio_set()
295 codec_dbg(codec, "%s msk %x dir %x gpio %x\n", __func__, mask, dir_mask, data); in stac_gpio_set()
297 gpiostate = snd_hda_codec_read(codec, fg, 0, in stac_gpio_set()
301 gpiomask = snd_hda_codec_read(codec, fg, 0, in stac_gpio_set()
305 gpiodir = snd_hda_codec_read(codec, fg, 0, in stac_gpio_set()
310 snd_hda_codec_write(codec, fg, 0, 0x7e7, 0); in stac_gpio_set()
312 snd_hda_codec_write(codec, fg, 0, in stac_gpio_set()
314 snd_hda_codec_read(codec, fg, 0, in stac_gpio_set()
317 msleep(1); in stac_gpio_set()
319 snd_hda_codec_read(codec, fg, 0, in stac_gpio_set()
323 /* hook for controlling mic-mute LED GPIO */
327 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent); in stac_capture_led_update() local
328 struct sigmatel_spec *spec = codec->spec; in stac_capture_led_update()
331 spec->gpio_data |= spec->mic_mute_led_gpio; in stac_capture_led_update()
333 spec->gpio_data &= ~spec->mic_mute_led_gpio; in stac_capture_led_update()
334 stac_gpio_set(codec, spec->gpio_mask, spec->gpio_dir, spec->gpio_data); in stac_capture_led_update()
338 static int stac_vrefout_set(struct hda_codec *codec, in stac_vrefout_set() argument
343 codec_dbg(codec, "%s, nid %x ctl %x\n", __func__, nid, new_vref); in stac_vrefout_set()
344 pinctl = snd_hda_codec_read(codec, nid, 0, in stac_vrefout_set()
354 error = snd_hda_set_pin_ctl_cache(codec, nid, pinctl); in stac_vrefout_set()
358 return 1; in stac_vrefout_set()
361 /* prevent codec AFG to D3 state when vref-out pin is used for mute LED */
363 static unsigned int stac_vref_led_power_filter(struct hda_codec *codec, in stac_vref_led_power_filter() argument
367 if (nid == codec->core.afg && power_state == AC_PWRST_D3) in stac_vref_led_power_filter()
369 return snd_hda_gen_path_power_filter(codec, nid, power_state); in stac_vref_led_power_filter()
372 /* update mute-LED accoring to the master switch */
373 static void stac_update_led_status(struct hda_codec *codec, bool muted) in stac_update_led_status() argument
375 struct sigmatel_spec *spec = codec->spec; in stac_update_led_status()
377 if (!spec->gpio_led) in stac_update_led_status()
381 if (spec->gpio_led_polarity) in stac_update_led_status()
384 if (!spec->vref_mute_led_nid) { in stac_update_led_status()
386 spec->gpio_data |= spec->gpio_led; in stac_update_led_status()
388 spec->gpio_data &= ~spec->gpio_led; in stac_update_led_status()
389 stac_gpio_set(codec, spec->gpio_mask, in stac_update_led_status()
390 spec->gpio_dir, spec->gpio_data); in stac_update_led_status()
392 spec->vref_led = muted ? AC_PINCTL_VREF_50 : AC_PINCTL_VREF_GRD; in stac_update_led_status()
393 stac_vrefout_set(codec, spec->vref_mute_led_nid, in stac_update_led_status()
394 spec->vref_led); in stac_update_led_status()
402 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent); in stac_vmaster_hook() local
404 stac_update_led_status(codec, brightness); in stac_vmaster_hook()
409 static void stac_update_outputs(struct hda_codec *codec) in stac_update_outputs() argument
411 struct sigmatel_spec *spec = codec->spec; in stac_update_outputs()
413 if (spec->gpio_mute) in stac_update_outputs()
414 spec->gen.master_mute = in stac_update_outputs()
415 !(snd_hda_codec_read(codec, codec->core.afg, 0, in stac_update_outputs()
416 AC_VERB_GET_GPIO_DATA, 0) & spec->gpio_mute); in stac_update_outputs()
418 snd_hda_gen_update_outputs(codec); in stac_update_outputs()
420 if (spec->eapd_mask && spec->eapd_switch) { in stac_update_outputs()
421 unsigned int val = spec->gpio_data; in stac_update_outputs()
422 if (spec->gen.speaker_muted) in stac_update_outputs()
423 val &= ~spec->eapd_mask; in stac_update_outputs()
425 val |= spec->eapd_mask; in stac_update_outputs()
426 if (spec->gpio_data != val) { in stac_update_outputs()
427 spec->gpio_data = val; in stac_update_outputs()
428 stac_gpio_set(codec, spec->gpio_mask, spec->gpio_dir, in stac_update_outputs()
434 static void stac_toggle_power_map(struct hda_codec *codec, hda_nid_t nid, in stac_toggle_power_map() argument
437 struct sigmatel_spec *spec = codec->spec; in stac_toggle_power_map()
440 for (idx = 0; idx < spec->num_pwrs; idx++) { in stac_toggle_power_map()
441 if (spec->pwr_nids[idx] == nid) in stac_toggle_power_map()
444 if (idx >= spec->num_pwrs) in stac_toggle_power_map()
447 idx = 1 << idx; in stac_toggle_power_map()
449 val = spec->power_map_bits; in stac_toggle_power_map()
456 if (val != spec->power_map_bits) { in stac_toggle_power_map()
457 spec->power_map_bits = val; in stac_toggle_power_map()
459 snd_hda_codec_write(codec, codec->core.afg, 0, in stac_toggle_power_map()
465 static void jack_update_power(struct hda_codec *codec, in jack_update_power() argument
468 struct sigmatel_spec *spec = codec->spec; in jack_update_power()
471 if (!spec->num_pwrs) in jack_update_power()
474 if (jack && jack->nid) { in jack_update_power()
475 stac_toggle_power_map(codec, jack->nid, in jack_update_power()
476 snd_hda_jack_detect(codec, jack->nid), in jack_update_power()
482 for (i = 0; i < spec->num_pwrs; i++) { in jack_update_power()
483 hda_nid_t nid = spec->pwr_nids[i]; in jack_update_power()
484 if (!snd_hda_jack_tbl_get(codec, nid)) in jack_update_power()
486 stac_toggle_power_map(codec, nid, in jack_update_power()
487 snd_hda_jack_detect(codec, nid), in jack_update_power()
491 snd_hda_codec_write(codec, codec->core.afg, 0, in jack_update_power()
493 spec->power_map_bits); in jack_update_power()
496 static void stac_vref_event(struct hda_codec *codec, in stac_vref_event() argument
501 data = snd_hda_codec_read(codec, codec->core.afg, 0, in stac_vref_event()
504 snd_hda_codec_write(codec, codec->core.afg, 0, 0x7e0, in stac_vref_event()
505 !!(data & (1 << event->private_data))); in stac_vref_event()
511 static void stac_init_power_map(struct hda_codec *codec) in stac_init_power_map() argument
513 struct sigmatel_spec *spec = codec->spec; in stac_init_power_map()
516 for (i = 0; i < spec->num_pwrs; i++) { in stac_init_power_map()
517 hda_nid_t nid = spec->pwr_nids[i]; in stac_init_power_map()
518 unsigned int def_conf = snd_hda_codec_get_pincfg(codec, nid); in stac_init_power_map()
521 spec->vref_mute_led_nid != nid && in stac_init_power_map()
522 is_jack_detectable(codec, nid)) { in stac_init_power_map()
523 snd_hda_jack_detect_enable_callback(codec, nid, in stac_init_power_map()
527 stac_toggle_power_map(codec, nid, false, false); in stac_init_power_map()
529 stac_toggle_power_map(codec, nid, true, false); in stac_init_power_map()
537 static inline bool get_int_hint(struct hda_codec *codec, const char *key, in get_int_hint() argument
540 return !snd_hda_get_int_hint(codec, key, valp); in get_int_hint()
544 static void stac_store_hints(struct hda_codec *codec) in stac_store_hints() argument
546 struct sigmatel_spec *spec = codec->spec; in stac_store_hints()
549 if (get_int_hint(codec, "gpio_mask", &spec->gpio_mask)) { in stac_store_hints()
550 spec->eapd_mask = spec->gpio_dir = spec->gpio_data = in stac_store_hints()
551 spec->gpio_mask; in stac_store_hints()
553 if (get_int_hint(codec, "gpio_dir", &spec->gpio_dir)) in stac_store_hints()
554 spec->gpio_dir &= spec->gpio_mask; in stac_store_hints()
555 if (get_int_hint(codec, "gpio_data", &spec->gpio_data)) in stac_store_hints()
556 spec->gpio_data &= spec->gpio_mask; in stac_store_hints()
557 if (get_int_hint(codec, "eapd_mask", &spec->eapd_mask)) in stac_store_hints()
558 spec->eapd_mask &= spec->gpio_mask; in stac_store_hints()
559 if (get_int_hint(codec, "gpio_mute", &spec->gpio_mute)) in stac_store_hints()
560 spec->gpio_mute &= spec->gpio_mask; in stac_store_hints()
561 val = snd_hda_get_bool_hint(codec, "eapd_switch"); in stac_store_hints()
563 spec->eapd_switch = val; in stac_store_hints()
575 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); in stac_aloopback_get() local
576 unsigned int idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); in stac_aloopback_get()
577 struct sigmatel_spec *spec = codec->spec; in stac_aloopback_get()
579 ucontrol->value.integer.value[0] = !!(spec->aloopback & in stac_aloopback_get()
580 (spec->aloopback_mask << idx)); in stac_aloopback_get()
587 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); in stac_aloopback_put() local
588 struct sigmatel_spec *spec = codec->spec; in stac_aloopback_put()
589 unsigned int idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); in stac_aloopback_put()
593 idx_val = spec->aloopback_mask << idx; in stac_aloopback_put()
594 if (ucontrol->value.integer.value[0]) in stac_aloopback_put()
595 val = spec->aloopback | idx_val; in stac_aloopback_put()
597 val = spec->aloopback & ~idx_val; in stac_aloopback_put()
598 if (spec->aloopback == val) in stac_aloopback_put()
601 spec->aloopback = val; in stac_aloopback_put()
606 dac_mode = snd_hda_codec_read(codec, codec->core.afg, 0, in stac_aloopback_put()
607 kcontrol->private_value & 0xFFFF, 0x0); in stac_aloopback_put()
608 dac_mode >>= spec->aloopback_shift; in stac_aloopback_put()
610 if (spec->aloopback & idx_val) { in stac_aloopback_put()
611 snd_hda_power_up(codec); in stac_aloopback_put()
614 snd_hda_power_down(codec); in stac_aloopback_put()
618 snd_hda_codec_write_cache(codec, codec->core.afg, 0, in stac_aloopback_put()
619 kcontrol->private_value >> 16, dac_mode); in stac_aloopback_put()
621 return 1; in stac_aloopback_put()
640 static bool hp_bnb2011_with_dock(struct hda_codec *codec) in hp_bnb2011_with_dock() argument
642 if (codec->core.vendor_id != 0x111d7605 && in hp_bnb2011_with_dock()
643 codec->core.vendor_id != 0x111d76d1) in hp_bnb2011_with_dock()
646 switch (codec->core.subsystem_id) { in hp_bnb2011_with_dock()
710 static void set_hp_led_gpio(struct hda_codec *codec) in set_hp_led_gpio() argument
712 struct sigmatel_spec *spec = codec->spec; in set_hp_led_gpio()
715 if (spec->gpio_led) in set_hp_led_gpio()
718 gpio = snd_hda_param_read(codec, codec->core.afg, AC_PAR_GPIO_CAP); in set_hp_led_gpio()
721 spec->gpio_led = 0x08; /* GPIO 3 */ in set_hp_led_gpio()
723 spec->gpio_led = 0x01; /* GPIO 0 */ in set_hp_led_gpio()
730 * where P can be 0 or 1 and defines mute LED GPIO control state (low/high)
733 * If _G portion is missing it is assigned based on the codec ID
735 * So, HP B-series like systems may have HP_Mute_LED_0 (current models)
739 * The dv-series laptops don't seem to have the HP_Mute_LED* strings in
740 * SMBIOS - at least the ones I have seen do not have them - which include
741 * my own system (HP Pavilion dv6-1110ax) and my cousin's
744 * -- kunal
746 static int find_mute_led_cfg(struct hda_codec *codec, int default_polarity) in find_mute_led_cfg() argument
748 struct sigmatel_spec *spec = codec->spec; in find_mute_led_cfg()
751 if (get_int_hint(codec, "gpio_led", &spec->gpio_led)) { in find_mute_led_cfg()
752 get_int_hint(codec, "gpio_led_polarity", in find_mute_led_cfg()
753 &spec->gpio_led_polarity); in find_mute_led_cfg()
754 return 1; in find_mute_led_cfg()
758 if (sscanf(dev->name, "HP_Mute_LED_%u_%x", in find_mute_led_cfg()
759 &spec->gpio_led_polarity, in find_mute_led_cfg()
760 &spec->gpio_led) == 2) { in find_mute_led_cfg()
762 max_gpio = snd_hda_param_read(codec, codec->core.afg, in find_mute_led_cfg()
765 if (spec->gpio_led < max_gpio) in find_mute_led_cfg()
766 spec->gpio_led = 1 << spec->gpio_led; in find_mute_led_cfg()
768 spec->vref_mute_led_nid = spec->gpio_led; in find_mute_led_cfg()
769 return 1; in find_mute_led_cfg()
771 if (sscanf(dev->name, "HP_Mute_LED_%u", in find_mute_led_cfg()
772 &spec->gpio_led_polarity) == 1) { in find_mute_led_cfg()
773 set_hp_led_gpio(codec); in find_mute_led_cfg()
774 return 1; in find_mute_led_cfg()
777 if (strstr(dev->name, "HP_Mute_LED_P_G")) { in find_mute_led_cfg()
778 set_hp_led_gpio(codec); in find_mute_led_cfg()
780 spec->gpio_led_polarity = default_polarity; in find_mute_led_cfg()
782 spec->gpio_led_polarity = 1; in find_mute_led_cfg()
783 return 1; in find_mute_led_cfg()
788 * Fallback case - if we don't find the DMI strings, in find_mute_led_cfg()
789 * we statically set the GPIO - if not a B-series system in find_mute_led_cfg()
792 if (!hp_blike_system(codec->core.subsystem_id) && in find_mute_led_cfg()
793 (default_polarity == 0 || default_polarity == 1)) { in find_mute_led_cfg()
794 set_hp_led_gpio(codec); in find_mute_led_cfg()
795 spec->gpio_led_polarity = default_polarity; in find_mute_led_cfg()
796 return 1; in find_mute_led_cfg()
801 /* check whether a built-in speaker is included in parsed pins */
802 static bool has_builtin_speaker(struct hda_codec *codec) in has_builtin_speaker() argument
804 struct sigmatel_spec *spec = codec->spec; in has_builtin_speaker()
808 if (spec->gen.autocfg.line_out_type == AUTO_PIN_SPEAKER_OUT) { in has_builtin_speaker()
809 nid_pin = spec->gen.autocfg.line_out_pins; in has_builtin_speaker()
810 nids = spec->gen.autocfg.line_outs; in has_builtin_speaker()
812 nid_pin = spec->gen.autocfg.speaker_pins; in has_builtin_speaker()
813 nids = spec->gen.autocfg.speaker_outs; in has_builtin_speaker()
817 unsigned int def_conf = snd_hda_codec_get_pincfg(codec, nid_pin[i]); in has_builtin_speaker()
829 static int stac_auto_create_beep_ctls(struct hda_codec *codec, in stac_auto_create_beep_ctls() argument
832 struct sigmatel_spec *spec = codec->spec; in stac_auto_create_beep_ctls()
833 u32 caps = query_amp_caps(codec, nid, HDA_OUTPUT); in stac_auto_create_beep_ctls()
845 if (spec->anabeep_nid == nid) in stac_auto_create_beep_ctls()
849 knew = snd_hda_gen_add_kctl(&spec->gen, in stac_auto_create_beep_ctls()
852 return -ENOMEM; in stac_auto_create_beep_ctls()
853 knew->private_value = in stac_auto_create_beep_ctls()
854 HDA_COMPOSE_AMP_VAL(nid, 1, 0, HDA_OUTPUT); in stac_auto_create_beep_ctls()
859 knew = snd_hda_gen_add_kctl(&spec->gen, in stac_auto_create_beep_ctls()
863 return -ENOMEM; in stac_auto_create_beep_ctls()
864 knew->private_value = in stac_auto_create_beep_ctls()
865 HDA_COMPOSE_AMP_VAL(nid, 1, 0, HDA_OUTPUT); in stac_auto_create_beep_ctls()
876 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); in stac_dig_beep_switch_get() local
877 ucontrol->value.integer.value[0] = codec->beep->enabled; in stac_dig_beep_switch_get()
884 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); in stac_dig_beep_switch_put() local
885 return snd_hda_enable_beep_device(codec, ucontrol->value.integer.value[0]); in stac_dig_beep_switch_put()
896 static int stac_beep_switch_ctl(struct hda_codec *codec) in stac_beep_switch_ctl() argument
898 struct sigmatel_spec *spec = codec->spec; in stac_beep_switch_ctl()
900 if (!snd_hda_gen_add_kctl(&spec->gen, NULL, &stac_dig_beep_ctrl)) in stac_beep_switch_ctl()
901 return -ENOMEM; in stac_beep_switch_ctl()
907 * SPDIF-out mux controls
913 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); in stac_smux_enum_info() local
914 struct sigmatel_spec *spec = codec->spec; in stac_smux_enum_info()
915 return snd_hda_input_mux_info(&spec->spdif_mux, uinfo); in stac_smux_enum_info()
921 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); in stac_smux_enum_get() local
922 struct sigmatel_spec *spec = codec->spec; in stac_smux_enum_get()
923 unsigned int smux_idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); in stac_smux_enum_get()
925 ucontrol->value.enumerated.item[0] = spec->cur_smux[smux_idx]; in stac_smux_enum_get()
932 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); in stac_smux_enum_put() local
933 struct sigmatel_spec *spec = codec->spec; in stac_smux_enum_put()
934 unsigned int smux_idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); in stac_smux_enum_put()
936 return snd_hda_input_mux_put(codec, &spec->spdif_mux, ucontrol, in stac_smux_enum_put()
937 spec->gen.autocfg.dig_out_pins[smux_idx], in stac_smux_enum_put()
938 &spec->cur_smux[smux_idx]); in stac_smux_enum_put()
951 "Digital Playback", "Analog Mux 1", "Analog Mux 2", NULL
954 static int stac_create_spdif_mux_ctls(struct hda_codec *codec) in stac_create_spdif_mux_ctls() argument
956 struct sigmatel_spec *spec = codec->spec; in stac_create_spdif_mux_ctls()
957 struct auto_pin_cfg *cfg = &spec->gen.autocfg; in stac_create_spdif_mux_ctls()
958 const char * const *labels = spec->spdif_labels; in stac_create_spdif_mux_ctls()
962 if (cfg->dig_outs < 1) in stac_create_spdif_mux_ctls()
965 num_cons = snd_hda_get_num_conns(codec, cfg->dig_out_pins[0]); in stac_create_spdif_mux_ctls()
966 if (num_cons <= 1) in stac_create_spdif_mux_ctls()
973 return -EINVAL; in stac_create_spdif_mux_ctls()
974 snd_hda_add_imux_item(codec, &spec->spdif_mux, labels[i], i, NULL); in stac_create_spdif_mux_ctls()
977 kctl = snd_hda_gen_add_kctl(&spec->gen, NULL, &stac_smux_mixer); in stac_create_spdif_mux_ctls()
979 return -ENOMEM; in stac_create_spdif_mux_ctls()
980 kctl->count = cfg->dig_outs; in stac_create_spdif_mux_ctls()
1007 { 0x01, AC_VERB_SET_EAPD, 1 << 2},
1065 { 0x01, AC_VERB_SET_DIGI_CONVERT_2, 1 << 5},
1073 {0x01, AC_VERB_SET_DIGI_CONVERT_2, 1 << 5},
1081 { 0x01, AC_VERB_SET_DIGI_CONVERT_2, 1 << 5},
1098 STAC_ANALOG_LOOPBACK(0xFE0, 0x7E0, 1);
1101 STAC_ANALOG_LOOPBACK(0xFEB, 0x7EB, 1);
1197 STAC 9200-32 pin configs for
1214 STAC 9200-32 pin configs for
1234 STAC 9200-32 pin configs for
1251 STAC 9200-32 pin configs for
1270 STAC 9200-32 pin configs for
1288 STAC 9200-32 pin configs for
1305 STAC 9200-32
1354 static void stac9200_fixup_panasonic(struct hda_codec *codec, in stac9200_fixup_panasonic() argument
1357 struct sigmatel_spec *spec = codec->spec; in stac9200_fixup_panasonic()
1360 spec->gpio_mask = spec->gpio_dir = 0x09; in stac9200_fixup_panasonic()
1361 spec->gpio_data = 0x00; in stac9200_fixup_panasonic()
1362 /* CF-74 has no headphone detection, and the driver should *NOT* in stac9200_fixup_panasonic()
1365 spec->gen.suppress_auto_mute = 1; in stac9200_fixup_panasonic()
1449 { .id = STAC_9200_DELL_D21, .name = "dell-d21" },
1450 { .id = STAC_9200_DELL_D22, .name = "dell-d22" },
1451 { .id = STAC_9200_DELL_D23, .name = "dell-d23" },
1452 { .id = STAC_9200_DELL_M21, .name = "dell-m21" },
1453 { .id = STAC_9200_DELL_M22, .name = "dell-m22" },
1454 { .id = STAC_9200_DELL_M23, .name = "dell-m23" },
1455 { .id = STAC_9200_DELL_M24, .name = "dell-m24" },
1456 { .id = STAC_9200_DELL_M25, .name = "dell-m25" },
1457 { .id = STAC_9200_DELL_M26, .name = "dell-m26" },
1458 { .id = STAC_9200_DELL_M27, .name = "dell-m27" },
1459 { .id = STAC_9200_M4, .name = "gateway-m4" },
1460 { .id = STAC_9200_M4_2, .name = "gateway-m4-2" },
1533 SND_PCI_QUIRK(0x10f7, 0x8338, "Panasonic CF-74", STAC_9200_PANASONIC),
1535 SND_PCI_QUIRK(0x107b, 0x0205, "Gateway S-7110M", STAC_9200_M4),
1677 { .id = STAC_M1_2, .name = "m1-2" },
1679 { .id = STAC_M2_2, .name = "m2-2" },
1695 /* gateway machines are checked via codec ssid */
1782 static void stac92hd73xx_fixup_ref(struct hda_codec *codec, in stac92hd73xx_fixup_ref() argument
1785 struct sigmatel_spec *spec = codec->spec; in stac92hd73xx_fixup_ref()
1790 snd_hda_apply_pincfgs(codec, ref92hd73xx_pin_configs); in stac92hd73xx_fixup_ref()
1791 spec->gpio_mask = spec->gpio_dir = spec->gpio_data = 0; in stac92hd73xx_fixup_ref()
1794 static void stac92hd73xx_fixup_dell(struct hda_codec *codec) in stac92hd73xx_fixup_dell() argument
1796 struct sigmatel_spec *spec = codec->spec; in stac92hd73xx_fixup_dell()
1798 snd_hda_apply_pincfgs(codec, dell_m6_pin_configs); in stac92hd73xx_fixup_dell()
1799 spec->eapd_switch = 0; in stac92hd73xx_fixup_dell()
1802 static void stac92hd73xx_fixup_dell_eq(struct hda_codec *codec, in stac92hd73xx_fixup_dell_eq() argument
1805 struct sigmatel_spec *spec = codec->spec; in stac92hd73xx_fixup_dell_eq()
1810 stac92hd73xx_fixup_dell(codec); in stac92hd73xx_fixup_dell_eq()
1811 snd_hda_add_verbs(codec, dell_eq_core_init); in stac92hd73xx_fixup_dell_eq()
1812 spec->volknob_init = 1; in stac92hd73xx_fixup_dell_eq()
1816 static void stac92hd73xx_fixup_dell_m6_amic(struct hda_codec *codec, in stac92hd73xx_fixup_dell_m6_amic() argument
1822 stac92hd73xx_fixup_dell(codec); in stac92hd73xx_fixup_dell_m6_amic()
1823 snd_hda_codec_set_pincfg(codec, 0x0b, 0x90A70170); in stac92hd73xx_fixup_dell_m6_amic()
1827 static void stac92hd73xx_fixup_dell_m6_dmic(struct hda_codec *codec, in stac92hd73xx_fixup_dell_m6_dmic() argument
1833 stac92hd73xx_fixup_dell(codec); in stac92hd73xx_fixup_dell_m6_dmic()
1834 snd_hda_codec_set_pincfg(codec, 0x13, 0x90A60160); in stac92hd73xx_fixup_dell_m6_dmic()
1838 static void stac92hd73xx_fixup_dell_m6_both(struct hda_codec *codec, in stac92hd73xx_fixup_dell_m6_both() argument
1844 stac92hd73xx_fixup_dell(codec); in stac92hd73xx_fixup_dell_m6_both()
1845 snd_hda_codec_set_pincfg(codec, 0x0b, 0x90A70170); in stac92hd73xx_fixup_dell_m6_both()
1846 snd_hda_codec_set_pincfg(codec, 0x13, 0x90A60160); in stac92hd73xx_fixup_dell_m6_both()
1849 static void stac92hd73xx_fixup_alienware_m17x(struct hda_codec *codec, in stac92hd73xx_fixup_alienware_m17x() argument
1852 struct sigmatel_spec *spec = codec->spec; in stac92hd73xx_fixup_alienware_m17x()
1857 snd_hda_apply_pincfgs(codec, alienware_m17x_pin_configs); in stac92hd73xx_fixup_alienware_m17x()
1858 spec->eapd_switch = 0; in stac92hd73xx_fixup_alienware_m17x()
1861 static void stac92hd73xx_fixup_no_jd(struct hda_codec *codec, in stac92hd73xx_fixup_no_jd() argument
1865 codec->no_jack_detect = 1; in stac92hd73xx_fixup_no_jd()
1869 static void stac92hd73xx_disable_automute(struct hda_codec *codec, in stac92hd73xx_disable_automute() argument
1872 struct sigmatel_spec *spec = codec->spec; in stac92hd73xx_disable_automute()
1877 spec->gen.suppress_auto_mute = 1; in stac92hd73xx_disable_automute()
1939 { .id = STAC_92HD73XX_NO_JD, .name = "no-jd" },
1942 { .id = STAC_DELL_M6_AMIC, .name = "dell-m6-amic" },
1943 { .id = STAC_DELL_M6_DMIC, .name = "dell-m6-dmic" },
1944 { .id = STAC_DELL_M6_BOTH, .name = "dell-m6" },
1945 { .id = STAC_DELL_EQ, .name = "dell-eq" },
1947 { .id = STAC_ELO_VUPOINT_15MX, .name = "elo-vupoint-15mx" },
1948 { .id = STAC_92HD73XX_ASUS_MOBO, .name = "asus-mobo" },
1990 /* codec SSID matching */
2090 static void stac92hd83xxx_fixup_hp(struct hda_codec *codec, in stac92hd83xxx_fixup_hp() argument
2093 struct sigmatel_spec *spec = codec->spec; in stac92hd83xxx_fixup_hp()
2098 if (hp_bnb2011_with_dock(codec)) { in stac92hd83xxx_fixup_hp()
2099 snd_hda_codec_set_pincfg(codec, 0xa, 0x2101201f); in stac92hd83xxx_fixup_hp()
2100 snd_hda_codec_set_pincfg(codec, 0xf, 0x2181205e); in stac92hd83xxx_fixup_hp()
2103 if (find_mute_led_cfg(codec, spec->default_polarity)) in stac92hd83xxx_fixup_hp()
2104 codec_dbg(codec, "mute LED gpio %d polarity %d\n", in stac92hd83xxx_fixup_hp()
2105 spec->gpio_led, in stac92hd83xxx_fixup_hp()
2106 spec->gpio_led_polarity); in stac92hd83xxx_fixup_hp()
2108 /* allow auto-switching of dock line-in */ in stac92hd83xxx_fixup_hp()
2109 spec->gen.line_in_auto_switch = true; in stac92hd83xxx_fixup_hp()
2112 static void stac92hd83xxx_fixup_hp_zephyr(struct hda_codec *codec, in stac92hd83xxx_fixup_hp_zephyr() argument
2118 snd_hda_apply_pincfgs(codec, hp_zephyr_pin_configs); in stac92hd83xxx_fixup_hp_zephyr()
2119 snd_hda_add_verbs(codec, stac92hd83xxx_hp_zephyr_init); in stac92hd83xxx_fixup_hp_zephyr()
2122 static void stac92hd83xxx_fixup_hp_led(struct hda_codec *codec, in stac92hd83xxx_fixup_hp_led() argument
2125 struct sigmatel_spec *spec = codec->spec; in stac92hd83xxx_fixup_hp_led()
2128 spec->default_polarity = 0; in stac92hd83xxx_fixup_hp_led()
2131 static void stac92hd83xxx_fixup_hp_inv_led(struct hda_codec *codec, in stac92hd83xxx_fixup_hp_inv_led() argument
2134 struct sigmatel_spec *spec = codec->spec; in stac92hd83xxx_fixup_hp_inv_led()
2137 spec->default_polarity = 1; in stac92hd83xxx_fixup_hp_inv_led()
2140 static void stac92hd83xxx_fixup_hp_mic_led(struct hda_codec *codec, in stac92hd83xxx_fixup_hp_mic_led() argument
2143 struct sigmatel_spec *spec = codec->spec; in stac92hd83xxx_fixup_hp_mic_led()
2146 spec->mic_mute_led_gpio = 0x08; /* GPIO3 */ in stac92hd83xxx_fixup_hp_mic_led()
2149 codec->core.power_caps &= ~AC_PWRST_CLKSTOP; in stac92hd83xxx_fixup_hp_mic_led()
2154 static void stac92hd83xxx_fixup_hp_led_gpio10(struct hda_codec *codec, in stac92hd83xxx_fixup_hp_led_gpio10() argument
2157 struct sigmatel_spec *spec = codec->spec; in stac92hd83xxx_fixup_hp_led_gpio10()
2160 spec->gpio_led = 0x10; /* GPIO4 */ in stac92hd83xxx_fixup_hp_led_gpio10()
2161 spec->default_polarity = 0; in stac92hd83xxx_fixup_hp_led_gpio10()
2165 static void stac92hd83xxx_fixup_headset_jack(struct hda_codec *codec, in stac92hd83xxx_fixup_headset_jack() argument
2168 struct sigmatel_spec *spec = codec->spec; in stac92hd83xxx_fixup_headset_jack()
2171 spec->headset_jack = 1; in stac92hd83xxx_fixup_headset_jack()
2174 static void stac92hd83xxx_fixup_gpio10_eapd(struct hda_codec *codec, in stac92hd83xxx_fixup_gpio10_eapd() argument
2178 struct sigmatel_spec *spec = codec->spec; in stac92hd83xxx_fixup_gpio10_eapd()
2182 spec->eapd_mask = spec->gpio_mask = spec->gpio_dir = in stac92hd83xxx_fixup_gpio10_eapd()
2183 spec->gpio_data = 0x10; in stac92hd83xxx_fixup_gpio10_eapd()
2184 spec->eapd_switch = 0; in stac92hd83xxx_fixup_gpio10_eapd()
2187 static void hp_envy_ts_fixup_dac_bind(struct hda_codec *codec, in hp_envy_ts_fixup_dac_bind() argument
2191 struct sigmatel_spec *spec = codec->spec; in hp_envy_ts_fixup_dac_bind()
2200 spec->gen.preferred_dacs = preferred_pairs; in hp_envy_ts_fixup_dac_bind()
2732 { .id = STAC_92HD83XXX_PWR_REF, .name = "mic-ref" },
2733 { .id = STAC_DELL_S14, .name = "dell-s14" },
2734 { .id = STAC_DELL_VOSTRO_3500, .name = "dell-vostro-3500" },
2736 { .id = STAC_HP_DV7_4000, .name = "hp-dv7-4000" },
2737 { .id = STAC_HP_ZEPHYR, .name = "hp-zephyr" },
2738 { .id = STAC_92HD83XXX_HP_LED, .name = "hp-led" },
2739 { .id = STAC_92HD83XXX_HP_INV_LED, .name = "hp-inv-led" },
2740 { .id = STAC_92HD83XXX_HP_MIC_LED, .name = "hp-mic-led" },
2741 { .id = STAC_92HD83XXX_HEADSET_JACK, .name = "headset-jack" },
2742 { .id = STAC_HP_ENVY_BASS, .name = "hp-envy-bass" },
2743 { .id = STAC_HP_BNB13_EQ, .name = "hp-bnb13-eq" },
2744 { .id = STAC_HP_ENVY_TS_BASS, .name = "hp-envy-ts-bass" },
2941 /* HP dv7 bass switch - GPIO5 */
2946 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); in stac_hp_bass_gpio_get() local
2947 struct sigmatel_spec *spec = codec->spec; in stac_hp_bass_gpio_get()
2948 ucontrol->value.integer.value[0] = !!(spec->gpio_data & 0x20); in stac_hp_bass_gpio_get()
2955 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); in stac_hp_bass_gpio_put() local
2956 struct sigmatel_spec *spec = codec->spec; in stac_hp_bass_gpio_put()
2959 gpio_data = (spec->gpio_data & ~0x20) | in stac_hp_bass_gpio_put()
2960 (ucontrol->value.integer.value[0] ? 0x20 : 0); in stac_hp_bass_gpio_put()
2961 if (gpio_data == spec->gpio_data) in stac_hp_bass_gpio_put()
2963 spec->gpio_data = gpio_data; in stac_hp_bass_gpio_put()
2964 stac_gpio_set(codec, spec->gpio_mask, spec->gpio_dir, spec->gpio_data); in stac_hp_bass_gpio_put()
2965 return 1; in stac_hp_bass_gpio_put()
2975 static int stac_add_hp_bass_switch(struct hda_codec *codec) in stac_add_hp_bass_switch() argument
2977 struct sigmatel_spec *spec = codec->spec; in stac_add_hp_bass_switch()
2979 if (!snd_hda_gen_add_kctl(&spec->gen, "Bass Speaker Playback Switch", in stac_add_hp_bass_switch()
2981 return -ENOMEM; in stac_add_hp_bass_switch()
2983 spec->gpio_mask |= 0x20; in stac_add_hp_bass_switch()
2984 spec->gpio_dir |= 0x20; in stac_add_hp_bass_switch()
2985 spec->gpio_data |= 0x20; in stac_add_hp_bass_switch()
3049 static void stac92hd71bxx_fixup_ref(struct hda_codec *codec, in stac92hd71bxx_fixup_ref() argument
3052 struct sigmatel_spec *spec = codec->spec; in stac92hd71bxx_fixup_ref()
3057 snd_hda_apply_pincfgs(codec, ref92hd71bxx_pin_configs); in stac92hd71bxx_fixup_ref()
3058 spec->gpio_mask = spec->gpio_dir = spec->gpio_data = 0; in stac92hd71bxx_fixup_ref()
3061 static void stac92hd71bxx_fixup_hp_m4(struct hda_codec *codec, in stac92hd71bxx_fixup_hp_m4() argument
3064 struct sigmatel_spec *spec = codec->spec; in stac92hd71bxx_fixup_hp_m4()
3071 snd_hda_codec_write_cache(codec, codec->core.afg, 0, in stac92hd71bxx_fixup_hp_m4()
3073 jack = snd_hda_jack_detect_enable_callback(codec, codec->core.afg, in stac92hd71bxx_fixup_hp_m4()
3076 jack->private_data = 0x02; in stac92hd71bxx_fixup_hp_m4()
3078 spec->gpio_mask |= 0x02; in stac92hd71bxx_fixup_hp_m4()
3081 snd_hda_codec_set_pincfg(codec, 0x0e, 0x01813040); in stac92hd71bxx_fixup_hp_m4()
3084 static void stac92hd71bxx_fixup_hp_dv4(struct hda_codec *codec, in stac92hd71bxx_fixup_hp_dv4() argument
3087 struct sigmatel_spec *spec = codec->spec; in stac92hd71bxx_fixup_hp_dv4()
3091 spec->gpio_led = 0x01; in stac92hd71bxx_fixup_hp_dv4()
3094 static void stac92hd71bxx_fixup_hp_dv5(struct hda_codec *codec, in stac92hd71bxx_fixup_hp_dv5() argument
3101 snd_hda_codec_set_pincfg(codec, 0x0d, 0x90170010); in stac92hd71bxx_fixup_hp_dv5()
3106 cap = snd_hda_param_read(codec, 0x1, AC_PAR_GPIO_CAP); in stac92hd71bxx_fixup_hp_dv5()
3109 stac_add_hp_bass_switch(codec); in stac92hd71bxx_fixup_hp_dv5()
3114 static void stac92hd71bxx_fixup_hp_hdx(struct hda_codec *codec, in stac92hd71bxx_fixup_hp_hdx() argument
3117 struct sigmatel_spec *spec = codec->spec; in stac92hd71bxx_fixup_hp_hdx()
3121 spec->gpio_led = 0x08; in stac92hd71bxx_fixup_hp_hdx()
3124 static bool is_hp_output(struct hda_codec *codec, hda_nid_t pin) in is_hp_output() argument
3126 unsigned int pin_cfg = snd_hda_codec_get_pincfg(codec, pin); in is_hp_output()
3128 /* count line-out, too, as BIOS sets often so */ in is_hp_output()
3134 static void fixup_hp_headphone(struct hda_codec *codec, hda_nid_t pin) in fixup_hp_headphone() argument
3136 unsigned int pin_cfg = snd_hda_codec_get_pincfg(codec, pin); in fixup_hp_headphone()
3145 snd_hda_codec_set_pincfg(codec, pin, pin_cfg); in fixup_hp_headphone()
3148 static void stac92hd71bxx_fixup_hp(struct hda_codec *codec, in stac92hd71bxx_fixup_hp() argument
3151 struct sigmatel_spec *spec = codec->spec; in stac92hd71bxx_fixup_hp()
3157 * dock and built-in headphones; fix both pin configs in stac92hd71bxx_fixup_hp()
3159 if (is_hp_output(codec, 0x0a) && is_hp_output(codec, 0x0f)) { in stac92hd71bxx_fixup_hp()
3160 fixup_hp_headphone(codec, 0x0a); in stac92hd71bxx_fixup_hp()
3161 fixup_hp_headphone(codec, 0x0f); in stac92hd71bxx_fixup_hp()
3164 if (find_mute_led_cfg(codec, 1)) in stac92hd71bxx_fixup_hp()
3165 codec_dbg(codec, "mute LED gpio %d polarity %d\n", in stac92hd71bxx_fixup_hp()
3166 spec->gpio_led, in stac92hd71bxx_fixup_hp()
3167 spec->gpio_led_polarity); in stac92hd71bxx_fixup_hp()
3220 { .id = STAC_DELL_M4_1, .name = "dell-m4-1" },
3221 { .id = STAC_DELL_M4_2, .name = "dell-m4-2" },
3222 { .id = STAC_DELL_M4_3, .name = "dell-m4-3" },
3223 { .id = STAC_HP_M4, .name = "hp-m4" },
3224 { .id = STAC_HP_DV4, .name = "hp-dv4" },
3225 { .id = STAC_HP_DV5, .name = "hp-dv5" },
3226 { .id = STAC_HP_HDX, .name = "hp-hdx" },
3227 { .id = STAC_HP_DV4, .name = "hp-dv4-1222nr" },
3242 "HP dv4-7", STAC_HP_DV4),
3244 "HP dv4-7", STAC_HP_DV5),
3254 "HP dv6", STAC_HP_DV5), /* HP dv6-1110ax */
3490 /* codec SSIDs for Intel Mac sharing the same PCI SSID 8384:7680 */
3510 /* remap the fixup from codec SSID and apply it */
3511 static void stac922x_fixup_intel_mac_auto(struct hda_codec *codec, in stac922x_fixup_intel_mac_auto() argument
3518 codec->fixup_id = HDA_FIXUP_ID_NOT_SET; in stac922x_fixup_intel_mac_auto()
3519 snd_hda_pick_fixup(codec, NULL, stac922x_intel_mac_fixup_tbl, in stac922x_fixup_intel_mac_auto()
3521 if (codec->fixup_id != HDA_FIXUP_ID_NOT_SET) in stac922x_fixup_intel_mac_auto()
3522 snd_hda_apply_fixup(codec, action); in stac922x_fixup_intel_mac_auto()
3525 static void stac922x_fixup_intel_mac_gpio(struct hda_codec *codec, in stac922x_fixup_intel_mac_gpio() argument
3529 struct sigmatel_spec *spec = codec->spec; in stac922x_fixup_intel_mac_gpio()
3532 spec->gpio_mask = spec->gpio_dir = 0x03; in stac922x_fixup_intel_mac_gpio()
3533 spec->gpio_data = 0x03; in stac922x_fixup_intel_mac_gpio()
3614 { .id = STAC_INTEL_MAC_V1, .name = "intel-mac-v1" },
3615 { .id = STAC_INTEL_MAC_V2, .name = "intel-mac-v2" },
3616 { .id = STAC_INTEL_MAC_V3, .name = "intel-mac-v3" },
3617 { .id = STAC_INTEL_MAC_V4, .name = "intel-mac-v4" },
3618 { .id = STAC_INTEL_MAC_V5, .name = "intel-mac-v5" },
3619 { .id = STAC_INTEL_MAC_AUTO, .name = "intel-mac-auto" },
3621 { .id = STAC_922X_DELL_D81, .name = "dell-d81" },
3622 { .id = STAC_922X_DELL_D82, .name = "dell-d82" },
3623 { .id = STAC_922X_DELL_M81, .name = "dell-m81" },
3624 { .id = STAC_922X_DELL_M82, .name = "dell-m82" },
3628 { .id = STAC_INTEL_MAC_V3, .name = "macbook-pro-v1" },
3629 { .id = STAC_INTEL_MAC_V3, .name = "macbook-pro" },
3630 { .id = STAC_INTEL_MAC_V2, .name = "imac-intel" },
3631 { .id = STAC_INTEL_MAC_V3, .name = "imac-intel-20" },
3672 /* Intel D945G 5-stack systems */
3817 static void stac927x_fixup_ref_no_jd(struct hda_codec *codec, in stac927x_fixup_ref_no_jd() argument
3820 /* no jack detecion for ref-no-jd model */ in stac927x_fixup_ref_no_jd()
3822 codec->no_jack_detect = 1; in stac927x_fixup_ref_no_jd()
3825 static void stac927x_fixup_ref(struct hda_codec *codec, in stac927x_fixup_ref() argument
3828 struct sigmatel_spec *spec = codec->spec; in stac927x_fixup_ref()
3831 snd_hda_apply_pincfgs(codec, ref927x_pin_configs); in stac927x_fixup_ref()
3832 spec->eapd_mask = spec->gpio_mask = 0; in stac927x_fixup_ref()
3833 spec->gpio_dir = spec->gpio_data = 0; in stac927x_fixup_ref()
3837 static void stac927x_fixup_dell_dmic(struct hda_codec *codec, in stac927x_fixup_dell_dmic() argument
3840 struct sigmatel_spec *spec = codec->spec; in stac927x_fixup_dell_dmic()
3845 if (codec->core.subsystem_id != 0x1028022f) { in stac927x_fixup_dell_dmic()
3847 spec->eapd_mask = spec->gpio_mask = 0x04; in stac927x_fixup_dell_dmic()
3848 spec->gpio_dir = spec->gpio_data = 0x04; in stac927x_fixup_dell_dmic()
3851 snd_hda_add_verbs(codec, dell_3st_core_init); in stac927x_fixup_dell_dmic()
3852 spec->volknob_init = 1; in stac927x_fixup_dell_dmic()
3855 static void stac927x_fixup_volknob(struct hda_codec *codec, in stac927x_fixup_volknob() argument
3858 struct sigmatel_spec *spec = codec->spec; in stac927x_fixup_volknob()
3861 snd_hda_add_verbs(codec, stac927x_volknob_core_init); in stac927x_fixup_volknob()
3862 spec->volknob_init = 1; in stac927x_fixup_volknob()
3950 { .id = STAC_D965_REF_NO_JD, .name = "ref-no-jd" },
3954 { .id = STAC_D965_5ST_NO_FP, .name = "5stack-no-fp" },
3955 { .id = STAC_DELL_3ST, .name = "dell-3stack" },
3956 { .id = STAC_DELL_BIOS, .name = "dell-bios" },
3957 { .id = STAC_NEMO_DEFAULT, .name = "nemo-default" },
3958 { .id = STAC_DELL_BIOS_AMIC, .name = "dell-bios-amic" },
3998 /* volume-knob fixes */
4091 static void stac9205_fixup_ref(struct hda_codec *codec, in stac9205_fixup_ref() argument
4094 struct sigmatel_spec *spec = codec->spec; in stac9205_fixup_ref()
4097 snd_hda_apply_pincfgs(codec, ref9205_pin_configs); in stac9205_fixup_ref()
4098 /* SPDIF-In enabled */ in stac9205_fixup_ref()
4099 spec->eapd_mask = spec->gpio_mask = spec->gpio_dir = 0; in stac9205_fixup_ref()
4103 static void stac9205_fixup_dell_m43(struct hda_codec *codec, in stac9205_fixup_dell_m43() argument
4106 struct sigmatel_spec *spec = codec->spec; in stac9205_fixup_dell_m43()
4110 snd_hda_apply_pincfgs(codec, dell_9205_m43_pin_configs); in stac9205_fixup_dell_m43()
4113 snd_hda_codec_write_cache(codec, codec->core.afg, 0, in stac9205_fixup_dell_m43()
4115 jack = snd_hda_jack_detect_enable_callback(codec, codec->core.afg, in stac9205_fixup_dell_m43()
4118 jack->private_data = 0x01; in stac9205_fixup_dell_m43()
4120 spec->gpio_dir = 0x0b; in stac9205_fixup_dell_m43()
4121 spec->eapd_mask = 0x01; in stac9205_fixup_dell_m43()
4122 spec->gpio_mask = 0x1b; in stac9205_fixup_dell_m43()
4123 spec->gpio_mute = 0x10; in stac9205_fixup_dell_m43()
4127 spec->gpio_data = 0x01; in stac9205_fixup_dell_m43()
4131 static void stac9205_fixup_eapd(struct hda_codec *codec, in stac9205_fixup_eapd() argument
4134 struct sigmatel_spec *spec = codec->spec; in stac9205_fixup_eapd()
4137 spec->eapd_switch = 0; in stac9205_fixup_eapd()
4166 { .id = STAC_9205_DELL_M42, .name = "dell-m42" },
4167 { .id = STAC_9205_DELL_M43, .name = "dell-m43" },
4168 { .id = STAC_9205_DELL_M44, .name = "dell-m44" },
4220 static void stac92hd95_fixup_hp_led(struct hda_codec *codec, in stac92hd95_fixup_hp_led() argument
4223 struct sigmatel_spec *spec = codec->spec; in stac92hd95_fixup_hp_led()
4228 if (find_mute_led_cfg(codec, spec->default_polarity)) in stac92hd95_fixup_hp_led()
4229 codec_dbg(codec, "mute LED gpio %d polarity %d\n", in stac92hd95_fixup_hp_led()
4230 spec->gpio_led, in stac92hd95_fixup_hp_led()
4231 spec->gpio_led_polarity); in stac92hd95_fixup_hp_led()
4256 { .id = STAC_92HD95_HP_LED, .name = "hp-led" },
4257 { .id = STAC_92HD95_HP_BASS, .name = "hp-bass" },
4262 static int stac_parse_auto_config(struct hda_codec *codec) in stac_parse_auto_config() argument
4264 struct sigmatel_spec *spec = codec->spec; in stac_parse_auto_config()
4268 if (spec->headset_jack) in stac_parse_auto_config()
4271 err = snd_hda_parse_pin_defcfg(codec, &spec->gen.autocfg, NULL, flags); in stac_parse_auto_config()
4276 spec->gen.pcm_playback_hook = stac_playback_pcm_hook; in stac_parse_auto_config()
4277 spec->gen.pcm_capture_hook = stac_capture_pcm_hook; in stac_parse_auto_config()
4279 spec->gen.automute_hook = stac_update_outputs; in stac_parse_auto_config()
4281 err = snd_hda_gen_parse_auto_config(codec, &spec->gen.autocfg); in stac_parse_auto_config()
4285 if (spec->vref_mute_led_nid) { in stac_parse_auto_config()
4286 err = snd_hda_gen_fix_pin_power(codec, spec->vref_mute_led_nid); in stac_parse_auto_config()
4292 if (spec->anabeep_nid > 0) { in stac_parse_auto_config()
4293 err = stac_auto_create_beep_ctls(codec, in stac_parse_auto_config()
4294 spec->anabeep_nid); in stac_parse_auto_config()
4301 if (spec->gen.beep_nid) { in stac_parse_auto_config()
4302 hda_nid_t nid = spec->gen.beep_nid; in stac_parse_auto_config()
4305 err = stac_auto_create_beep_ctls(codec, nid); in stac_parse_auto_config()
4308 if (codec->beep) { in stac_parse_auto_config()
4310 codec->beep->linear_tone = spec->linear_tone_beep; in stac_parse_auto_config()
4312 codec->beep->keep_power_at_enable = 1; in stac_parse_auto_config()
4314 caps = query_amp_caps(codec, nid, HDA_OUTPUT); in stac_parse_auto_config()
4316 err = stac_beep_switch_ctl(codec); in stac_parse_auto_config()
4324 if (spec->gpio_led) in stac_parse_auto_config()
4325 snd_hda_gen_add_mute_led_cdev(codec, stac_vmaster_hook); in stac_parse_auto_config()
4327 if (spec->aloopback_ctl && in stac_parse_auto_config()
4328 snd_hda_get_bool_hint(codec, "loopback") == 1) { in stac_parse_auto_config()
4330 spec->aloopback_ctl->private_value >> 16; in stac_parse_auto_config()
4331 if (snd_hdac_regmap_add_vendor_verb(&codec->core, wr_verb)) in stac_parse_auto_config()
4332 return -ENOMEM; in stac_parse_auto_config()
4333 if (!snd_hda_gen_add_kctl(&spec->gen, NULL, spec->aloopback_ctl)) in stac_parse_auto_config()
4334 return -ENOMEM; in stac_parse_auto_config()
4337 if (spec->have_spdif_mux) { in stac_parse_auto_config()
4338 err = stac_create_spdif_mux_ctls(codec); in stac_parse_auto_config()
4343 stac_init_power_map(codec); in stac_parse_auto_config()
4348 static int stac_init(struct hda_codec *codec) in stac_init() argument
4350 struct sigmatel_spec *spec = codec->spec; in stac_init()
4354 stac_store_hints(codec); in stac_init()
4357 /* turn on EAPD statically when spec->eapd_switch isn't set. in stac_init()
4360 if (!spec->eapd_switch) in stac_init()
4361 spec->gpio_data |= spec->eapd_mask; in stac_init()
4362 stac_gpio_set(codec, spec->gpio_mask, spec->gpio_dir, spec->gpio_data); in stac_init()
4364 snd_hda_gen_init(codec); in stac_init()
4366 /* sync the power-map */ in stac_init()
4367 if (spec->num_pwrs) in stac_init()
4368 snd_hda_codec_write(codec, codec->core.afg, 0, in stac_init()
4370 spec->power_map_bits); in stac_init()
4373 if (spec->powerdown_adcs) { in stac_init()
4374 for (i = 0; i < spec->gen.num_all_adcs; i++) { in stac_init()
4375 if (spec->active_adcs & (1 << i)) in stac_init()
4377 snd_hda_codec_write(codec, spec->gen.all_adcs[i], 0, in stac_init()
4386 static void stac_shutup(struct hda_codec *codec) in stac_shutup() argument
4388 struct sigmatel_spec *spec = codec->spec; in stac_shutup()
4390 snd_hda_shutup_pins(codec); in stac_shutup()
4392 if (spec->eapd_mask) in stac_shutup()
4393 stac_gpio_set(codec, spec->gpio_mask, in stac_shutup()
4394 spec->gpio_dir, spec->gpio_data & in stac_shutup()
4395 ~spec->eapd_mask); in stac_shutup()
4402 struct hda_codec *codec, hda_nid_t nid) in stac92hd_proc_hook() argument
4404 if (nid == codec->core.afg) in stac92hd_proc_hook()
4405 snd_iprintf(buffer, "Power-Map: 0x%02x\n", in stac92hd_proc_hook()
4406 snd_hda_codec_read(codec, nid, 0, in stac92hd_proc_hook()
4411 struct hda_codec *codec, in analog_loop_proc_hook() argument
4415 snd_hda_codec_read(codec, codec->core.afg, 0, verb, 0)); in analog_loop_proc_hook()
4420 struct hda_codec *codec, hda_nid_t nid) in stac92hd7x_proc_hook() argument
4422 stac92hd_proc_hook(buffer, codec, nid); in stac92hd7x_proc_hook()
4423 if (nid == codec->core.afg) in stac92hd7x_proc_hook()
4424 analog_loop_proc_hook(buffer, codec, 0xfa0); in stac92hd7x_proc_hook()
4428 struct hda_codec *codec, hda_nid_t nid) in stac9205_proc_hook() argument
4430 if (nid == codec->core.afg) in stac9205_proc_hook()
4431 analog_loop_proc_hook(buffer, codec, 0xfe0); in stac9205_proc_hook()
4435 struct hda_codec *codec, hda_nid_t nid) in stac927x_proc_hook() argument
4437 if (nid == codec->core.afg) in stac927x_proc_hook()
4438 analog_loop_proc_hook(buffer, codec, 0xfeb); in stac927x_proc_hook()
4448 static int stac_suspend(struct hda_codec *codec) in stac_suspend() argument
4450 stac_shutup(codec); in stac_suspend()
4469 static int alloc_stac_spec(struct hda_codec *codec) in alloc_stac_spec() argument
4475 return -ENOMEM; in alloc_stac_spec()
4476 snd_hda_gen_spec_init(&spec->gen); in alloc_stac_spec()
4477 codec->spec = spec; in alloc_stac_spec()
4478 codec->no_trigger_sense = 1; /* seems common with STAC/IDT codecs */ in alloc_stac_spec()
4479 spec->gen.dac_min_mute = true; in alloc_stac_spec()
4480 codec->patch_ops = stac_patch_ops; in alloc_stac_spec()
4484 static int patch_stac9200(struct hda_codec *codec) in patch_stac9200() argument
4489 err = alloc_stac_spec(codec); in patch_stac9200()
4493 spec = codec->spec; in patch_stac9200()
4494 spec->linear_tone_beep = 1; in patch_stac9200()
4495 spec->gen.own_eapd_ctl = 1; in patch_stac9200()
4497 codec->power_filter = snd_hda_codec_eapd_power_filter; in patch_stac9200()
4499 snd_hda_add_verbs(codec, stac9200_eapd_init); in patch_stac9200()
4501 snd_hda_pick_fixup(codec, stac9200_models, stac9200_fixup_tbl, in patch_stac9200()
4503 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); in patch_stac9200()
4505 err = stac_parse_auto_config(codec); in patch_stac9200()
4507 stac_free(codec); in patch_stac9200()
4511 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); in patch_stac9200()
4516 static int patch_stac925x(struct hda_codec *codec) in patch_stac925x() argument
4521 err = alloc_stac_spec(codec); in patch_stac925x()
4525 spec = codec->spec; in patch_stac925x()
4526 spec->linear_tone_beep = 1; in patch_stac925x()
4527 spec->gen.own_eapd_ctl = 1; in patch_stac925x()
4529 snd_hda_add_verbs(codec, stac925x_core_init); in patch_stac925x()
4531 snd_hda_pick_fixup(codec, stac925x_models, stac925x_fixup_tbl, in patch_stac925x()
4533 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); in patch_stac925x()
4535 err = stac_parse_auto_config(codec); in patch_stac925x()
4537 stac_free(codec); in patch_stac925x()
4541 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); in patch_stac925x()
4546 static int patch_stac92hd73xx(struct hda_codec *codec) in patch_stac92hd73xx() argument
4552 err = alloc_stac_spec(codec); in patch_stac92hd73xx()
4556 spec = codec->spec; in patch_stac92hd73xx()
4560 if ((codec->core.vendor_id & 0xfffffff0) != 0x111d7670) in patch_stac92hd73xx()
4561 codec->power_save_node = 1; in patch_stac92hd73xx()
4562 spec->linear_tone_beep = 0; in patch_stac92hd73xx()
4563 spec->gen.mixer_nid = 0x1d; in patch_stac92hd73xx()
4564 spec->have_spdif_mux = 1; in patch_stac92hd73xx()
4566 num_dacs = snd_hda_get_num_conns(codec, 0x0a) - 1; in patch_stac92hd73xx()
4568 codec_warn(codec, in patch_stac92hd73xx()
4575 spec->aloopback_ctl = &stac92hd73xx_6ch_loopback; in patch_stac92hd73xx()
4578 spec->aloopback_ctl = &stac92hd73xx_8ch_loopback; in patch_stac92hd73xx()
4581 spec->aloopback_ctl = &stac92hd73xx_10ch_loopback; in patch_stac92hd73xx()
4585 spec->aloopback_mask = 0x01; in patch_stac92hd73xx()
4586 spec->aloopback_shift = 8; in patch_stac92hd73xx()
4588 spec->gen.beep_nid = 0x1c; /* digital beep */ in patch_stac92hd73xx()
4591 spec->eapd_mask = spec->gpio_mask = spec->gpio_dir = 0x1; in patch_stac92hd73xx()
4592 spec->gpio_data = 0x01; in patch_stac92hd73xx()
4594 spec->eapd_switch = 1; in patch_stac92hd73xx()
4596 spec->num_pwrs = ARRAY_SIZE(stac92hd73xx_pwr_nids); in patch_stac92hd73xx()
4597 spec->pwr_nids = stac92hd73xx_pwr_nids; in patch_stac92hd73xx()
4599 spec->gen.own_eapd_ctl = 1; in patch_stac92hd73xx()
4600 spec->gen.power_down_unused = 1; in patch_stac92hd73xx()
4602 snd_hda_pick_fixup(codec, stac92hd73xx_models, stac92hd73xx_fixup_tbl, in patch_stac92hd73xx()
4604 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); in patch_stac92hd73xx()
4606 if (!spec->volknob_init) in patch_stac92hd73xx()
4607 snd_hda_add_verbs(codec, stac92hd73xx_core_init); in patch_stac92hd73xx()
4609 err = stac_parse_auto_config(codec); in patch_stac92hd73xx()
4611 stac_free(codec); in patch_stac92hd73xx()
4615 /* Don't GPIO-mute speakers if there are no internal speakers, because in patch_stac92hd73xx()
4618 if (spec->eapd_switch && !has_builtin_speaker(codec)) in patch_stac92hd73xx()
4619 spec->eapd_switch = 0; in patch_stac92hd73xx()
4621 codec->proc_widget_hook = stac92hd7x_proc_hook; in patch_stac92hd73xx()
4623 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); in patch_stac92hd73xx()
4628 static void stac_setup_gpio(struct hda_codec *codec) in stac_setup_gpio() argument
4630 struct sigmatel_spec *spec = codec->spec; in stac_setup_gpio()
4632 spec->gpio_mask |= spec->eapd_mask; in stac_setup_gpio()
4633 if (spec->gpio_led) { in stac_setup_gpio()
4634 if (!spec->vref_mute_led_nid) { in stac_setup_gpio()
4635 spec->gpio_mask |= spec->gpio_led; in stac_setup_gpio()
4636 spec->gpio_dir |= spec->gpio_led; in stac_setup_gpio()
4637 spec->gpio_data |= spec->gpio_led; in stac_setup_gpio()
4639 codec->power_filter = stac_vref_led_power_filter; in stac_setup_gpio()
4643 if (spec->mic_mute_led_gpio) { in stac_setup_gpio()
4644 spec->gpio_mask |= spec->mic_mute_led_gpio; in stac_setup_gpio()
4645 spec->gpio_dir |= spec->mic_mute_led_gpio; in stac_setup_gpio()
4646 spec->mic_enabled = 0; in stac_setup_gpio()
4647 spec->gpio_data |= spec->mic_mute_led_gpio; in stac_setup_gpio()
4648 snd_hda_gen_add_micmute_led_cdev(codec, stac_capture_led_update); in stac_setup_gpio()
4652 static int patch_stac92hd83xxx(struct hda_codec *codec) in patch_stac92hd83xxx() argument
4657 err = alloc_stac_spec(codec); in patch_stac92hd83xxx()
4662 codec->core.power_caps &= ~AC_PWRST_EPSS; in patch_stac92hd83xxx()
4664 spec = codec->spec; in patch_stac92hd83xxx()
4665 codec->power_save_node = 1; in patch_stac92hd83xxx()
4666 spec->linear_tone_beep = 0; in patch_stac92hd83xxx()
4667 spec->gen.own_eapd_ctl = 1; in patch_stac92hd83xxx()
4668 spec->gen.power_down_unused = 1; in patch_stac92hd83xxx()
4669 spec->gen.mixer_nid = 0x1b; in patch_stac92hd83xxx()
4671 spec->gen.beep_nid = 0x21; /* digital beep */ in patch_stac92hd83xxx()
4672 spec->pwr_nids = stac92hd83xxx_pwr_nids; in patch_stac92hd83xxx()
4673 spec->num_pwrs = ARRAY_SIZE(stac92hd83xxx_pwr_nids); in patch_stac92hd83xxx()
4674 spec->default_polarity = -1; /* no default cfg */ in patch_stac92hd83xxx()
4676 snd_hda_add_verbs(codec, stac92hd83xxx_core_init); in patch_stac92hd83xxx()
4678 snd_hda_pick_fixup(codec, stac92hd83xxx_models, stac92hd83xxx_fixup_tbl, in patch_stac92hd83xxx()
4680 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); in patch_stac92hd83xxx()
4682 stac_setup_gpio(codec); in patch_stac92hd83xxx()
4684 err = stac_parse_auto_config(codec); in patch_stac92hd83xxx()
4686 stac_free(codec); in patch_stac92hd83xxx()
4690 codec->proc_widget_hook = stac92hd_proc_hook; in patch_stac92hd83xxx()
4692 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); in patch_stac92hd83xxx()
4701 static int patch_stac92hd95(struct hda_codec *codec) in patch_stac92hd95() argument
4706 err = alloc_stac_spec(codec); in patch_stac92hd95()
4711 codec->core.power_caps &= ~AC_PWRST_EPSS; in patch_stac92hd95()
4713 spec = codec->spec; in patch_stac92hd95()
4714 codec->power_save_node = 1; in patch_stac92hd95()
4715 spec->linear_tone_beep = 0; in patch_stac92hd95()
4716 spec->gen.own_eapd_ctl = 1; in patch_stac92hd95()
4717 spec->gen.power_down_unused = 1; in patch_stac92hd95()
4719 spec->gen.beep_nid = 0x19; /* digital beep */ in patch_stac92hd95()
4720 spec->pwr_nids = stac92hd95_pwr_nids; in patch_stac92hd95()
4721 spec->num_pwrs = ARRAY_SIZE(stac92hd95_pwr_nids); in patch_stac92hd95()
4722 spec->default_polarity = 0; in patch_stac92hd95()
4724 snd_hda_pick_fixup(codec, stac92hd95_models, stac92hd95_fixup_tbl, in patch_stac92hd95()
4726 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); in patch_stac92hd95()
4728 stac_setup_gpio(codec); in patch_stac92hd95()
4730 err = stac_parse_auto_config(codec); in patch_stac92hd95()
4732 stac_free(codec); in patch_stac92hd95()
4736 codec->proc_widget_hook = stac92hd_proc_hook; in patch_stac92hd95()
4738 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); in patch_stac92hd95()
4743 static int patch_stac92hd71bxx(struct hda_codec *codec) in patch_stac92hd71bxx() argument
4749 err = alloc_stac_spec(codec); in patch_stac92hd71bxx()
4753 spec = codec->spec; in patch_stac92hd71bxx()
4755 /* codec->power_save_node = 1; */ in patch_stac92hd71bxx()
4756 spec->linear_tone_beep = 0; in patch_stac92hd71bxx()
4757 spec->gen.own_eapd_ctl = 1; in patch_stac92hd71bxx()
4758 spec->gen.power_down_unused = 1; in patch_stac92hd71bxx()
4759 spec->gen.mixer_nid = 0x17; in patch_stac92hd71bxx()
4760 spec->have_spdif_mux = 1; in patch_stac92hd71bxx()
4763 spec->gpio_mask = 0x01; in patch_stac92hd71bxx()
4764 spec->gpio_dir = 0x01; in patch_stac92hd71bxx()
4765 spec->gpio_data = 0x01; in patch_stac92hd71bxx()
4767 switch (codec->core.vendor_id) { in patch_stac92hd71bxx()
4773 if ((codec->core.revision_id & 0xf) == 0 || in patch_stac92hd71bxx()
4774 (codec->core.revision_id & 0xf) == 1) in patch_stac92hd71bxx()
4775 spec->stream_delay = 40; /* 40 milliseconds */ in patch_stac92hd71bxx()
4779 snd_hda_codec_set_pincfg(codec, 0x0f, 0x40f000f0); in patch_stac92hd71bxx()
4780 snd_hda_codec_set_pincfg(codec, 0x19, 0x40f000f3); in patch_stac92hd71bxx()
4783 if ((codec->core.revision_id & 0xf) == 1) in patch_stac92hd71bxx()
4784 spec->stream_delay = 40; /* 40 milliseconds */ in patch_stac92hd71bxx()
4789 if (get_wcaps_type(get_wcaps(codec, 0x28)) == AC_WID_VOL_KNB) in patch_stac92hd71bxx()
4790 snd_hda_add_verbs(codec, stac92hd71bxx_core_init); in patch_stac92hd71bxx()
4792 if (get_wcaps(codec, 0xa) & AC_WCAP_IN_AMP) { in patch_stac92hd71bxx()
4795 snd_hda_codec_amp_init_stereo(codec, *p, HDA_INPUT, 0, in patch_stac92hd71bxx()
4799 spec->aloopback_ctl = &stac92hd71bxx_loopback; in patch_stac92hd71bxx()
4800 spec->aloopback_mask = 0x50; in patch_stac92hd71bxx()
4801 spec->aloopback_shift = 0; in patch_stac92hd71bxx()
4803 spec->powerdown_adcs = 1; in patch_stac92hd71bxx()
4804 spec->gen.beep_nid = 0x26; /* digital beep */ in patch_stac92hd71bxx()
4805 spec->num_pwrs = ARRAY_SIZE(stac92hd71bxx_pwr_nids); in patch_stac92hd71bxx()
4806 spec->pwr_nids = stac92hd71bxx_pwr_nids; in patch_stac92hd71bxx()
4808 snd_hda_pick_fixup(codec, stac92hd71bxx_models, stac92hd71bxx_fixup_tbl, in patch_stac92hd71bxx()
4810 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); in patch_stac92hd71bxx()
4812 stac_setup_gpio(codec); in patch_stac92hd71bxx()
4814 err = stac_parse_auto_config(codec); in patch_stac92hd71bxx()
4816 stac_free(codec); in patch_stac92hd71bxx()
4820 codec->proc_widget_hook = stac92hd7x_proc_hook; in patch_stac92hd71bxx()
4822 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); in patch_stac92hd71bxx()
4827 static int patch_stac922x(struct hda_codec *codec) in patch_stac922x() argument
4832 err = alloc_stac_spec(codec); in patch_stac922x()
4836 spec = codec->spec; in patch_stac922x()
4837 spec->linear_tone_beep = 1; in patch_stac922x()
4838 spec->gen.own_eapd_ctl = 1; in patch_stac922x()
4840 snd_hda_add_verbs(codec, stac922x_core_init); in patch_stac922x()
4843 snd_hda_override_amp_caps(codec, 0x12, HDA_OUTPUT, in patch_stac922x()
4849 snd_hda_pick_fixup(codec, stac922x_models, stac922x_fixup_tbl, in patch_stac922x()
4851 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); in patch_stac922x()
4853 err = stac_parse_auto_config(codec); in patch_stac922x()
4855 stac_free(codec); in patch_stac922x()
4859 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); in patch_stac922x()
4865 "Digital Playback", "ADAT", "Analog Mux 1",
4869 static int patch_stac927x(struct hda_codec *codec) in patch_stac927x() argument
4874 err = alloc_stac_spec(codec); in patch_stac927x()
4878 spec = codec->spec; in patch_stac927x()
4879 spec->linear_tone_beep = 1; in patch_stac927x()
4880 spec->gen.own_eapd_ctl = 1; in patch_stac927x()
4881 spec->have_spdif_mux = 1; in patch_stac927x()
4882 spec->spdif_labels = stac927x_spdif_labels; in patch_stac927x()
4884 spec->gen.beep_nid = 0x23; /* digital beep */ in patch_stac927x()
4887 spec->eapd_mask = spec->gpio_mask = 0x01; in patch_stac927x()
4888 spec->gpio_dir = spec->gpio_data = 0x01; in patch_stac927x()
4890 spec->aloopback_ctl = &stac927x_loopback; in patch_stac927x()
4891 spec->aloopback_mask = 0x40; in patch_stac927x()
4892 spec->aloopback_shift = 0; in patch_stac927x()
4893 spec->eapd_switch = 1; in patch_stac927x()
4895 snd_hda_pick_fixup(codec, stac927x_models, stac927x_fixup_tbl, in patch_stac927x()
4897 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); in patch_stac927x()
4899 if (!spec->volknob_init) in patch_stac927x()
4900 snd_hda_add_verbs(codec, stac927x_core_init); in patch_stac927x()
4902 err = stac_parse_auto_config(codec); in patch_stac927x()
4904 stac_free(codec); in patch_stac927x()
4908 codec->proc_widget_hook = stac927x_proc_hook; in patch_stac927x()
4920 codec->bus->core.needs_damn_long_delay = 1; in patch_stac927x()
4922 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); in patch_stac927x()
4927 static int patch_stac9205(struct hda_codec *codec) in patch_stac9205() argument
4932 err = alloc_stac_spec(codec); in patch_stac9205()
4936 spec = codec->spec; in patch_stac9205()
4937 spec->linear_tone_beep = 1; in patch_stac9205()
4938 spec->gen.own_eapd_ctl = 1; in patch_stac9205()
4939 spec->have_spdif_mux = 1; in patch_stac9205()
4941 spec->gen.beep_nid = 0x23; /* digital beep */ in patch_stac9205()
4943 snd_hda_add_verbs(codec, stac9205_core_init); in patch_stac9205()
4944 spec->aloopback_ctl = &stac9205_loopback; in patch_stac9205()
4946 spec->aloopback_mask = 0x40; in patch_stac9205()
4947 spec->aloopback_shift = 0; in patch_stac9205()
4950 spec->eapd_mask = spec->gpio_mask = spec->gpio_dir = 0x1; in patch_stac9205()
4951 spec->gpio_data = 0x01; in patch_stac9205()
4954 spec->eapd_switch = 1; in patch_stac9205()
4956 snd_hda_pick_fixup(codec, stac9205_models, stac9205_fixup_tbl, in patch_stac9205()
4958 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); in patch_stac9205()
4960 err = stac_parse_auto_config(codec); in patch_stac9205()
4962 stac_free(codec); in patch_stac9205()
4966 codec->proc_widget_hook = stac9205_proc_hook; in patch_stac9205()
4968 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); in patch_stac9205()
4978 {0x15, AC_VERB_SET_CONNECT_SEL, 0x1}, /* mic-sel: 0a,0d,14,02 */
4979 {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, /* Mic-in -> 0x9 */
5014 static int patch_stac9872(struct hda_codec *codec) in patch_stac9872() argument
5019 err = alloc_stac_spec(codec); in patch_stac9872()
5023 spec = codec->spec; in patch_stac9872()
5024 spec->linear_tone_beep = 1; in patch_stac9872()
5025 spec->gen.own_eapd_ctl = 1; in patch_stac9872()
5027 snd_hda_add_verbs(codec, stac9872_core_init); in patch_stac9872()
5029 snd_hda_pick_fixup(codec, stac9872_models, stac9872_fixup_tbl, in patch_stac9872()
5031 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); in patch_stac9872()
5033 err = stac_parse_auto_config(codec); in patch_stac9872()
5035 stac_free(codec); in patch_stac9872()
5036 return -EINVAL; in patch_stac9872()
5039 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); in patch_stac9872()
5158 MODULE_DESCRIPTION("IDT/Sigmatel HD-audio codec");