Lines Matching +full:mic +full:- +full:amp +full:- +full:in +full:- +full:sel
1 // SPDX-License-Identifier: GPL-2.0-or-later
59 STAC_92HD73XX_NO_JD, /* no jack-detection */
149 STAC_D965_REF_NO_JD, /* no jack-detection */
175 unsigned int headset_jack:1; /* 4-pin headset jack (hp + mono mic) */
176 unsigned int volknob_init:1; /* special volume-knob initialization */
188 unsigned int vref_mute_led_nid; /* pin NID for mute-LED vref control */
193 unsigned int mic_enabled; /* current mic mute state (bitmask) */
214 /* SPDIF-out mux */
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()
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()
293 hda_nid_t fg = codec->core.afg; 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()
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()
361 /* prevent codec AFG to D3 state when vref-out pin is used for mute LED */
362 /* this hook is set in stac_setup_gpio() */
367 if (nid == codec->core.afg && power_state == AC_PWRST_D3) in stac_vref_led_power_filter()
372 /* update mute-LED accoring to the master switch */
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()
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()
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()
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()
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()
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()
491 snd_hda_codec_write(codec, codec->core.afg, 0, in jack_update_power()
493 spec->power_map_bits); in jack_update_power()
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()
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()
521 spec->vref_mute_led_nid != nid && in stac_init_power_map()
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()
563 spec->eapd_switch = val; in stac_store_hints()
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()
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()
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()
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()
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()
728 * provided as OEM string in SMBIOS. The format of that string
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
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()
753 &spec->gpio_led_polarity); 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()
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()
777 if (strstr(dev->name, "HP_Mute_LED_P_G")) { 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()
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()
795 spec->gpio_led_polarity = default_polarity; in find_mute_led_cfg()
801 /* check whether a built-in speaker is included in parsed pins */
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()
832 struct sigmatel_spec *spec = codec->spec; in stac_auto_create_beep_ctls()
842 /* check for mute support for the amp */ 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()
857 /* check to see if there is volume support for the amp */ 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()
877 ucontrol->value.integer.value[0] = codec->beep->enabled; in stac_dig_beep_switch_get()
885 return snd_hda_enable_beep_device(codec, ucontrol->value.integer.value[0]); in stac_dig_beep_switch_put()
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
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()
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()
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()
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()
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()
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
1338 { 0x0b, 0x02a19080 }, /* Front Mic */
1339 { 0x0c, 0x0181304e }, /* Line in */
1341 { 0x0e, 0x01a19040 }, /* Rear Mic */
1345 { 0x12, 0x103301f0 }, /* Motherboard CD line in connector */
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" },
1710 // Port A-H
1719 // CD in
1721 // Digial Mic ins
1793 struct sigmatel_spec *spec = codec->spec; in stac92hd73xx_fixup_ref()
1799 spec->gpio_mask = spec->gpio_dir = spec->gpio_data = 0; in stac92hd73xx_fixup_ref()
1804 struct sigmatel_spec *spec = codec->spec; in stac92hd73xx_fixup_dell()
1807 spec->eapd_switch = 0; in stac92hd73xx_fixup_dell()
1813 struct sigmatel_spec *spec = codec->spec; in stac92hd73xx_fixup_dell_eq()
1820 spec->volknob_init = 1; in stac92hd73xx_fixup_dell_eq()
1860 struct sigmatel_spec *spec = codec->spec; in stac92hd73xx_fixup_alienware_m17x()
1866 spec->eapd_switch = 0; in stac92hd73xx_fixup_alienware_m17x()
1873 codec->no_jack_detect = 1; in stac92hd73xx_fixup_no_jd()
1880 struct sigmatel_spec *spec = codec->spec; in stac92hd73xx_disable_automute()
1885 spec->gen.suppress_auto_mute = 1; in stac92hd73xx_disable_automute()
1947 { .id = STAC_92HD73XX_NO_JD, .name = "no-jd" },
1950 { .id = STAC_DELL_M6_AMIC, .name = "dell-m6-amic" },
1951 { .id = STAC_DELL_M6_DMIC, .name = "dell-m6-dmic" },
1952 { .id = STAC_DELL_M6_BOTH, .name = "dell-m6" },
1953 { .id = STAC_DELL_EQ, .name = "dell-eq" },
1955 { .id = STAC_ELO_VUPOINT_15MX, .name = "elo-vupoint-15mx" },
1956 { .id = STAC_92HD73XX_ASUS_MOBO, .name = "asus-mobo" },
2103 struct sigmatel_spec *spec = codec->spec; in stac92hd83xxx_fixup_hp()
2113 if (find_mute_led_cfg(codec, spec->default_polarity)) in stac92hd83xxx_fixup_hp()
2115 spec->gpio_led, in stac92hd83xxx_fixup_hp()
2116 spec->gpio_led_polarity); in stac92hd83xxx_fixup_hp()
2118 /* allow auto-switching of dock line-in */ in stac92hd83xxx_fixup_hp()
2119 spec->gen.line_in_auto_switch = true; in stac92hd83xxx_fixup_hp()
2135 struct sigmatel_spec *spec = codec->spec; in stac92hd83xxx_fixup_hp_led()
2138 spec->default_polarity = 0; in stac92hd83xxx_fixup_hp_led()
2144 struct sigmatel_spec *spec = codec->spec; in stac92hd83xxx_fixup_hp_inv_led()
2147 spec->default_polarity = 1; in stac92hd83xxx_fixup_hp_inv_led()
2153 struct sigmatel_spec *spec = codec->spec; in stac92hd83xxx_fixup_hp_mic_led()
2156 spec->mic_mute_led_gpio = 0x08; /* GPIO3 */ in stac92hd83xxx_fixup_hp_mic_led()
2158 codec->core.power_caps &= ~AC_PWRST_CLKSTOP; in stac92hd83xxx_fixup_hp_mic_led()
2165 struct sigmatel_spec *spec = codec->spec; in stac92hd83xxx_fixup_hp_led_gpio10()
2168 spec->gpio_led = 0x10; /* GPIO4 */ in stac92hd83xxx_fixup_hp_led_gpio10()
2169 spec->default_polarity = 0; in stac92hd83xxx_fixup_hp_led_gpio10()
2176 struct sigmatel_spec *spec = codec->spec; in stac92hd83xxx_fixup_headset_jack()
2179 spec->headset_jack = 1; in stac92hd83xxx_fixup_headset_jack()
2186 struct sigmatel_spec *spec = codec->spec; in stac92hd83xxx_fixup_gpio10_eapd()
2190 spec->eapd_mask = spec->gpio_mask = spec->gpio_dir = in stac92hd83xxx_fixup_gpio10_eapd()
2191 spec->gpio_data = 0x10; in stac92hd83xxx_fixup_gpio10_eapd()
2192 spec->eapd_switch = 0; in stac92hd83xxx_fixup_gpio10_eapd()
2199 struct sigmatel_spec *spec = codec->spec; in hp_envy_ts_fixup_dac_bind()
2208 spec->gen.preferred_dacs = preferred_pairs; in hp_envy_ts_fixup_dac_bind()
2740 { .id = STAC_92HD83XXX_PWR_REF, .name = "mic-ref" },
2741 { .id = STAC_DELL_S14, .name = "dell-s14" },
2742 { .id = STAC_DELL_VOSTRO_3500, .name = "dell-vostro-3500" },
2744 { .id = STAC_HP_DV7_4000, .name = "hp-dv7-4000" },
2745 { .id = STAC_HP_ZEPHYR, .name = "hp-zephyr" },
2746 { .id = STAC_92HD83XXX_HP_LED, .name = "hp-led" },
2747 { .id = STAC_92HD83XXX_HP_INV_LED, .name = "hp-inv-led" },
2748 { .id = STAC_92HD83XXX_HP_MIC_LED, .name = "hp-mic-led" },
2749 { .id = STAC_92HD83XXX_HEADSET_JACK, .name = "headset-jack" },
2750 { .id = STAC_HP_ENVY_BASS, .name = "hp-envy-bass" },
2751 { .id = STAC_HP_BNB13_EQ, .name = "hp-bnb13-eq" },
2752 { .id = STAC_HP_ENVY_TS_BASS, .name = "hp-envy-ts-bass" },
2949 /* HP dv7 bass switch - GPIO5 */
2955 struct sigmatel_spec *spec = codec->spec; in stac_hp_bass_gpio_get()
2956 ucontrol->value.integer.value[0] = !!(spec->gpio_data & 0x20); in stac_hp_bass_gpio_get()
2964 struct sigmatel_spec *spec = codec->spec; in stac_hp_bass_gpio_put()
2967 gpio_data = (spec->gpio_data & ~0x20) | in stac_hp_bass_gpio_put()
2968 (ucontrol->value.integer.value[0] ? 0x20 : 0); in stac_hp_bass_gpio_put()
2969 if (gpio_data == spec->gpio_data) in stac_hp_bass_gpio_put()
2971 spec->gpio_data = gpio_data; in stac_hp_bass_gpio_put()
2972 stac_gpio_set(codec, spec->gpio_mask, spec->gpio_dir, spec->gpio_data); in stac_hp_bass_gpio_put()
2985 struct sigmatel_spec *spec = codec->spec; in stac_add_hp_bass_switch()
2987 if (!snd_hda_gen_add_kctl(&spec->gen, "Bass Speaker Playback Switch", in stac_add_hp_bass_switch()
2989 return -ENOMEM; in stac_add_hp_bass_switch()
2991 spec->gpio_mask |= 0x20; in stac_add_hp_bass_switch()
2992 spec->gpio_dir |= 0x20; in stac_add_hp_bass_switch()
2993 spec->gpio_data |= 0x20; in stac_add_hp_bass_switch()
3060 struct sigmatel_spec *spec = codec->spec; in stac92hd71bxx_fixup_ref()
3066 spec->gpio_mask = spec->gpio_dir = spec->gpio_data = 0; in stac92hd71bxx_fixup_ref()
3072 struct sigmatel_spec *spec = codec->spec; in stac92hd71bxx_fixup_hp_m4()
3079 snd_hda_codec_write_cache(codec, codec->core.afg, 0, in stac92hd71bxx_fixup_hp_m4()
3081 jack = snd_hda_jack_detect_enable_callback(codec, codec->core.afg, in stac92hd71bxx_fixup_hp_m4()
3084 jack->private_data = 0x02; in stac92hd71bxx_fixup_hp_m4()
3086 spec->gpio_mask |= 0x02; in stac92hd71bxx_fixup_hp_m4()
3095 struct sigmatel_spec *spec = codec->spec; in stac92hd71bxx_fixup_hp_dv4()
3099 spec->gpio_led = 0x01; in stac92hd71bxx_fixup_hp_dv4()
3125 struct sigmatel_spec *spec = codec->spec; in stac92hd71bxx_fixup_hp_hdx()
3129 spec->gpio_led = 0x08; in stac92hd71bxx_fixup_hp_hdx()
3136 /* count line-out, too, as BIOS sets often so */ in is_hp_output()
3146 /* It was changed in the BIOS to just satisfy MS DTM. in fixup_hp_headphone()
3159 struct sigmatel_spec *spec = codec->spec; in stac92hd71bxx_fixup_hp()
3165 * dock and built-in headphones; fix both pin configs in stac92hd71bxx_fixup_hp()
3174 spec->gpio_led, in stac92hd71bxx_fixup_hp()
3175 spec->gpio_led_polarity); in stac92hd71bxx_fixup_hp()
3228 { .id = STAC_DELL_M4_1, .name = "dell-m4-1" },
3229 { .id = STAC_DELL_M4_2, .name = "dell-m4-2" },
3230 { .id = STAC_DELL_M4_3, .name = "dell-m4-3" },
3231 { .id = STAC_HP_M4, .name = "hp-m4" },
3232 { .id = STAC_HP_DV4, .name = "hp-dv4" },
3233 { .id = STAC_HP_DV5, .name = "hp-dv5" },
3234 { .id = STAC_HP_HDX, .name = "hp-hdx" },
3235 { .id = STAC_HP_DV4, .name = "hp-dv4-1222nr" },
3250 "HP dv4-7", STAC_HP_DV4),
3252 "HP dv4-7", STAC_HP_DV5),
3262 "HP dv6", STAC_HP_DV5), /* HP dv6-1110ax */
3526 codec->fixup_id = HDA_FIXUP_ID_NOT_SET; in stac922x_fixup_intel_mac_auto()
3529 if (codec->fixup_id != HDA_FIXUP_ID_NOT_SET) in stac922x_fixup_intel_mac_auto()
3537 struct sigmatel_spec *spec = codec->spec; in stac922x_fixup_intel_mac_gpio()
3540 spec->gpio_mask = spec->gpio_dir = 0x03; in stac922x_fixup_intel_mac_gpio()
3541 spec->gpio_data = 0x03; in stac922x_fixup_intel_mac_gpio()
3622 { .id = STAC_INTEL_MAC_V1, .name = "intel-mac-v1" },
3623 { .id = STAC_INTEL_MAC_V2, .name = "intel-mac-v2" },
3624 { .id = STAC_INTEL_MAC_V3, .name = "intel-mac-v3" },
3625 { .id = STAC_INTEL_MAC_V4, .name = "intel-mac-v4" },
3626 { .id = STAC_INTEL_MAC_V5, .name = "intel-mac-v5" },
3627 { .id = STAC_INTEL_MAC_AUTO, .name = "intel-mac-auto" },
3629 { .id = STAC_922X_DELL_D81, .name = "dell-d81" },
3630 { .id = STAC_922X_DELL_D82, .name = "dell-d82" },
3631 { .id = STAC_922X_DELL_M81, .name = "dell-m81" },
3632 { .id = STAC_922X_DELL_M82, .name = "dell-m82" },
3636 { .id = STAC_INTEL_MAC_V3, .name = "macbook-pro-v1" },
3637 { .id = STAC_INTEL_MAC_V3, .name = "macbook-pro" },
3638 { .id = STAC_INTEL_MAC_V2, .name = "imac-intel" },
3639 { .id = STAC_INTEL_MAC_V3, .name = "imac-intel-20" },
3680 /* Intel D945G 5-stack systems */
3828 /* no jack detecion for ref-no-jd model */ in stac927x_fixup_ref_no_jd()
3830 codec->no_jack_detect = 1; in stac927x_fixup_ref_no_jd()
3836 struct sigmatel_spec *spec = codec->spec; in stac927x_fixup_ref()
3840 spec->eapd_mask = spec->gpio_mask = 0; in stac927x_fixup_ref()
3841 spec->gpio_dir = spec->gpio_data = 0; in stac927x_fixup_ref()
3848 struct sigmatel_spec *spec = codec->spec; in stac927x_fixup_dell_dmic()
3853 if (codec->core.subsystem_id != 0x1028022f) { in stac927x_fixup_dell_dmic()
3855 spec->eapd_mask = spec->gpio_mask = 0x04; in stac927x_fixup_dell_dmic()
3856 spec->gpio_dir = spec->gpio_data = 0x04; in stac927x_fixup_dell_dmic()
3860 spec->volknob_init = 1; in stac927x_fixup_dell_dmic()
3866 struct sigmatel_spec *spec = codec->spec; in stac927x_fixup_volknob()
3870 spec->volknob_init = 1; in stac927x_fixup_volknob()
3920 /* correct the front input jack as a mic */
3958 { .id = STAC_D965_REF_NO_JD, .name = "ref-no-jd" },
3962 { .id = STAC_D965_5ST_NO_FP, .name = "5stack-no-fp" },
3963 { .id = STAC_DELL_3ST, .name = "dell-3stack" },
3964 { .id = STAC_DELL_BIOS, .name = "dell-bios" },
3965 { .id = STAC_NEMO_DEFAULT, .name = "nemo-default" },
3966 { .id = STAC_DELL_BIOS_AMIC, .name = "dell-bios-amic" },
3989 /* Dell 3 stack systems with verb table in BIOS */
4006 /* volume-knob fixes */
4077 /* Enable SPDIF in/out */
4102 struct sigmatel_spec *spec = codec->spec; in stac9205_fixup_ref()
4106 /* SPDIF-In enabled */ in stac9205_fixup_ref()
4107 spec->eapd_mask = spec->gpio_mask = spec->gpio_dir = 0; in stac9205_fixup_ref()
4114 struct sigmatel_spec *spec = codec->spec; in stac9205_fixup_dell_m43()
4121 snd_hda_codec_write_cache(codec, codec->core.afg, 0, in stac9205_fixup_dell_m43()
4123 jack = snd_hda_jack_detect_enable_callback(codec, codec->core.afg, in stac9205_fixup_dell_m43()
4126 jack->private_data = 0x01; in stac9205_fixup_dell_m43()
4128 spec->gpio_dir = 0x0b; in stac9205_fixup_dell_m43()
4129 spec->eapd_mask = 0x01; in stac9205_fixup_dell_m43()
4130 spec->gpio_mask = 0x1b; in stac9205_fixup_dell_m43()
4131 spec->gpio_mute = 0x10; in stac9205_fixup_dell_m43()
4135 spec->gpio_data = 0x01; in stac9205_fixup_dell_m43()
4142 struct sigmatel_spec *spec = codec->spec; in stac9205_fixup_eapd()
4145 spec->eapd_switch = 0; in stac9205_fixup_eapd()
4174 { .id = STAC_9205_DELL_M42, .name = "dell-m42" },
4175 { .id = STAC_9205_DELL_M43, .name = "dell-m43" },
4176 { .id = STAC_9205_DELL_M44, .name = "dell-m44" },
4231 struct sigmatel_spec *spec = codec->spec; in stac92hd95_fixup_hp_led()
4236 if (find_mute_led_cfg(codec, spec->default_polarity)) in stac92hd95_fixup_hp_led()
4238 spec->gpio_led, in stac92hd95_fixup_hp_led()
4239 spec->gpio_led_polarity); in stac92hd95_fixup_hp_led()
4264 { .id = STAC_92HD95_HP_LED, .name = "hp-led" },
4265 { .id = STAC_92HD95_HP_BASS, .name = "hp-bass" },
4272 struct sigmatel_spec *spec = codec->spec; in stac_parse_auto_config()
4276 if (spec->headset_jack) in stac_parse_auto_config()
4279 err = snd_hda_parse_pin_defcfg(codec, &spec->gen.autocfg, NULL, flags); in stac_parse_auto_config()
4284 spec->gen.pcm_playback_hook = stac_playback_pcm_hook; in stac_parse_auto_config()
4285 spec->gen.pcm_capture_hook = stac_capture_pcm_hook; in stac_parse_auto_config()
4287 spec->gen.automute_hook = stac_update_outputs; in stac_parse_auto_config()
4289 if (spec->gpio_led) in stac_parse_auto_config()
4292 err = snd_hda_gen_parse_auto_config(codec, &spec->gen.autocfg); in stac_parse_auto_config()
4296 if (spec->vref_mute_led_nid) { in stac_parse_auto_config()
4297 err = snd_hda_gen_fix_pin_power(codec, spec->vref_mute_led_nid); in stac_parse_auto_config()
4303 if (spec->anabeep_nid > 0) { in stac_parse_auto_config()
4305 spec->anabeep_nid); in stac_parse_auto_config()
4312 if (spec->gen.beep_nid) { in stac_parse_auto_config()
4313 hda_nid_t nid = spec->gen.beep_nid; in stac_parse_auto_config()
4319 if (codec->beep) { in stac_parse_auto_config()
4321 codec->beep->linear_tone = spec->linear_tone_beep; in stac_parse_auto_config()
4323 codec->beep->keep_power_at_enable = 1; in stac_parse_auto_config()
4335 if (spec->aloopback_ctl && in stac_parse_auto_config()
4338 spec->aloopback_ctl->private_value >> 16; in stac_parse_auto_config()
4339 if (snd_hdac_regmap_add_vendor_verb(&codec->core, wr_verb)) in stac_parse_auto_config()
4340 return -ENOMEM; in stac_parse_auto_config()
4341 if (!snd_hda_gen_add_kctl(&spec->gen, NULL, spec->aloopback_ctl)) in stac_parse_auto_config()
4342 return -ENOMEM; in stac_parse_auto_config()
4345 if (spec->have_spdif_mux) { in stac_parse_auto_config()
4358 struct sigmatel_spec *spec = codec->spec; in stac_init()
4365 /* turn on EAPD statically when spec->eapd_switch isn't set. in stac_init()
4368 if (!spec->eapd_switch) in stac_init()
4369 spec->gpio_data |= spec->eapd_mask; in stac_init()
4370 stac_gpio_set(codec, spec->gpio_mask, spec->gpio_dir, spec->gpio_data); in stac_init()
4374 /* sync the power-map */ in stac_init()
4375 if (spec->num_pwrs) in stac_init()
4376 snd_hda_codec_write(codec, codec->core.afg, 0, in stac_init()
4378 spec->power_map_bits); in stac_init()
4381 if (spec->powerdown_adcs) { in stac_init()
4382 for (i = 0; i < spec->gen.num_all_adcs; i++) { in stac_init()
4383 if (spec->active_adcs & (1 << i)) in stac_init()
4385 snd_hda_codec_write(codec, spec->gen.all_adcs[i], 0, in stac_init()
4400 if (nid == codec->core.afg) in stac92hd_proc_hook()
4401 snd_iprintf(buffer, "Power-Map: 0x%02x\n", in stac92hd_proc_hook()
4411 snd_hda_codec_read(codec, codec->core.afg, 0, verb, 0)); in analog_loop_proc_hook()
4419 if (nid == codec->core.afg) in stac92hd7x_proc_hook()
4426 if (nid == codec->core.afg) in stac9205_proc_hook()
4433 if (nid == codec->core.afg) in stac927x_proc_hook()
4445 struct sigmatel_spec *spec = codec->spec; in stac_suspend()
4449 if (spec->eapd_mask) in stac_suspend()
4450 stac_gpio_set(codec, spec->gpio_mask, in stac_suspend()
4451 spec->gpio_dir, spec->gpio_data & in stac_suspend()
4452 ~spec->eapd_mask); in stac_suspend()
4472 return -ENOMEM; in alloc_stac_spec()
4473 snd_hda_gen_spec_init(&spec->gen); in alloc_stac_spec()
4474 codec->spec = spec; in alloc_stac_spec()
4475 codec->no_trigger_sense = 1; /* seems common with STAC/IDT codecs */ in alloc_stac_spec()
4476 spec->gen.dac_min_mute = true; in alloc_stac_spec()
4477 codec->patch_ops = stac_patch_ops; in alloc_stac_spec()
4490 spec = codec->spec; in patch_stac9200()
4491 spec->linear_tone_beep = 1; in patch_stac9200()
4492 spec->gen.own_eapd_ctl = 1; in patch_stac9200()
4494 codec->power_filter = snd_hda_codec_eapd_power_filter; in patch_stac9200()
4522 spec = codec->spec; in patch_stac925x()
4523 spec->linear_tone_beep = 1; in patch_stac925x()
4524 spec->gen.own_eapd_ctl = 1; in patch_stac925x()
4553 spec = codec->spec; in patch_stac92hd73xx()
4557 if ((codec->core.vendor_id & 0xfffffff0) != 0x111d7670) in patch_stac92hd73xx()
4558 codec->power_save_node = 1; in patch_stac92hd73xx()
4559 spec->linear_tone_beep = 0; in patch_stac92hd73xx()
4560 spec->gen.mixer_nid = 0x1d; in patch_stac92hd73xx()
4561 spec->have_spdif_mux = 1; in patch_stac92hd73xx()
4563 num_dacs = snd_hda_get_num_conns(codec, 0x0a) - 1; in patch_stac92hd73xx()
4572 spec->aloopback_ctl = &stac92hd73xx_6ch_loopback; in patch_stac92hd73xx()
4575 spec->aloopback_ctl = &stac92hd73xx_8ch_loopback; in patch_stac92hd73xx()
4578 spec->aloopback_ctl = &stac92hd73xx_10ch_loopback; in patch_stac92hd73xx()
4582 spec->aloopback_mask = 0x01; in patch_stac92hd73xx()
4583 spec->aloopback_shift = 8; in patch_stac92hd73xx()
4585 spec->gen.beep_nid = 0x1c; /* digital beep */ in patch_stac92hd73xx()
4588 spec->eapd_mask = spec->gpio_mask = spec->gpio_dir = 0x1; in patch_stac92hd73xx()
4589 spec->gpio_data = 0x01; in patch_stac92hd73xx()
4591 spec->eapd_switch = 1; in patch_stac92hd73xx()
4593 spec->num_pwrs = ARRAY_SIZE(stac92hd73xx_pwr_nids); in patch_stac92hd73xx()
4594 spec->pwr_nids = stac92hd73xx_pwr_nids; in patch_stac92hd73xx()
4596 spec->gen.own_eapd_ctl = 1; in patch_stac92hd73xx()
4597 spec->gen.power_down_unused = 1; in patch_stac92hd73xx()
4603 if (!spec->volknob_init) in patch_stac92hd73xx()
4612 /* Don't GPIO-mute speakers if there are no internal speakers, because in patch_stac92hd73xx()
4615 if (spec->eapd_switch && !has_builtin_speaker(codec)) in patch_stac92hd73xx()
4616 spec->eapd_switch = 0; in patch_stac92hd73xx()
4618 codec->proc_widget_hook = stac92hd7x_proc_hook; in patch_stac92hd73xx()
4627 struct sigmatel_spec *spec = codec->spec; in stac_setup_gpio()
4629 spec->gpio_mask |= spec->eapd_mask; in stac_setup_gpio()
4630 if (spec->gpio_led) { in stac_setup_gpio()
4631 if (!spec->vref_mute_led_nid) { in stac_setup_gpio()
4632 spec->gpio_mask |= spec->gpio_led; in stac_setup_gpio()
4633 spec->gpio_dir |= spec->gpio_led; in stac_setup_gpio()
4634 spec->gpio_data |= spec->gpio_led; in stac_setup_gpio()
4636 codec->power_filter = stac_vref_led_power_filter; in stac_setup_gpio()
4640 if (spec->mic_mute_led_gpio) { in stac_setup_gpio()
4641 spec->gpio_mask |= spec->mic_mute_led_gpio; in stac_setup_gpio()
4642 spec->gpio_dir |= spec->mic_mute_led_gpio; in stac_setup_gpio()
4643 spec->mic_enabled = 0; in stac_setup_gpio()
4644 spec->gpio_data |= spec->mic_mute_led_gpio; in stac_setup_gpio()
4659 codec->core.power_caps &= ~AC_PWRST_EPSS; in patch_stac92hd83xxx()
4661 spec = codec->spec; in patch_stac92hd83xxx()
4662 codec->power_save_node = 1; in patch_stac92hd83xxx()
4663 spec->linear_tone_beep = 0; in patch_stac92hd83xxx()
4664 spec->gen.own_eapd_ctl = 1; in patch_stac92hd83xxx()
4665 spec->gen.power_down_unused = 1; in patch_stac92hd83xxx()
4666 spec->gen.mixer_nid = 0x1b; in patch_stac92hd83xxx()
4668 spec->gen.beep_nid = 0x21; /* digital beep */ in patch_stac92hd83xxx()
4669 spec->pwr_nids = stac92hd83xxx_pwr_nids; in patch_stac92hd83xxx()
4670 spec->num_pwrs = ARRAY_SIZE(stac92hd83xxx_pwr_nids); in patch_stac92hd83xxx()
4671 spec->default_polarity = -1; /* no default cfg */ in patch_stac92hd83xxx()
4687 codec->proc_widget_hook = stac92hd_proc_hook; in patch_stac92hd83xxx()
4708 codec->core.power_caps &= ~AC_PWRST_EPSS; in patch_stac92hd95()
4710 spec = codec->spec; in patch_stac92hd95()
4711 codec->power_save_node = 1; in patch_stac92hd95()
4712 spec->linear_tone_beep = 0; in patch_stac92hd95()
4713 spec->gen.own_eapd_ctl = 1; in patch_stac92hd95()
4714 spec->gen.power_down_unused = 1; in patch_stac92hd95()
4716 spec->gen.beep_nid = 0x19; /* digital beep */ in patch_stac92hd95()
4717 spec->pwr_nids = stac92hd95_pwr_nids; in patch_stac92hd95()
4718 spec->num_pwrs = ARRAY_SIZE(stac92hd95_pwr_nids); in patch_stac92hd95()
4719 spec->default_polarity = 0; in patch_stac92hd95()
4733 codec->proc_widget_hook = stac92hd_proc_hook; in patch_stac92hd95()
4750 spec = codec->spec; in patch_stac92hd71bxx()
4752 /* codec->power_save_node = 1; */ in patch_stac92hd71bxx()
4753 spec->linear_tone_beep = 0; in patch_stac92hd71bxx()
4754 spec->gen.own_eapd_ctl = 1; in patch_stac92hd71bxx()
4755 spec->gen.power_down_unused = 1; in patch_stac92hd71bxx()
4756 spec->gen.mixer_nid = 0x17; in patch_stac92hd71bxx()
4757 spec->have_spdif_mux = 1; in patch_stac92hd71bxx()
4760 spec->gpio_mask = 0x01; in patch_stac92hd71bxx()
4761 spec->gpio_dir = 0x01; in patch_stac92hd71bxx()
4762 spec->gpio_data = 0x01; in patch_stac92hd71bxx()
4764 switch (codec->core.vendor_id) { in patch_stac92hd71bxx()
4770 if ((codec->core.revision_id & 0xf) == 0 || in patch_stac92hd71bxx()
4771 (codec->core.revision_id & 0xf) == 1) in patch_stac92hd71bxx()
4772 spec->stream_delay = 40; /* 40 milliseconds */ in patch_stac92hd71bxx()
4780 if ((codec->core.revision_id & 0xf) == 1) in patch_stac92hd71bxx()
4781 spec->stream_delay = 40; /* 40 milliseconds */ in patch_stac92hd71bxx()
4796 spec->aloopback_ctl = &stac92hd71bxx_loopback; in patch_stac92hd71bxx()
4797 spec->aloopback_mask = 0x50; in patch_stac92hd71bxx()
4798 spec->aloopback_shift = 0; in patch_stac92hd71bxx()
4800 spec->powerdown_adcs = 1; in patch_stac92hd71bxx()
4801 spec->gen.beep_nid = 0x26; /* digital beep */ in patch_stac92hd71bxx()
4802 spec->num_pwrs = ARRAY_SIZE(stac92hd71bxx_pwr_nids); in patch_stac92hd71bxx()
4803 spec->pwr_nids = stac92hd71bxx_pwr_nids; in patch_stac92hd71bxx()
4817 codec->proc_widget_hook = stac92hd7x_proc_hook; in patch_stac92hd71bxx()
4833 spec = codec->spec; in patch_stac922x()
4834 spec->linear_tone_beep = 1; in patch_stac922x()
4835 spec->gen.own_eapd_ctl = 1; in patch_stac922x()
4875 spec = codec->spec; in patch_stac927x()
4876 spec->linear_tone_beep = 1; in patch_stac927x()
4877 spec->gen.own_eapd_ctl = 1; in patch_stac927x()
4878 spec->have_spdif_mux = 1; in patch_stac927x()
4879 spec->spdif_labels = stac927x_spdif_labels; in patch_stac927x()
4881 spec->gen.beep_nid = 0x23; /* digital beep */ in patch_stac927x()
4884 spec->eapd_mask = spec->gpio_mask = 0x01; in patch_stac927x()
4885 spec->gpio_dir = spec->gpio_data = 0x01; in patch_stac927x()
4887 spec->aloopback_ctl = &stac927x_loopback; in patch_stac927x()
4888 spec->aloopback_mask = 0x40; in patch_stac927x()
4889 spec->aloopback_shift = 0; in patch_stac927x()
4890 spec->eapd_switch = 1; in patch_stac927x()
4896 if (!spec->volknob_init) in patch_stac927x()
4905 codec->proc_widget_hook = stac927x_proc_hook; in patch_stac927x()
4911 * is set to RIRB properly), it results in the silence output in patch_stac927x()
4915 * in hda_intel.c). in patch_stac927x()
4917 codec->bus->core.needs_damn_long_delay = 1; in patch_stac927x()
4933 spec = codec->spec; in patch_stac9205()
4934 spec->linear_tone_beep = 1; in patch_stac9205()
4935 spec->gen.own_eapd_ctl = 1; in patch_stac9205()
4936 spec->have_spdif_mux = 1; in patch_stac9205()
4938 spec->gen.beep_nid = 0x23; /* digital beep */ in patch_stac9205()
4941 spec->aloopback_ctl = &stac9205_loopback; in patch_stac9205()
4943 spec->aloopback_mask = 0x40; in patch_stac9205()
4944 spec->aloopback_shift = 0; in patch_stac9205()
4947 spec->eapd_mask = spec->gpio_mask = spec->gpio_dir = 0x1; in patch_stac9205()
4948 spec->gpio_data = 0x01; in patch_stac9205()
4951 spec->eapd_switch = 1; in patch_stac9205()
4963 codec->proc_widget_hook = stac9205_proc_hook; in patch_stac9205()
4975 {0x15, AC_VERB_SET_CONNECT_SEL, 0x1}, /* mic-sel: 0a,0d,14,02 */
4976 {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, /* Mic-in -> 0x9 */
5020 spec = codec->spec; in patch_stac9872()
5021 spec->linear_tone_beep = 1; in patch_stac9872()
5022 spec->gen.own_eapd_ctl = 1; in patch_stac9872()
5033 return -EINVAL; in patch_stac9872()
5155 MODULE_DESCRIPTION("IDT/Sigmatel HD-audio codec");