2 * Universal Interface for Intel High Definition Audio Codec
4 * HD audio interface patch for SigmaTel STAC92xx
6 * Copyright (c) 2005 Embedded Alley Solutions, Inc.
7 * Matt Porter <mporter@embeddedalley.com>
9 * Based on patch_cmedia.c and patch_realtek.c
10 * Copyright (c) 2004 Takashi Iwai <tiwai@suse.de>
12 * This driver is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2 of the License, or
15 * (at your option) any later version.
17 * This driver is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
27 #include <linux/init.h>
28 #include <linux/delay.h>
29 #include <linux/slab.h>
30 #include <linux/pci.h>
31 #include <linux/dmi.h>
32 #include <linux/module.h>
33 #include <sound/core.h>
34 #include <sound/jack.h>
35 #include "hda_codec.h"
36 #include "hda_local.h"
37 #include "hda_auto_parser.h"
40 #include "hda_generic.h"
72 STAC_92HD73XX_NO_JD, /* no jack-detection */
80 STAC_ELO_VUPOINT_15MX,
81 STAC_92HD89XX_HP_FRONT_JACK,
82 STAC_92HD89XX_HP_Z1_G2_RIGHT_MIC_JACK,
83 STAC_92HD73XX_ASUS_MOBO,
89 STAC_92HD83XXX_PWR_REF,
91 STAC_DELL_VOSTRO_3500,
92 STAC_92HD83XXX_HP_cNB11_INTQUAD,
95 STAC_92HD83XXX_HP_LED,
96 STAC_92HD83XXX_HP_INV_LED,
97 STAC_92HD83XXX_HP_MIC_LED,
99 STAC_92HD83XXX_HEADSET_JACK,
103 STAC_HP_ENVY_TS_BASS,
104 STAC_HP_ENVY_TS_DAC_BIND,
105 STAC_92HD83XXX_GPIO10_EAPD,
106 STAC_92HD83XXX_MODELS
119 STAC_92HD71BXX_NO_DMIC,
120 STAC_92HD71BXX_NO_SMUX,
121 STAC_92HD71BXX_MODELS
157 STAC_922X_INTEL_MAC_GPIO,
162 STAC_D965_REF_NO_JD, /* no jack-detection */
172 STAC_DELL_BIOS_SPDIF,
183 struct sigmatel_spec {
184 struct hda_gen_spec gen;
186 unsigned int eapd_switch: 1;
187 unsigned int linear_tone_beep:1;
188 unsigned int headset_jack:1; /* 4-pin headset jack (hp + mono mic) */
189 unsigned int volknob_init:1; /* special volume-knob initialization */
190 unsigned int powerdown_adcs:1;
191 unsigned int have_spdif_mux:1;
194 unsigned int eapd_mask;
195 unsigned int gpio_mask;
196 unsigned int gpio_dir;
197 unsigned int gpio_data;
198 unsigned int gpio_mute;
199 unsigned int gpio_led;
200 unsigned int gpio_led_polarity;
201 unsigned int vref_mute_led_nid; /* pin NID for mute-LED vref control */
202 unsigned int vref_led;
203 int default_polarity;
205 unsigned int mic_mute_led_gpio; /* capture mute LED GPIO */
206 unsigned int mic_enabled; /* current mic mute state (bitmask) */
209 unsigned int stream_delay;
211 /* analog loopback */
212 const struct snd_kcontrol_new *aloopback_ctl;
213 unsigned int aloopback;
214 unsigned char aloopback_mask;
215 unsigned char aloopback_shift;
217 /* power management */
218 unsigned int power_map_bits;
219 unsigned int num_pwrs;
220 const hda_nid_t *pwr_nids;
221 unsigned int active_adcs;
224 hda_nid_t anabeep_nid;
227 const char * const *spdif_labels;
228 struct hda_input_mux spdif_mux;
229 unsigned int cur_smux[2];
232 #define AC_VERB_IDT_SET_POWER_MAP 0x7ec
233 #define AC_VERB_IDT_GET_POWER_MAP 0xfec
235 static const hda_nid_t stac92hd73xx_pwr_nids[8] = {
236 0x0a, 0x0b, 0x0c, 0xd, 0x0e,
240 static const hda_nid_t stac92hd83xxx_pwr_nids[7] = {
241 0x0a, 0x0b, 0x0c, 0xd, 0x0e,
245 static const hda_nid_t stac92hd71bxx_pwr_nids[3] = {
253 static void stac_playback_pcm_hook(struct hda_pcm_stream *hinfo,
254 struct hda_codec *codec,
255 struct snd_pcm_substream *substream,
258 struct sigmatel_spec *spec = codec->spec;
259 if (action == HDA_GEN_PCM_ACT_OPEN && spec->stream_delay)
260 msleep(spec->stream_delay);
263 static void stac_capture_pcm_hook(struct hda_pcm_stream *hinfo,
264 struct hda_codec *codec,
265 struct snd_pcm_substream *substream,
268 struct sigmatel_spec *spec = codec->spec;
271 if (!spec->powerdown_adcs)
274 for (i = 0; i < spec->gen.num_all_adcs; i++) {
275 if (spec->gen.all_adcs[i] == hinfo->nid) {
282 case HDA_GEN_PCM_ACT_OPEN:
284 snd_hda_codec_write(codec, hinfo->nid, 0,
285 AC_VERB_SET_POWER_STATE, AC_PWRST_D0);
286 spec->active_adcs |= (1 << idx);
288 case HDA_GEN_PCM_ACT_CLOSE:
289 snd_hda_codec_write(codec, hinfo->nid, 0,
290 AC_VERB_SET_POWER_STATE, AC_PWRST_D3);
291 spec->active_adcs &= ~(1 << idx);
297 * Early 2006 Intel Macintoshes with STAC9220X5 codecs seem to have a
298 * funky external mute control using GPIO pins.
301 static void stac_gpio_set(struct hda_codec *codec, unsigned int mask,
302 unsigned int dir_mask, unsigned int data)
304 unsigned int gpiostate, gpiomask, gpiodir;
305 hda_nid_t fg = codec->core.afg;
307 codec_dbg(codec, "%s msk %x dir %x gpio %x\n", __func__, mask, dir_mask, data);
309 gpiostate = snd_hda_codec_read(codec, fg, 0,
310 AC_VERB_GET_GPIO_DATA, 0);
311 gpiostate = (gpiostate & ~dir_mask) | (data & dir_mask);
313 gpiomask = snd_hda_codec_read(codec, fg, 0,
314 AC_VERB_GET_GPIO_MASK, 0);
317 gpiodir = snd_hda_codec_read(codec, fg, 0,
318 AC_VERB_GET_GPIO_DIRECTION, 0);
321 /* Configure GPIOx as CMOS */
322 snd_hda_codec_write(codec, fg, 0, 0x7e7, 0);
324 snd_hda_codec_write(codec, fg, 0,
325 AC_VERB_SET_GPIO_MASK, gpiomask);
326 snd_hda_codec_read(codec, fg, 0,
327 AC_VERB_SET_GPIO_DIRECTION, gpiodir); /* sync */
331 snd_hda_codec_read(codec, fg, 0,
332 AC_VERB_SET_GPIO_DATA, gpiostate); /* sync */
335 /* hook for controlling mic-mute LED GPIO */
336 static void stac_capture_led_hook(struct hda_codec *codec,
337 struct snd_kcontrol *kcontrol,
338 struct snd_ctl_elem_value *ucontrol)
340 struct sigmatel_spec *spec = codec->spec;
342 bool cur_mute, prev_mute;
344 if (!kcontrol || !ucontrol)
347 mask = 1U << snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
348 prev_mute = !spec->mic_enabled;
349 if (ucontrol->value.integer.value[0] ||
350 ucontrol->value.integer.value[1])
351 spec->mic_enabled |= mask;
353 spec->mic_enabled &= ~mask;
354 cur_mute = !spec->mic_enabled;
355 if (cur_mute != prev_mute) {
357 spec->gpio_data |= spec->mic_mute_led_gpio;
359 spec->gpio_data &= ~spec->mic_mute_led_gpio;
360 stac_gpio_set(codec, spec->gpio_mask,
361 spec->gpio_dir, spec->gpio_data);
365 static int stac_vrefout_set(struct hda_codec *codec,
366 hda_nid_t nid, unsigned int new_vref)
370 codec_dbg(codec, "%s, nid %x ctl %x\n", __func__, nid, new_vref);
371 pinctl = snd_hda_codec_read(codec, nid, 0,
372 AC_VERB_GET_PIN_WIDGET_CONTROL, 0);
378 pinctl &= ~AC_PINCTL_VREFEN;
379 pinctl |= (new_vref & AC_PINCTL_VREFEN);
381 error = snd_hda_set_pin_ctl_cache(codec, nid, pinctl);
388 /* prevent codec AFG to D3 state when vref-out pin is used for mute LED */
389 /* this hook is set in stac_setup_gpio() */
390 static unsigned int stac_vref_led_power_filter(struct hda_codec *codec,
392 unsigned int power_state)
394 if (nid == codec->core.afg && power_state == AC_PWRST_D3)
396 return snd_hda_gen_path_power_filter(codec, nid, power_state);
399 /* update mute-LED accoring to the master switch */
400 static void stac_update_led_status(struct hda_codec *codec, int enabled)
402 struct sigmatel_spec *spec = codec->spec;
403 int muted = !enabled;
408 /* LED state is inverted on these systems */
409 if (spec->gpio_led_polarity)
412 if (!spec->vref_mute_led_nid) {
414 spec->gpio_data |= spec->gpio_led;
416 spec->gpio_data &= ~spec->gpio_led;
417 stac_gpio_set(codec, spec->gpio_mask,
418 spec->gpio_dir, spec->gpio_data);
420 spec->vref_led = muted ? AC_PINCTL_VREF_50 : AC_PINCTL_VREF_GRD;
421 stac_vrefout_set(codec, spec->vref_mute_led_nid,
426 /* vmaster hook to update mute LED */
427 static void stac_vmaster_hook(void *private_data, int val)
429 stac_update_led_status(private_data, val);
432 /* automute hook to handle GPIO mute and EAPD updates */
433 static void stac_update_outputs(struct hda_codec *codec)
435 struct sigmatel_spec *spec = codec->spec;
438 spec->gen.master_mute =
439 !(snd_hda_codec_read(codec, codec->core.afg, 0,
440 AC_VERB_GET_GPIO_DATA, 0) & spec->gpio_mute);
442 snd_hda_gen_update_outputs(codec);
444 if (spec->eapd_mask && spec->eapd_switch) {
445 unsigned int val = spec->gpio_data;
446 if (spec->gen.speaker_muted)
447 val &= ~spec->eapd_mask;
449 val |= spec->eapd_mask;
450 if (spec->gpio_data != val) {
451 spec->gpio_data = val;
452 stac_gpio_set(codec, spec->gpio_mask, spec->gpio_dir,
458 static void stac_toggle_power_map(struct hda_codec *codec, hda_nid_t nid,
459 bool enable, bool do_write)
461 struct sigmatel_spec *spec = codec->spec;
462 unsigned int idx, val;
464 for (idx = 0; idx < spec->num_pwrs; idx++) {
465 if (spec->pwr_nids[idx] == nid)
468 if (idx >= spec->num_pwrs)
473 val = spec->power_map_bits;
479 /* power down unused output ports */
480 if (val != spec->power_map_bits) {
481 spec->power_map_bits = val;
483 snd_hda_codec_write(codec, codec->core.afg, 0,
484 AC_VERB_IDT_SET_POWER_MAP, val);
488 /* update power bit per jack plug/unplug */
489 static void jack_update_power(struct hda_codec *codec,
490 struct hda_jack_callback *jack)
492 struct sigmatel_spec *spec = codec->spec;
498 if (jack && jack->nid) {
499 stac_toggle_power_map(codec, jack->nid,
500 snd_hda_jack_detect(codec, jack->nid),
505 /* update all jacks */
506 for (i = 0; i < spec->num_pwrs; i++) {
507 hda_nid_t nid = spec->pwr_nids[i];
508 if (!snd_hda_jack_tbl_get(codec, nid))
510 stac_toggle_power_map(codec, nid,
511 snd_hda_jack_detect(codec, nid),
515 snd_hda_codec_write(codec, codec->core.afg, 0,
516 AC_VERB_IDT_SET_POWER_MAP,
517 spec->power_map_bits);
520 static void stac_vref_event(struct hda_codec *codec,
521 struct hda_jack_callback *event)
525 data = snd_hda_codec_read(codec, codec->core.afg, 0,
526 AC_VERB_GET_GPIO_DATA, 0);
527 /* toggle VREF state based on GPIOx status */
528 snd_hda_codec_write(codec, codec->core.afg, 0, 0x7e0,
529 !!(data & (1 << event->private_data)));
532 /* initialize the power map and enable the power event to jacks that
533 * haven't been assigned to automute
535 static void stac_init_power_map(struct hda_codec *codec)
537 struct sigmatel_spec *spec = codec->spec;
540 for (i = 0; i < spec->num_pwrs; i++) {
541 hda_nid_t nid = spec->pwr_nids[i];
542 unsigned int def_conf = snd_hda_codec_get_pincfg(codec, nid);
543 def_conf = get_defcfg_connect(def_conf);
544 if (def_conf == AC_JACK_PORT_COMPLEX &&
545 spec->vref_mute_led_nid != nid &&
546 is_jack_detectable(codec, nid)) {
547 snd_hda_jack_detect_enable_callback(codec, nid,
550 if (def_conf == AC_JACK_PORT_NONE)
551 stac_toggle_power_map(codec, nid, false, false);
553 stac_toggle_power_map(codec, nid, true, false);
561 static inline bool get_int_hint(struct hda_codec *codec, const char *key,
564 return !snd_hda_get_int_hint(codec, key, valp);
567 /* override some hints from the hwdep entry */
568 static void stac_store_hints(struct hda_codec *codec)
570 struct sigmatel_spec *spec = codec->spec;
573 if (get_int_hint(codec, "gpio_mask", &spec->gpio_mask)) {
574 spec->eapd_mask = spec->gpio_dir = spec->gpio_data =
577 if (get_int_hint(codec, "gpio_dir", &spec->gpio_dir))
578 spec->gpio_dir &= spec->gpio_mask;
579 if (get_int_hint(codec, "gpio_data", &spec->gpio_data))
580 spec->gpio_data &= spec->gpio_mask;
581 if (get_int_hint(codec, "eapd_mask", &spec->eapd_mask))
582 spec->eapd_mask &= spec->gpio_mask;
583 if (get_int_hint(codec, "gpio_mute", &spec->gpio_mute))
584 spec->gpio_mute &= spec->gpio_mask;
585 val = snd_hda_get_bool_hint(codec, "eapd_switch");
587 spec->eapd_switch = val;
594 #define stac_aloopback_info snd_ctl_boolean_mono_info
596 static int stac_aloopback_get(struct snd_kcontrol *kcontrol,
597 struct snd_ctl_elem_value *ucontrol)
599 struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
600 unsigned int idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
601 struct sigmatel_spec *spec = codec->spec;
603 ucontrol->value.integer.value[0] = !!(spec->aloopback &
604 (spec->aloopback_mask << idx));
608 static int stac_aloopback_put(struct snd_kcontrol *kcontrol,
609 struct snd_ctl_elem_value *ucontrol)
611 struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
612 struct sigmatel_spec *spec = codec->spec;
613 unsigned int idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
614 unsigned int dac_mode;
615 unsigned int val, idx_val;
617 idx_val = spec->aloopback_mask << idx;
618 if (ucontrol->value.integer.value[0])
619 val = spec->aloopback | idx_val;
621 val = spec->aloopback & ~idx_val;
622 if (spec->aloopback == val)
625 spec->aloopback = val;
627 /* Only return the bits defined by the shift value of the
628 * first two bytes of the mask
630 dac_mode = snd_hda_codec_read(codec, codec->core.afg, 0,
631 kcontrol->private_value & 0xFFFF, 0x0);
632 dac_mode >>= spec->aloopback_shift;
634 if (spec->aloopback & idx_val) {
635 snd_hda_power_up(codec);
638 snd_hda_power_down(codec);
639 dac_mode &= ~idx_val;
642 snd_hda_codec_write_cache(codec, codec->core.afg, 0,
643 kcontrol->private_value >> 16, dac_mode);
648 #define STAC_ANALOG_LOOPBACK(verb_read, verb_write, cnt) \
650 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \
651 .name = "Analog Loopback", \
653 .info = stac_aloopback_info, \
654 .get = stac_aloopback_get, \
655 .put = stac_aloopback_put, \
656 .private_value = verb_read | (verb_write << 16), \
660 * Mute LED handling on HP laptops
663 /* check whether it's a HP laptop with a docking port */
664 static bool hp_bnb2011_with_dock(struct hda_codec *codec)
666 if (codec->core.vendor_id != 0x111d7605 &&
667 codec->core.vendor_id != 0x111d76d1)
670 switch (codec->core.subsystem_id) {
704 static bool hp_blike_system(u32 subsystem_id)
706 switch (subsystem_id) {
707 case 0x103c1473: /* HP ProBook 6550b */
734 static void set_hp_led_gpio(struct hda_codec *codec)
736 struct sigmatel_spec *spec = codec->spec;
742 gpio = snd_hda_param_read(codec, codec->core.afg, AC_PAR_GPIO_CAP);
743 gpio &= AC_GPIO_IO_COUNT;
745 spec->gpio_led = 0x08; /* GPIO 3 */
747 spec->gpio_led = 0x01; /* GPIO 0 */
751 * This method searches for the mute LED GPIO configuration
752 * provided as OEM string in SMBIOS. The format of that string
753 * is HP_Mute_LED_P_G or HP_Mute_LED_P
754 * where P can be 0 or 1 and defines mute LED GPIO control state (low/high)
755 * that corresponds to the NOT muted state of the master volume
756 * and G is the index of the GPIO to use as the mute LED control (0..9)
757 * If _G portion is missing it is assigned based on the codec ID
759 * So, HP B-series like systems may have HP_Mute_LED_0 (current models)
760 * or HP_Mute_LED_0_3 (future models) OEM SMBIOS strings
763 * The dv-series laptops don't seem to have the HP_Mute_LED* strings in
764 * SMBIOS - at least the ones I have seen do not have them - which include
765 * my own system (HP Pavilion dv6-1110ax) and my cousin's
766 * HP Pavilion dv9500t CTO.
767 * Need more information on whether it is true across the entire series.
770 static int find_mute_led_cfg(struct hda_codec *codec, int default_polarity)
772 struct sigmatel_spec *spec = codec->spec;
773 const struct dmi_device *dev = NULL;
775 if (get_int_hint(codec, "gpio_led", &spec->gpio_led)) {
776 get_int_hint(codec, "gpio_led_polarity",
777 &spec->gpio_led_polarity);
781 while ((dev = dmi_find_device(DMI_DEV_TYPE_OEM_STRING, NULL, dev))) {
782 if (sscanf(dev->name, "HP_Mute_LED_%u_%x",
783 &spec->gpio_led_polarity,
784 &spec->gpio_led) == 2) {
785 unsigned int max_gpio;
786 max_gpio = snd_hda_param_read(codec, codec->core.afg,
788 max_gpio &= AC_GPIO_IO_COUNT;
789 if (spec->gpio_led < max_gpio)
790 spec->gpio_led = 1 << spec->gpio_led;
792 spec->vref_mute_led_nid = spec->gpio_led;
795 if (sscanf(dev->name, "HP_Mute_LED_%u",
796 &spec->gpio_led_polarity) == 1) {
797 set_hp_led_gpio(codec);
800 /* BIOS bug: unfilled OEM string */
801 if (strstr(dev->name, "HP_Mute_LED_P_G")) {
802 set_hp_led_gpio(codec);
803 if (default_polarity >= 0)
804 spec->gpio_led_polarity = default_polarity;
806 spec->gpio_led_polarity = 1;
812 * Fallback case - if we don't find the DMI strings,
813 * we statically set the GPIO - if not a B-series system
814 * and default polarity is provided
816 if (!hp_blike_system(codec->core.subsystem_id) &&
817 (default_polarity == 0 || default_polarity == 1)) {
818 set_hp_led_gpio(codec);
819 spec->gpio_led_polarity = default_polarity;
825 /* check whether a built-in speaker is included in parsed pins */
826 static bool has_builtin_speaker(struct hda_codec *codec)
828 struct sigmatel_spec *spec = codec->spec;
832 if (spec->gen.autocfg.line_out_type == AUTO_PIN_SPEAKER_OUT) {
833 nid_pin = spec->gen.autocfg.line_out_pins;
834 nids = spec->gen.autocfg.line_outs;
836 nid_pin = spec->gen.autocfg.speaker_pins;
837 nids = spec->gen.autocfg.speaker_outs;
840 for (i = 0; i < nids; i++) {
841 unsigned int def_conf = snd_hda_codec_get_pincfg(codec, nid_pin[i]);
842 if (snd_hda_get_input_pin_attr(def_conf) == INPUT_PIN_ATTR_INT)
852 /* create PC beep volume controls */
853 static int stac_auto_create_beep_ctls(struct hda_codec *codec,
856 struct sigmatel_spec *spec = codec->spec;
857 u32 caps = query_amp_caps(codec, nid, HDA_OUTPUT);
858 struct snd_kcontrol_new *knew;
859 static struct snd_kcontrol_new abeep_mute_ctl =
860 HDA_CODEC_MUTE(NULL, 0, 0, 0);
861 static struct snd_kcontrol_new dbeep_mute_ctl =
862 HDA_CODEC_MUTE_BEEP(NULL, 0, 0, 0);
863 static struct snd_kcontrol_new beep_vol_ctl =
864 HDA_CODEC_VOLUME(NULL, 0, 0, 0);
866 /* check for mute support for the amp */
867 if ((caps & AC_AMPCAP_MUTE) >> AC_AMPCAP_MUTE_SHIFT) {
868 const struct snd_kcontrol_new *temp;
869 if (spec->anabeep_nid == nid)
870 temp = &abeep_mute_ctl;
872 temp = &dbeep_mute_ctl;
873 knew = snd_hda_gen_add_kctl(&spec->gen,
874 "Beep Playback Switch", temp);
877 knew->private_value =
878 HDA_COMPOSE_AMP_VAL(nid, 1, 0, HDA_OUTPUT);
881 /* check to see if there is volume support for the amp */
882 if ((caps & AC_AMPCAP_NUM_STEPS) >> AC_AMPCAP_NUM_STEPS_SHIFT) {
883 knew = snd_hda_gen_add_kctl(&spec->gen,
884 "Beep Playback Volume",
888 knew->private_value =
889 HDA_COMPOSE_AMP_VAL(nid, 1, 0, HDA_OUTPUT);
894 #ifdef CONFIG_SND_HDA_INPUT_BEEP
895 #define stac_dig_beep_switch_info snd_ctl_boolean_mono_info
897 static int stac_dig_beep_switch_get(struct snd_kcontrol *kcontrol,
898 struct snd_ctl_elem_value *ucontrol)
900 struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
901 ucontrol->value.integer.value[0] = codec->beep->enabled;
905 static int stac_dig_beep_switch_put(struct snd_kcontrol *kcontrol,
906 struct snd_ctl_elem_value *ucontrol)
908 struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
909 return snd_hda_enable_beep_device(codec, ucontrol->value.integer.value[0]);
912 static const struct snd_kcontrol_new stac_dig_beep_ctrl = {
913 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
914 .name = "Beep Playback Switch",
915 .info = stac_dig_beep_switch_info,
916 .get = stac_dig_beep_switch_get,
917 .put = stac_dig_beep_switch_put,
920 static int stac_beep_switch_ctl(struct hda_codec *codec)
922 struct sigmatel_spec *spec = codec->spec;
924 if (!snd_hda_gen_add_kctl(&spec->gen, NULL, &stac_dig_beep_ctrl))
931 * SPDIF-out mux controls
934 static int stac_smux_enum_info(struct snd_kcontrol *kcontrol,
935 struct snd_ctl_elem_info *uinfo)
937 struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
938 struct sigmatel_spec *spec = codec->spec;
939 return snd_hda_input_mux_info(&spec->spdif_mux, uinfo);
942 static int stac_smux_enum_get(struct snd_kcontrol *kcontrol,
943 struct snd_ctl_elem_value *ucontrol)
945 struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
946 struct sigmatel_spec *spec = codec->spec;
947 unsigned int smux_idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
949 ucontrol->value.enumerated.item[0] = spec->cur_smux[smux_idx];
953 static int stac_smux_enum_put(struct snd_kcontrol *kcontrol,
954 struct snd_ctl_elem_value *ucontrol)
956 struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
957 struct sigmatel_spec *spec = codec->spec;
958 unsigned int smux_idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
960 return snd_hda_input_mux_put(codec, &spec->spdif_mux, ucontrol,
961 spec->gen.autocfg.dig_out_pins[smux_idx],
962 &spec->cur_smux[smux_idx]);
965 static const struct snd_kcontrol_new stac_smux_mixer = {
966 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
967 .name = "IEC958 Playback Source",
968 /* count set later */
969 .info = stac_smux_enum_info,
970 .get = stac_smux_enum_get,
971 .put = stac_smux_enum_put,
974 static const char * const stac_spdif_labels[] = {
975 "Digital Playback", "Analog Mux 1", "Analog Mux 2", NULL
978 static int stac_create_spdif_mux_ctls(struct hda_codec *codec)
980 struct sigmatel_spec *spec = codec->spec;
981 struct auto_pin_cfg *cfg = &spec->gen.autocfg;
982 const char * const *labels = spec->spdif_labels;
983 struct snd_kcontrol_new *kctl;
986 if (cfg->dig_outs < 1)
989 num_cons = snd_hda_get_num_conns(codec, cfg->dig_out_pins[0]);
994 labels = stac_spdif_labels;
995 for (i = 0; i < num_cons; i++) {
996 if (snd_BUG_ON(!labels[i]))
998 snd_hda_add_imux_item(codec, &spec->spdif_mux, labels[i], i, NULL);
1001 kctl = snd_hda_gen_add_kctl(&spec->gen, NULL, &stac_smux_mixer);
1004 kctl->count = cfg->dig_outs;
1012 static const struct hda_verb stac9200_core_init[] = {
1013 /* set dac0mux for dac converter */
1014 { 0x07, AC_VERB_SET_CONNECT_SEL, 0x00},
1018 static const struct hda_verb stac9200_eapd_init[] = {
1019 /* set dac0mux for dac converter */
1020 {0x07, AC_VERB_SET_CONNECT_SEL, 0x00},
1021 {0x08, AC_VERB_SET_EAPD_BTLENABLE, 0x02},
1025 static const struct hda_verb dell_eq_core_init[] = {
1026 /* set master volume to max value without distortion
1027 * and direct control */
1028 { 0x1f, AC_VERB_SET_VOLUME_KNOB_CONTROL, 0xec},
1032 static const struct hda_verb stac92hd73xx_core_init[] = {
1033 /* set master volume and direct control */
1034 { 0x1f, AC_VERB_SET_VOLUME_KNOB_CONTROL, 0xff},
1038 static const struct hda_verb stac92hd83xxx_core_init[] = {
1039 /* power state controls amps */
1040 { 0x01, AC_VERB_SET_EAPD, 1 << 2},
1044 static const struct hda_verb stac92hd83xxx_hp_zephyr_init[] = {
1045 { 0x22, 0x785, 0x43 },
1046 { 0x22, 0x782, 0xe0 },
1047 { 0x22, 0x795, 0x00 },
1051 static const struct hda_verb stac92hd71bxx_core_init[] = {
1052 /* set master volume and direct control */
1053 { 0x28, AC_VERB_SET_VOLUME_KNOB_CONTROL, 0xff},
1057 static const hda_nid_t stac92hd71bxx_unmute_nids[] = {
1058 /* unmute right and left channels for nodes 0x0f, 0xa, 0x0d */
1062 static const struct hda_verb stac925x_core_init[] = {
1063 /* set dac0mux for dac converter */
1064 { 0x06, AC_VERB_SET_CONNECT_SEL, 0x00},
1065 /* mute the master volume */
1066 { 0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE },
1070 static const struct hda_verb stac922x_core_init[] = {
1071 /* set master volume and direct control */
1072 { 0x16, AC_VERB_SET_VOLUME_KNOB_CONTROL, 0xff},
1076 static const struct hda_verb d965_core_init[] = {
1077 /* unmute node 0x1b */
1078 { 0x1b, AC_VERB_SET_AMP_GAIN_MUTE, 0xb000},
1079 /* select node 0x03 as DAC */
1080 { 0x0b, AC_VERB_SET_CONNECT_SEL, 0x01},
1084 static const struct hda_verb dell_3st_core_init[] = {
1085 /* don't set delta bit */
1086 {0x24, AC_VERB_SET_VOLUME_KNOB_CONTROL, 0x7f},
1087 /* unmute node 0x1b */
1088 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE, 0xb000},
1089 /* select node 0x03 as DAC */
1090 {0x0b, AC_VERB_SET_CONNECT_SEL, 0x01},
1094 static const struct hda_verb stac927x_core_init[] = {
1095 /* set master volume and direct control */
1096 { 0x24, AC_VERB_SET_VOLUME_KNOB_CONTROL, 0xff},
1097 /* enable analog pc beep path */
1098 { 0x01, AC_VERB_SET_DIGI_CONVERT_2, 1 << 5},
1102 static const struct hda_verb stac927x_volknob_core_init[] = {
1103 /* don't set delta bit */
1104 {0x24, AC_VERB_SET_VOLUME_KNOB_CONTROL, 0x7f},
1105 /* enable analog pc beep path */
1106 {0x01, AC_VERB_SET_DIGI_CONVERT_2, 1 << 5},
1110 static const struct hda_verb stac9205_core_init[] = {
1111 /* set master volume and direct control */
1112 { 0x24, AC_VERB_SET_VOLUME_KNOB_CONTROL, 0xff},
1113 /* enable analog pc beep path */
1114 { 0x01, AC_VERB_SET_DIGI_CONVERT_2, 1 << 5},
1118 static const struct snd_kcontrol_new stac92hd73xx_6ch_loopback =
1119 STAC_ANALOG_LOOPBACK(0xFA0, 0x7A1, 3);
1121 static const struct snd_kcontrol_new stac92hd73xx_8ch_loopback =
1122 STAC_ANALOG_LOOPBACK(0xFA0, 0x7A1, 4);
1124 static const struct snd_kcontrol_new stac92hd73xx_10ch_loopback =
1125 STAC_ANALOG_LOOPBACK(0xFA0, 0x7A1, 5);
1127 static const struct snd_kcontrol_new stac92hd71bxx_loopback =
1128 STAC_ANALOG_LOOPBACK(0xFA0, 0x7A0, 2);
1130 static const struct snd_kcontrol_new stac9205_loopback =
1131 STAC_ANALOG_LOOPBACK(0xFE0, 0x7E0, 1);
1133 static const struct snd_kcontrol_new stac927x_loopback =
1134 STAC_ANALOG_LOOPBACK(0xFEB, 0x7EB, 1);
1136 static const struct hda_pintbl ref9200_pin_configs[] = {
1137 { 0x08, 0x01c47010 },
1138 { 0x09, 0x01447010 },
1139 { 0x0d, 0x0221401f },
1140 { 0x0e, 0x01114010 },
1141 { 0x0f, 0x02a19020 },
1142 { 0x10, 0x01a19021 },
1143 { 0x11, 0x90100140 },
1144 { 0x12, 0x01813122 },
1148 static const struct hda_pintbl gateway9200_m4_pin_configs[] = {
1149 { 0x08, 0x400000fe },
1150 { 0x09, 0x404500f4 },
1151 { 0x0d, 0x400100f0 },
1152 { 0x0e, 0x90110010 },
1153 { 0x0f, 0x400100f1 },
1154 { 0x10, 0x02a1902e },
1155 { 0x11, 0x500000f2 },
1156 { 0x12, 0x500000f3 },
1160 static const struct hda_pintbl gateway9200_m4_2_pin_configs[] = {
1161 { 0x08, 0x400000fe },
1162 { 0x09, 0x404500f4 },
1163 { 0x0d, 0x400100f0 },
1164 { 0x0e, 0x90110010 },
1165 { 0x0f, 0x400100f1 },
1166 { 0x10, 0x02a1902e },
1167 { 0x11, 0x500000f2 },
1168 { 0x12, 0x500000f3 },
1173 STAC 9200 pin configs for
1178 static const struct hda_pintbl dell9200_d21_pin_configs[] = {
1179 { 0x08, 0x400001f0 },
1180 { 0x09, 0x400001f1 },
1181 { 0x0d, 0x02214030 },
1182 { 0x0e, 0x01014010 },
1183 { 0x0f, 0x02a19020 },
1184 { 0x10, 0x01a19021 },
1185 { 0x11, 0x90100140 },
1186 { 0x12, 0x01813122 },
1191 STAC 9200 pin configs for
1195 static const struct hda_pintbl dell9200_d22_pin_configs[] = {
1196 { 0x08, 0x400001f0 },
1197 { 0x09, 0x400001f1 },
1198 { 0x0d, 0x0221401f },
1199 { 0x0e, 0x01014010 },
1200 { 0x0f, 0x01813020 },
1201 { 0x10, 0x02a19021 },
1202 { 0x11, 0x90100140 },
1203 { 0x12, 0x400001f2 },
1208 STAC 9200 pin configs for
1209 102801C4 (Dell Dimension E310)
1216 static const struct hda_pintbl dell9200_d23_pin_configs[] = {
1217 { 0x08, 0x400001f0 },
1218 { 0x09, 0x400001f1 },
1219 { 0x0d, 0x0221401f },
1220 { 0x0e, 0x01014010 },
1221 { 0x0f, 0x01813020 },
1222 { 0x10, 0x01a19021 },
1223 { 0x11, 0x90100140 },
1224 { 0x12, 0x400001f2 },
1230 STAC 9200-32 pin configs for
1231 102801B5 (Dell Inspiron 630m)
1232 102801D8 (Dell Inspiron 640m)
1234 static const struct hda_pintbl dell9200_m21_pin_configs[] = {
1235 { 0x08, 0x40c003fa },
1236 { 0x09, 0x03441340 },
1237 { 0x0d, 0x0321121f },
1238 { 0x0e, 0x90170310 },
1239 { 0x0f, 0x408003fb },
1240 { 0x10, 0x03a11020 },
1241 { 0x11, 0x401003fc },
1242 { 0x12, 0x403003fd },
1247 STAC 9200-32 pin configs for
1248 102801C2 (Dell Latitude D620)
1250 102801CC (Dell Latitude D820)
1254 static const struct hda_pintbl dell9200_m22_pin_configs[] = {
1255 { 0x08, 0x40c003fa },
1256 { 0x09, 0x0144131f },
1257 { 0x0d, 0x0321121f },
1258 { 0x0e, 0x90170310 },
1259 { 0x0f, 0x90a70321 },
1260 { 0x10, 0x03a11020 },
1261 { 0x11, 0x401003fb },
1262 { 0x12, 0x40f000fc },
1267 STAC 9200-32 pin configs for
1268 102801CE (Dell XPS M1710)
1269 102801CF (Dell Precision M90)
1271 static const struct hda_pintbl dell9200_m23_pin_configs[] = {
1272 { 0x08, 0x40c003fa },
1273 { 0x09, 0x01441340 },
1274 { 0x0d, 0x0421421f },
1275 { 0x0e, 0x90170310 },
1276 { 0x0f, 0x408003fb },
1277 { 0x10, 0x04a1102e },
1278 { 0x11, 0x90170311 },
1279 { 0x12, 0x403003fc },
1284 STAC 9200-32 pin configs for
1287 102801CB (Dell Latitude 120L)
1290 static const struct hda_pintbl dell9200_m24_pin_configs[] = {
1291 { 0x08, 0x40c003fa },
1292 { 0x09, 0x404003fb },
1293 { 0x0d, 0x0321121f },
1294 { 0x0e, 0x90170310 },
1295 { 0x0f, 0x408003fc },
1296 { 0x10, 0x03a11020 },
1297 { 0x11, 0x401003fd },
1298 { 0x12, 0x403003fe },
1303 STAC 9200-32 pin configs for
1304 102801BD (Dell Inspiron E1505n)
1308 static const struct hda_pintbl dell9200_m25_pin_configs[] = {
1309 { 0x08, 0x40c003fa },
1310 { 0x09, 0x01441340 },
1311 { 0x0d, 0x0421121f },
1312 { 0x0e, 0x90170310 },
1313 { 0x0f, 0x408003fb },
1314 { 0x10, 0x04a11020 },
1315 { 0x11, 0x401003fc },
1316 { 0x12, 0x403003fd },
1321 STAC 9200-32 pin configs for
1322 102801F5 (Dell Inspiron 1501)
1325 static const struct hda_pintbl dell9200_m26_pin_configs[] = {
1326 { 0x08, 0x40c003fa },
1327 { 0x09, 0x404003fb },
1328 { 0x0d, 0x0421121f },
1329 { 0x0e, 0x90170310 },
1330 { 0x0f, 0x408003fc },
1331 { 0x10, 0x04a11020 },
1332 { 0x11, 0x401003fd },
1333 { 0x12, 0x403003fe },
1339 102801CD (Dell Inspiron E1705/9400)
1341 static const struct hda_pintbl dell9200_m27_pin_configs[] = {
1342 { 0x08, 0x40c003fa },
1343 { 0x09, 0x01441340 },
1344 { 0x0d, 0x0421121f },
1345 { 0x0e, 0x90170310 },
1346 { 0x0f, 0x90170310 },
1347 { 0x10, 0x04a11020 },
1348 { 0x11, 0x90170310 },
1349 { 0x12, 0x40f003fc },
1353 static const struct hda_pintbl oqo9200_pin_configs[] = {
1354 { 0x08, 0x40c000f0 },
1355 { 0x09, 0x404000f1 },
1356 { 0x0d, 0x0221121f },
1357 { 0x0e, 0x02211210 },
1358 { 0x0f, 0x90170111 },
1359 { 0x10, 0x90a70120 },
1360 { 0x11, 0x400000f2 },
1361 { 0x12, 0x400000f3 },
1367 * 18881000 Amigaone X1000
1369 static const struct hda_pintbl nemo_pin_configs[] = {
1370 { 0x0a, 0x02214020 }, /* Front panel HP socket */
1371 { 0x0b, 0x02a19080 }, /* Front Mic */
1372 { 0x0c, 0x0181304e }, /* Line in */
1373 { 0x0d, 0x01014010 }, /* Line out */
1374 { 0x0e, 0x01a19040 }, /* Rear Mic */
1375 { 0x0f, 0x01011012 }, /* Rear speakers */
1376 { 0x10, 0x01016011 }, /* Center speaker */
1377 { 0x11, 0x01012014 }, /* Side speakers (7.1) */
1378 { 0x12, 0x103301f0 }, /* Motherboard CD line in connector */
1379 { 0x13, 0x411111f0 }, /* Unused */
1380 { 0x14, 0x411111f0 }, /* Unused */
1381 { 0x21, 0x01442170 }, /* S/PDIF line out */
1382 { 0x22, 0x411111f0 }, /* Unused */
1383 { 0x23, 0x411111f0 }, /* Unused */
1387 static void stac9200_fixup_panasonic(struct hda_codec *codec,
1388 const struct hda_fixup *fix, int action)
1390 struct sigmatel_spec *spec = codec->spec;
1392 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
1393 spec->gpio_mask = spec->gpio_dir = 0x09;
1394 spec->gpio_data = 0x00;
1395 /* CF-74 has no headphone detection, and the driver should *NOT*
1396 * do detection and HP/speaker toggle because the hardware does it.
1398 spec->gen.suppress_auto_mute = 1;
1403 static const struct hda_fixup stac9200_fixups[] = {
1405 .type = HDA_FIXUP_PINS,
1406 .v.pins = ref9200_pin_configs,
1409 .type = HDA_FIXUP_PINS,
1410 .v.pins = oqo9200_pin_configs,
1412 .chain_id = STAC_9200_EAPD_INIT,
1414 [STAC_9200_DELL_D21] = {
1415 .type = HDA_FIXUP_PINS,
1416 .v.pins = dell9200_d21_pin_configs,
1418 [STAC_9200_DELL_D22] = {
1419 .type = HDA_FIXUP_PINS,
1420 .v.pins = dell9200_d22_pin_configs,
1422 [STAC_9200_DELL_D23] = {
1423 .type = HDA_FIXUP_PINS,
1424 .v.pins = dell9200_d23_pin_configs,
1426 [STAC_9200_DELL_M21] = {
1427 .type = HDA_FIXUP_PINS,
1428 .v.pins = dell9200_m21_pin_configs,
1430 [STAC_9200_DELL_M22] = {
1431 .type = HDA_FIXUP_PINS,
1432 .v.pins = dell9200_m22_pin_configs,
1434 [STAC_9200_DELL_M23] = {
1435 .type = HDA_FIXUP_PINS,
1436 .v.pins = dell9200_m23_pin_configs,
1438 [STAC_9200_DELL_M24] = {
1439 .type = HDA_FIXUP_PINS,
1440 .v.pins = dell9200_m24_pin_configs,
1442 [STAC_9200_DELL_M25] = {
1443 .type = HDA_FIXUP_PINS,
1444 .v.pins = dell9200_m25_pin_configs,
1446 [STAC_9200_DELL_M26] = {
1447 .type = HDA_FIXUP_PINS,
1448 .v.pins = dell9200_m26_pin_configs,
1450 [STAC_9200_DELL_M27] = {
1451 .type = HDA_FIXUP_PINS,
1452 .v.pins = dell9200_m27_pin_configs,
1455 .type = HDA_FIXUP_PINS,
1456 .v.pins = gateway9200_m4_pin_configs,
1458 .chain_id = STAC_9200_EAPD_INIT,
1460 [STAC_9200_M4_2] = {
1461 .type = HDA_FIXUP_PINS,
1462 .v.pins = gateway9200_m4_2_pin_configs,
1464 .chain_id = STAC_9200_EAPD_INIT,
1466 [STAC_9200_PANASONIC] = {
1467 .type = HDA_FIXUP_FUNC,
1468 .v.func = stac9200_fixup_panasonic,
1470 [STAC_9200_EAPD_INIT] = {
1471 .type = HDA_FIXUP_VERBS,
1472 .v.verbs = (const struct hda_verb[]) {
1473 {0x08, AC_VERB_SET_EAPD_BTLENABLE, 0x02},
1479 static const struct hda_model_fixup stac9200_models[] = {
1480 { .id = STAC_REF, .name = "ref" },
1481 { .id = STAC_9200_OQO, .name = "oqo" },
1482 { .id = STAC_9200_DELL_D21, .name = "dell-d21" },
1483 { .id = STAC_9200_DELL_D22, .name = "dell-d22" },
1484 { .id = STAC_9200_DELL_D23, .name = "dell-d23" },
1485 { .id = STAC_9200_DELL_M21, .name = "dell-m21" },
1486 { .id = STAC_9200_DELL_M22, .name = "dell-m22" },
1487 { .id = STAC_9200_DELL_M23, .name = "dell-m23" },
1488 { .id = STAC_9200_DELL_M24, .name = "dell-m24" },
1489 { .id = STAC_9200_DELL_M25, .name = "dell-m25" },
1490 { .id = STAC_9200_DELL_M26, .name = "dell-m26" },
1491 { .id = STAC_9200_DELL_M27, .name = "dell-m27" },
1492 { .id = STAC_9200_M4, .name = "gateway-m4" },
1493 { .id = STAC_9200_M4_2, .name = "gateway-m4-2" },
1494 { .id = STAC_9200_PANASONIC, .name = "panasonic" },
1498 static const struct snd_pci_quirk stac9200_fixup_tbl[] = {
1499 /* SigmaTel reference board */
1500 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2668,
1501 "DFI LanParty", STAC_REF),
1502 SND_PCI_QUIRK(PCI_VENDOR_ID_DFI, 0x3101,
1503 "DFI LanParty", STAC_REF),
1504 /* Dell laptops have BIOS problem */
1505 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01a8,
1506 "unknown Dell", STAC_9200_DELL_D21),
1507 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01b5,
1508 "Dell Inspiron 630m", STAC_9200_DELL_M21),
1509 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01bd,
1510 "Dell Inspiron E1505n", STAC_9200_DELL_M25),
1511 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01c0,
1512 "unknown Dell", STAC_9200_DELL_D22),
1513 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01c1,
1514 "unknown Dell", STAC_9200_DELL_D22),
1515 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01c2,
1516 "Dell Latitude D620", STAC_9200_DELL_M22),
1517 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01c5,
1518 "unknown Dell", STAC_9200_DELL_D23),
1519 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01c7,
1520 "unknown Dell", STAC_9200_DELL_D23),
1521 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01c8,
1522 "unknown Dell", STAC_9200_DELL_M22),
1523 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01c9,
1524 "unknown Dell", STAC_9200_DELL_M24),
1525 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01ca,
1526 "unknown Dell", STAC_9200_DELL_M24),
1527 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01cb,
1528 "Dell Latitude 120L", STAC_9200_DELL_M24),
1529 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01cc,
1530 "Dell Latitude D820", STAC_9200_DELL_M22),
1531 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01cd,
1532 "Dell Inspiron E1705/9400", STAC_9200_DELL_M27),
1533 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01ce,
1534 "Dell XPS M1710", STAC_9200_DELL_M23),
1535 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01cf,
1536 "Dell Precision M90", STAC_9200_DELL_M23),
1537 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01d3,
1538 "unknown Dell", STAC_9200_DELL_M22),
1539 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01d4,
1540 "unknown Dell", STAC_9200_DELL_M22),
1541 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01d6,
1542 "unknown Dell", STAC_9200_DELL_M22),
1543 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01d8,
1544 "Dell Inspiron 640m", STAC_9200_DELL_M21),
1545 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01d9,
1546 "unknown Dell", STAC_9200_DELL_D23),
1547 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01da,
1548 "unknown Dell", STAC_9200_DELL_D23),
1549 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01de,
1550 "unknown Dell", STAC_9200_DELL_D21),
1551 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01e3,
1552 "unknown Dell", STAC_9200_DELL_D23),
1553 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01e8,
1554 "unknown Dell", STAC_9200_DELL_D21),
1555 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01ee,
1556 "unknown Dell", STAC_9200_DELL_M25),
1557 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01ef,
1558 "unknown Dell", STAC_9200_DELL_M25),
1559 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01f5,
1560 "Dell Inspiron 1501", STAC_9200_DELL_M26),
1561 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01f6,
1562 "unknown Dell", STAC_9200_DELL_M26),
1563 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0201,
1564 "Dell Latitude D430", STAC_9200_DELL_M22),
1566 SND_PCI_QUIRK(0x10f7, 0x8338, "Panasonic CF-74", STAC_9200_PANASONIC),
1567 /* Gateway machines needs EAPD to be set on resume */
1568 SND_PCI_QUIRK(0x107b, 0x0205, "Gateway S-7110M", STAC_9200_M4),
1569 SND_PCI_QUIRK(0x107b, 0x0317, "Gateway MT3423, MX341*", STAC_9200_M4_2),
1570 SND_PCI_QUIRK(0x107b, 0x0318, "Gateway ML3019, MT3707", STAC_9200_M4_2),
1572 SND_PCI_QUIRK(0x1106, 0x3288, "OQO Model 2", STAC_9200_OQO),
1576 static const struct hda_pintbl ref925x_pin_configs[] = {
1577 { 0x07, 0x40c003f0 },
1578 { 0x08, 0x424503f2 },
1579 { 0x0a, 0x01813022 },
1580 { 0x0b, 0x02a19021 },
1581 { 0x0c, 0x90a70320 },
1582 { 0x0d, 0x02214210 },
1583 { 0x10, 0x01019020 },
1584 { 0x11, 0x9033032e },
1588 static const struct hda_pintbl stac925xM1_pin_configs[] = {
1589 { 0x07, 0x40c003f4 },
1590 { 0x08, 0x424503f2 },
1591 { 0x0a, 0x400000f3 },
1592 { 0x0b, 0x02a19020 },
1593 { 0x0c, 0x40a000f0 },
1594 { 0x0d, 0x90100210 },
1595 { 0x10, 0x400003f1 },
1596 { 0x11, 0x9033032e },
1600 static const struct hda_pintbl stac925xM1_2_pin_configs[] = {
1601 { 0x07, 0x40c003f4 },
1602 { 0x08, 0x424503f2 },
1603 { 0x0a, 0x400000f3 },
1604 { 0x0b, 0x02a19020 },
1605 { 0x0c, 0x40a000f0 },
1606 { 0x0d, 0x90100210 },
1607 { 0x10, 0x400003f1 },
1608 { 0x11, 0x9033032e },
1612 static const struct hda_pintbl stac925xM2_pin_configs[] = {
1613 { 0x07, 0x40c003f4 },
1614 { 0x08, 0x424503f2 },
1615 { 0x0a, 0x400000f3 },
1616 { 0x0b, 0x02a19020 },
1617 { 0x0c, 0x40a000f0 },
1618 { 0x0d, 0x90100210 },
1619 { 0x10, 0x400003f1 },
1620 { 0x11, 0x9033032e },
1624 static const struct hda_pintbl stac925xM2_2_pin_configs[] = {
1625 { 0x07, 0x40c003f4 },
1626 { 0x08, 0x424503f2 },
1627 { 0x0a, 0x400000f3 },
1628 { 0x0b, 0x02a19020 },
1629 { 0x0c, 0x40a000f0 },
1630 { 0x0d, 0x90100210 },
1631 { 0x10, 0x400003f1 },
1632 { 0x11, 0x9033032e },
1636 static const struct hda_pintbl stac925xM3_pin_configs[] = {
1637 { 0x07, 0x40c003f4 },
1638 { 0x08, 0x424503f2 },
1639 { 0x0a, 0x400000f3 },
1640 { 0x0b, 0x02a19020 },
1641 { 0x0c, 0x40a000f0 },
1642 { 0x0d, 0x90100210 },
1643 { 0x10, 0x400003f1 },
1644 { 0x11, 0x503303f3 },
1648 static const struct hda_pintbl stac925xM5_pin_configs[] = {
1649 { 0x07, 0x40c003f4 },
1650 { 0x08, 0x424503f2 },
1651 { 0x0a, 0x400000f3 },
1652 { 0x0b, 0x02a19020 },
1653 { 0x0c, 0x40a000f0 },
1654 { 0x0d, 0x90100210 },
1655 { 0x10, 0x400003f1 },
1656 { 0x11, 0x9033032e },
1660 static const struct hda_pintbl stac925xM6_pin_configs[] = {
1661 { 0x07, 0x40c003f4 },
1662 { 0x08, 0x424503f2 },
1663 { 0x0a, 0x400000f3 },
1664 { 0x0b, 0x02a19020 },
1665 { 0x0c, 0x40a000f0 },
1666 { 0x0d, 0x90100210 },
1667 { 0x10, 0x400003f1 },
1668 { 0x11, 0x90330320 },
1672 static const struct hda_fixup stac925x_fixups[] = {
1674 .type = HDA_FIXUP_PINS,
1675 .v.pins = ref925x_pin_configs,
1678 .type = HDA_FIXUP_PINS,
1679 .v.pins = stac925xM1_pin_configs,
1682 .type = HDA_FIXUP_PINS,
1683 .v.pins = stac925xM1_2_pin_configs,
1686 .type = HDA_FIXUP_PINS,
1687 .v.pins = stac925xM2_pin_configs,
1690 .type = HDA_FIXUP_PINS,
1691 .v.pins = stac925xM2_2_pin_configs,
1694 .type = HDA_FIXUP_PINS,
1695 .v.pins = stac925xM3_pin_configs,
1698 .type = HDA_FIXUP_PINS,
1699 .v.pins = stac925xM5_pin_configs,
1702 .type = HDA_FIXUP_PINS,
1703 .v.pins = stac925xM6_pin_configs,
1707 static const struct hda_model_fixup stac925x_models[] = {
1708 { .id = STAC_REF, .name = "ref" },
1709 { .id = STAC_M1, .name = "m1" },
1710 { .id = STAC_M1_2, .name = "m1-2" },
1711 { .id = STAC_M2, .name = "m2" },
1712 { .id = STAC_M2_2, .name = "m2-2" },
1713 { .id = STAC_M3, .name = "m3" },
1714 { .id = STAC_M5, .name = "m5" },
1715 { .id = STAC_M6, .name = "m6" },
1719 static const struct snd_pci_quirk stac925x_fixup_tbl[] = {
1720 /* SigmaTel reference board */
1721 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2668, "DFI LanParty", STAC_REF),
1722 SND_PCI_QUIRK(PCI_VENDOR_ID_DFI, 0x3101, "DFI LanParty", STAC_REF),
1723 SND_PCI_QUIRK(0x8384, 0x7632, "Stac9202 Reference Board", STAC_REF),
1725 /* Default table for unknown ID */
1726 SND_PCI_QUIRK(0x1002, 0x437b, "Gateway mobile", STAC_M2_2),
1728 /* gateway machines are checked via codec ssid */
1729 SND_PCI_QUIRK(0x107b, 0x0316, "Gateway M255", STAC_M2),
1730 SND_PCI_QUIRK(0x107b, 0x0366, "Gateway MP6954", STAC_M5),
1731 SND_PCI_QUIRK(0x107b, 0x0461, "Gateway NX560XL", STAC_M1),
1732 SND_PCI_QUIRK(0x107b, 0x0681, "Gateway NX860", STAC_M2),
1733 SND_PCI_QUIRK(0x107b, 0x0367, "Gateway MX6453", STAC_M1_2),
1734 /* Not sure about the brand name for those */
1735 SND_PCI_QUIRK(0x107b, 0x0281, "Gateway mobile", STAC_M1),
1736 SND_PCI_QUIRK(0x107b, 0x0507, "Gateway mobile", STAC_M3),
1737 SND_PCI_QUIRK(0x107b, 0x0281, "Gateway mobile", STAC_M6),
1738 SND_PCI_QUIRK(0x107b, 0x0685, "Gateway mobile", STAC_M2_2),
1742 static const struct hda_pintbl ref92hd73xx_pin_configs[] = {
1743 { 0x0a, 0x02214030 },
1744 { 0x0b, 0x02a19040 },
1745 { 0x0c, 0x01a19020 },
1746 { 0x0d, 0x02214030 },
1747 { 0x0e, 0x0181302e },
1748 { 0x0f, 0x01014010 },
1749 { 0x10, 0x01014020 },
1750 { 0x11, 0x01014030 },
1751 { 0x12, 0x02319040 },
1752 { 0x13, 0x90a000f0 },
1753 { 0x14, 0x90a000f0 },
1754 { 0x22, 0x01452050 },
1755 { 0x23, 0x01452050 },
1759 static const struct hda_pintbl dell_m6_pin_configs[] = {
1760 { 0x0a, 0x0321101f },
1761 { 0x0b, 0x4f00000f },
1762 { 0x0c, 0x4f0000f0 },
1763 { 0x0d, 0x90170110 },
1764 { 0x0e, 0x03a11020 },
1765 { 0x0f, 0x0321101f },
1766 { 0x10, 0x4f0000f0 },
1767 { 0x11, 0x4f0000f0 },
1768 { 0x12, 0x4f0000f0 },
1769 { 0x13, 0x90a60160 },
1770 { 0x14, 0x4f0000f0 },
1771 { 0x22, 0x4f0000f0 },
1772 { 0x23, 0x4f0000f0 },
1776 static const struct hda_pintbl alienware_m17x_pin_configs[] = {
1777 { 0x0a, 0x0321101f },
1778 { 0x0b, 0x0321101f },
1779 { 0x0c, 0x03a11020 },
1780 { 0x0d, 0x03014020 },
1781 { 0x0e, 0x90170110 },
1782 { 0x0f, 0x4f0000f0 },
1783 { 0x10, 0x4f0000f0 },
1784 { 0x11, 0x4f0000f0 },
1785 { 0x12, 0x4f0000f0 },
1786 { 0x13, 0x90a60160 },
1787 { 0x14, 0x4f0000f0 },
1788 { 0x22, 0x4f0000f0 },
1789 { 0x23, 0x904601b0 },
1793 static const struct hda_pintbl intel_dg45id_pin_configs[] = {
1794 { 0x0a, 0x02214230 },
1795 { 0x0b, 0x02A19240 },
1796 { 0x0c, 0x01013214 },
1797 { 0x0d, 0x01014210 },
1798 { 0x0e, 0x01A19250 },
1799 { 0x0f, 0x01011212 },
1800 { 0x10, 0x01016211 },
1804 static const struct hda_pintbl stac92hd89xx_hp_front_jack_pin_configs[] = {
1805 { 0x0a, 0x02214030 },
1806 { 0x0b, 0x02A19010 },
1810 static const struct hda_pintbl stac92hd89xx_hp_z1_g2_right_mic_jack_pin_configs[] = {
1811 { 0x0e, 0x400000f0 },
1815 static void stac92hd73xx_fixup_ref(struct hda_codec *codec,
1816 const struct hda_fixup *fix, int action)
1818 struct sigmatel_spec *spec = codec->spec;
1820 if (action != HDA_FIXUP_ACT_PRE_PROBE)
1823 snd_hda_apply_pincfgs(codec, ref92hd73xx_pin_configs);
1824 spec->gpio_mask = spec->gpio_dir = spec->gpio_data = 0;
1827 static void stac92hd73xx_fixup_dell(struct hda_codec *codec)
1829 struct sigmatel_spec *spec = codec->spec;
1831 snd_hda_apply_pincfgs(codec, dell_m6_pin_configs);
1832 spec->eapd_switch = 0;
1835 static void stac92hd73xx_fixup_dell_eq(struct hda_codec *codec,
1836 const struct hda_fixup *fix, int action)
1838 struct sigmatel_spec *spec = codec->spec;
1840 if (action != HDA_FIXUP_ACT_PRE_PROBE)
1843 stac92hd73xx_fixup_dell(codec);
1844 snd_hda_add_verbs(codec, dell_eq_core_init);
1845 spec->volknob_init = 1;
1849 static void stac92hd73xx_fixup_dell_m6_amic(struct hda_codec *codec,
1850 const struct hda_fixup *fix, int action)
1852 if (action != HDA_FIXUP_ACT_PRE_PROBE)
1855 stac92hd73xx_fixup_dell(codec);
1856 snd_hda_codec_set_pincfg(codec, 0x0b, 0x90A70170);
1860 static void stac92hd73xx_fixup_dell_m6_dmic(struct hda_codec *codec,
1861 const struct hda_fixup *fix, int action)
1863 if (action != HDA_FIXUP_ACT_PRE_PROBE)
1866 stac92hd73xx_fixup_dell(codec);
1867 snd_hda_codec_set_pincfg(codec, 0x13, 0x90A60160);
1871 static void stac92hd73xx_fixup_dell_m6_both(struct hda_codec *codec,
1872 const struct hda_fixup *fix, int action)
1874 if (action != HDA_FIXUP_ACT_PRE_PROBE)
1877 stac92hd73xx_fixup_dell(codec);
1878 snd_hda_codec_set_pincfg(codec, 0x0b, 0x90A70170);
1879 snd_hda_codec_set_pincfg(codec, 0x13, 0x90A60160);
1882 static void stac92hd73xx_fixup_alienware_m17x(struct hda_codec *codec,
1883 const struct hda_fixup *fix, int action)
1885 struct sigmatel_spec *spec = codec->spec;
1887 if (action != HDA_FIXUP_ACT_PRE_PROBE)
1890 snd_hda_apply_pincfgs(codec, alienware_m17x_pin_configs);
1891 spec->eapd_switch = 0;
1894 static void stac92hd73xx_fixup_no_jd(struct hda_codec *codec,
1895 const struct hda_fixup *fix, int action)
1897 if (action == HDA_FIXUP_ACT_PRE_PROBE)
1898 codec->no_jack_detect = 1;
1902 static void stac92hd73xx_disable_automute(struct hda_codec *codec,
1903 const struct hda_fixup *fix, int action)
1905 struct sigmatel_spec *spec = codec->spec;
1907 if (action != HDA_FIXUP_ACT_PRE_PROBE)
1910 spec->gen.suppress_auto_mute = 1;
1913 static const struct hda_fixup stac92hd73xx_fixups[] = {
1914 [STAC_92HD73XX_REF] = {
1915 .type = HDA_FIXUP_FUNC,
1916 .v.func = stac92hd73xx_fixup_ref,
1918 [STAC_DELL_M6_AMIC] = {
1919 .type = HDA_FIXUP_FUNC,
1920 .v.func = stac92hd73xx_fixup_dell_m6_amic,
1922 [STAC_DELL_M6_DMIC] = {
1923 .type = HDA_FIXUP_FUNC,
1924 .v.func = stac92hd73xx_fixup_dell_m6_dmic,
1926 [STAC_DELL_M6_BOTH] = {
1927 .type = HDA_FIXUP_FUNC,
1928 .v.func = stac92hd73xx_fixup_dell_m6_both,
1931 .type = HDA_FIXUP_FUNC,
1932 .v.func = stac92hd73xx_fixup_dell_eq,
1934 [STAC_ALIENWARE_M17X] = {
1935 .type = HDA_FIXUP_FUNC,
1936 .v.func = stac92hd73xx_fixup_alienware_m17x,
1938 [STAC_ELO_VUPOINT_15MX] = {
1939 .type = HDA_FIXUP_FUNC,
1940 .v.func = stac92hd73xx_disable_automute,
1942 [STAC_92HD73XX_INTEL] = {
1943 .type = HDA_FIXUP_PINS,
1944 .v.pins = intel_dg45id_pin_configs,
1946 [STAC_92HD73XX_NO_JD] = {
1947 .type = HDA_FIXUP_FUNC,
1948 .v.func = stac92hd73xx_fixup_no_jd,
1950 [STAC_92HD89XX_HP_FRONT_JACK] = {
1951 .type = HDA_FIXUP_PINS,
1952 .v.pins = stac92hd89xx_hp_front_jack_pin_configs,
1954 [STAC_92HD89XX_HP_Z1_G2_RIGHT_MIC_JACK] = {
1955 .type = HDA_FIXUP_PINS,
1956 .v.pins = stac92hd89xx_hp_z1_g2_right_mic_jack_pin_configs,
1958 [STAC_92HD73XX_ASUS_MOBO] = {
1959 .type = HDA_FIXUP_PINS,
1960 .v.pins = (const struct hda_pintbl[]) {
1961 /* enable 5.1 and SPDIF out */
1962 { 0x0c, 0x01014411 },
1963 { 0x0d, 0x01014410 },
1964 { 0x0e, 0x01014412 },
1965 { 0x22, 0x014b1180 },
1971 static const struct hda_model_fixup stac92hd73xx_models[] = {
1972 { .id = STAC_92HD73XX_NO_JD, .name = "no-jd" },
1973 { .id = STAC_92HD73XX_REF, .name = "ref" },
1974 { .id = STAC_92HD73XX_INTEL, .name = "intel" },
1975 { .id = STAC_DELL_M6_AMIC, .name = "dell-m6-amic" },
1976 { .id = STAC_DELL_M6_DMIC, .name = "dell-m6-dmic" },
1977 { .id = STAC_DELL_M6_BOTH, .name = "dell-m6" },
1978 { .id = STAC_DELL_EQ, .name = "dell-eq" },
1979 { .id = STAC_ALIENWARE_M17X, .name = "alienware" },
1980 { .id = STAC_ELO_VUPOINT_15MX, .name = "elo-vupoint-15mx" },
1981 { .id = STAC_92HD73XX_ASUS_MOBO, .name = "asus-mobo" },
1985 static const struct snd_pci_quirk stac92hd73xx_fixup_tbl[] = {
1986 /* SigmaTel reference board */
1987 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2668,
1988 "DFI LanParty", STAC_92HD73XX_REF),
1989 SND_PCI_QUIRK(PCI_VENDOR_ID_DFI, 0x3101,
1990 "DFI LanParty", STAC_92HD73XX_REF),
1991 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x5002,
1992 "Intel DG45ID", STAC_92HD73XX_INTEL),
1993 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x5003,
1994 "Intel DG45FC", STAC_92HD73XX_INTEL),
1995 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0254,
1996 "Dell Studio 1535", STAC_DELL_M6_DMIC),
1997 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0255,
1998 "unknown Dell", STAC_DELL_M6_DMIC),
1999 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0256,
2000 "unknown Dell", STAC_DELL_M6_BOTH),
2001 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0257,
2002 "unknown Dell", STAC_DELL_M6_BOTH),
2003 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x025e,
2004 "unknown Dell", STAC_DELL_M6_AMIC),
2005 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x025f,
2006 "unknown Dell", STAC_DELL_M6_AMIC),
2007 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0271,
2008 "unknown Dell", STAC_DELL_M6_DMIC),
2009 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0272,
2010 "unknown Dell", STAC_DELL_M6_DMIC),
2011 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x029f,
2012 "Dell Studio 1537", STAC_DELL_M6_DMIC),
2013 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x02a0,
2014 "Dell Studio 17", STAC_DELL_M6_DMIC),
2015 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x02be,
2016 "Dell Studio 1555", STAC_DELL_M6_DMIC),
2017 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x02bd,
2018 "Dell Studio 1557", STAC_DELL_M6_DMIC),
2019 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x02fe,
2020 "Dell Studio XPS 1645", STAC_DELL_M6_DMIC),
2021 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0413,
2022 "Dell Studio 1558", STAC_DELL_M6_DMIC),
2023 /* codec SSID matching */
2024 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x02a1,
2025 "Alienware M17x", STAC_ALIENWARE_M17X),
2026 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x043a,
2027 "Alienware M17x", STAC_ALIENWARE_M17X),
2028 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0490,
2029 "Alienware M17x R3", STAC_DELL_EQ),
2030 SND_PCI_QUIRK(0x1059, 0x1011,
2031 "ELO VuPoint 15MX", STAC_ELO_VUPOINT_15MX),
2032 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x1927,
2033 "HP Z1 G2", STAC_92HD89XX_HP_Z1_G2_RIGHT_MIC_JACK),
2034 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x2b17,
2035 "unknown HP", STAC_92HD89XX_HP_FRONT_JACK),
2036 SND_PCI_QUIRK(PCI_VENDOR_ID_ASUSTEK, 0x83f8, "ASUS AT4NM10",
2037 STAC_92HD73XX_ASUS_MOBO),
2041 static const struct hda_pintbl ref92hd83xxx_pin_configs[] = {
2042 { 0x0a, 0x02214030 },
2043 { 0x0b, 0x02211010 },
2044 { 0x0c, 0x02a19020 },
2045 { 0x0d, 0x02170130 },
2046 { 0x0e, 0x01014050 },
2047 { 0x0f, 0x01819040 },
2048 { 0x10, 0x01014020 },
2049 { 0x11, 0x90a3014e },
2050 { 0x1f, 0x01451160 },
2051 { 0x20, 0x98560170 },
2055 static const struct hda_pintbl dell_s14_pin_configs[] = {
2056 { 0x0a, 0x0221403f },
2057 { 0x0b, 0x0221101f },
2058 { 0x0c, 0x02a19020 },
2059 { 0x0d, 0x90170110 },
2060 { 0x0e, 0x40f000f0 },
2061 { 0x0f, 0x40f000f0 },
2062 { 0x10, 0x40f000f0 },
2063 { 0x11, 0x90a60160 },
2064 { 0x1f, 0x40f000f0 },
2065 { 0x20, 0x40f000f0 },
2069 static const struct hda_pintbl dell_vostro_3500_pin_configs[] = {
2070 { 0x0a, 0x02a11020 },
2071 { 0x0b, 0x0221101f },
2072 { 0x0c, 0x400000f0 },
2073 { 0x0d, 0x90170110 },
2074 { 0x0e, 0x400000f1 },
2075 { 0x0f, 0x400000f2 },
2076 { 0x10, 0x400000f3 },
2077 { 0x11, 0x90a60160 },
2078 { 0x1f, 0x400000f4 },
2079 { 0x20, 0x400000f5 },
2083 static const struct hda_pintbl hp_dv7_4000_pin_configs[] = {
2084 { 0x0a, 0x03a12050 },
2085 { 0x0b, 0x0321201f },
2086 { 0x0c, 0x40f000f0 },
2087 { 0x0d, 0x90170110 },
2088 { 0x0e, 0x40f000f0 },
2089 { 0x0f, 0x40f000f0 },
2090 { 0x10, 0x90170110 },
2091 { 0x11, 0xd5a30140 },
2092 { 0x1f, 0x40f000f0 },
2093 { 0x20, 0x40f000f0 },
2097 static const struct hda_pintbl hp_zephyr_pin_configs[] = {
2098 { 0x0a, 0x01813050 },
2099 { 0x0b, 0x0421201f },
2100 { 0x0c, 0x04a1205e },
2101 { 0x0d, 0x96130310 },
2102 { 0x0e, 0x96130310 },
2103 { 0x0f, 0x0101401f },
2104 { 0x10, 0x1111611f },
2105 { 0x11, 0xd5a30130 },
2109 static const struct hda_pintbl hp_cNB11_intquad_pin_configs[] = {
2110 { 0x0a, 0x40f000f0 },
2111 { 0x0b, 0x0221101f },
2112 { 0x0c, 0x02a11020 },
2113 { 0x0d, 0x92170110 },
2114 { 0x0e, 0x40f000f0 },
2115 { 0x0f, 0x92170110 },
2116 { 0x10, 0x40f000f0 },
2117 { 0x11, 0xd5a30130 },
2118 { 0x1f, 0x40f000f0 },
2119 { 0x20, 0x40f000f0 },
2123 static void stac92hd83xxx_fixup_hp(struct hda_codec *codec,
2124 const struct hda_fixup *fix, int action)
2126 struct sigmatel_spec *spec = codec->spec;
2128 if (action != HDA_FIXUP_ACT_PRE_PROBE)
2131 if (hp_bnb2011_with_dock(codec)) {
2132 snd_hda_codec_set_pincfg(codec, 0xa, 0x2101201f);
2133 snd_hda_codec_set_pincfg(codec, 0xf, 0x2181205e);
2136 if (find_mute_led_cfg(codec, spec->default_polarity))
2137 codec_dbg(codec, "mute LED gpio %d polarity %d\n",
2139 spec->gpio_led_polarity);
2141 /* allow auto-switching of dock line-in */
2142 spec->gen.line_in_auto_switch = true;
2145 static void stac92hd83xxx_fixup_hp_zephyr(struct hda_codec *codec,
2146 const struct hda_fixup *fix, int action)
2148 if (action != HDA_FIXUP_ACT_PRE_PROBE)
2151 snd_hda_apply_pincfgs(codec, hp_zephyr_pin_configs);
2152 snd_hda_add_verbs(codec, stac92hd83xxx_hp_zephyr_init);
2155 static void stac92hd83xxx_fixup_hp_led(struct hda_codec *codec,
2156 const struct hda_fixup *fix, int action)
2158 struct sigmatel_spec *spec = codec->spec;
2160 if (action == HDA_FIXUP_ACT_PRE_PROBE)
2161 spec->default_polarity = 0;
2164 static void stac92hd83xxx_fixup_hp_inv_led(struct hda_codec *codec,
2165 const struct hda_fixup *fix, int action)
2167 struct sigmatel_spec *spec = codec->spec;
2169 if (action == HDA_FIXUP_ACT_PRE_PROBE)
2170 spec->default_polarity = 1;
2173 static void stac92hd83xxx_fixup_hp_mic_led(struct hda_codec *codec,
2174 const struct hda_fixup *fix, int action)
2176 struct sigmatel_spec *spec = codec->spec;
2178 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
2179 spec->mic_mute_led_gpio = 0x08; /* GPIO3 */
2181 /* resetting controller clears GPIO, so we need to keep on */
2182 codec->core.power_caps &= ~AC_PWRST_CLKSTOP;
2187 static void stac92hd83xxx_fixup_hp_led_gpio10(struct hda_codec *codec,
2188 const struct hda_fixup *fix, int action)
2190 struct sigmatel_spec *spec = codec->spec;
2192 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
2193 spec->gpio_led = 0x10; /* GPIO4 */
2194 spec->default_polarity = 0;
2198 static void stac92hd83xxx_fixup_headset_jack(struct hda_codec *codec,
2199 const struct hda_fixup *fix, int action)
2201 struct sigmatel_spec *spec = codec->spec;
2203 if (action == HDA_FIXUP_ACT_PRE_PROBE)
2204 spec->headset_jack = 1;
2207 static void stac92hd83xxx_fixup_gpio10_eapd(struct hda_codec *codec,
2208 const struct hda_fixup *fix,
2211 struct sigmatel_spec *spec = codec->spec;
2213 if (action != HDA_FIXUP_ACT_PRE_PROBE)
2215 spec->eapd_mask = spec->gpio_mask = spec->gpio_dir =
2216 spec->gpio_data = 0x10;
2217 spec->eapd_switch = 0;
2220 static void hp_envy_ts_fixup_dac_bind(struct hda_codec *codec,
2221 const struct hda_fixup *fix,
2224 struct sigmatel_spec *spec = codec->spec;
2225 static hda_nid_t preferred_pairs[] = {
2230 if (action != HDA_FIXUP_ACT_PRE_PROBE)
2233 spec->gen.preferred_dacs = preferred_pairs;
2236 static const struct hda_verb hp_bnb13_eq_verbs[] = {
2238 { 0x22, 0x7A6, 0x3E },
2239 { 0x22, 0x7A7, 0x68 },
2240 { 0x22, 0x7A8, 0x17 },
2241 { 0x22, 0x7A9, 0x3E },
2242 { 0x22, 0x7AA, 0x68 },
2243 { 0x22, 0x7AB, 0x17 },
2244 { 0x22, 0x7AC, 0x00 },
2245 { 0x22, 0x7AD, 0x80 },
2246 { 0x22, 0x7A6, 0x83 },
2247 { 0x22, 0x7A7, 0x2F },
2248 { 0x22, 0x7A8, 0xD1 },
2249 { 0x22, 0x7A9, 0x83 },
2250 { 0x22, 0x7AA, 0x2F },
2251 { 0x22, 0x7AB, 0xD1 },
2252 { 0x22, 0x7AC, 0x01 },
2253 { 0x22, 0x7AD, 0x80 },
2254 { 0x22, 0x7A6, 0x3E },
2255 { 0x22, 0x7A7, 0x68 },
2256 { 0x22, 0x7A8, 0x17 },
2257 { 0x22, 0x7A9, 0x3E },
2258 { 0x22, 0x7AA, 0x68 },
2259 { 0x22, 0x7AB, 0x17 },
2260 { 0x22, 0x7AC, 0x02 },
2261 { 0x22, 0x7AD, 0x80 },
2262 { 0x22, 0x7A6, 0x7C },
2263 { 0x22, 0x7A7, 0xC6 },
2264 { 0x22, 0x7A8, 0x0C },
2265 { 0x22, 0x7A9, 0x7C },
2266 { 0x22, 0x7AA, 0xC6 },
2267 { 0x22, 0x7AB, 0x0C },
2268 { 0x22, 0x7AC, 0x03 },
2269 { 0x22, 0x7AD, 0x80 },
2270 { 0x22, 0x7A6, 0xC3 },
2271 { 0x22, 0x7A7, 0x25 },
2272 { 0x22, 0x7A8, 0xAF },
2273 { 0x22, 0x7A9, 0xC3 },
2274 { 0x22, 0x7AA, 0x25 },
2275 { 0x22, 0x7AB, 0xAF },
2276 { 0x22, 0x7AC, 0x04 },
2277 { 0x22, 0x7AD, 0x80 },
2278 { 0x22, 0x7A6, 0x3E },
2279 { 0x22, 0x7A7, 0x85 },
2280 { 0x22, 0x7A8, 0x73 },
2281 { 0x22, 0x7A9, 0x3E },
2282 { 0x22, 0x7AA, 0x85 },
2283 { 0x22, 0x7AB, 0x73 },
2284 { 0x22, 0x7AC, 0x05 },
2285 { 0x22, 0x7AD, 0x80 },
2286 { 0x22, 0x7A6, 0x85 },
2287 { 0x22, 0x7A7, 0x39 },
2288 { 0x22, 0x7A8, 0xC7 },
2289 { 0x22, 0x7A9, 0x85 },
2290 { 0x22, 0x7AA, 0x39 },
2291 { 0x22, 0x7AB, 0xC7 },
2292 { 0x22, 0x7AC, 0x06 },
2293 { 0x22, 0x7AD, 0x80 },
2294 { 0x22, 0x7A6, 0x3C },
2295 { 0x22, 0x7A7, 0x90 },
2296 { 0x22, 0x7A8, 0xB0 },
2297 { 0x22, 0x7A9, 0x3C },
2298 { 0x22, 0x7AA, 0x90 },
2299 { 0x22, 0x7AB, 0xB0 },
2300 { 0x22, 0x7AC, 0x07 },
2301 { 0x22, 0x7AD, 0x80 },
2302 { 0x22, 0x7A6, 0x7A },
2303 { 0x22, 0x7A7, 0xC6 },
2304 { 0x22, 0x7A8, 0x39 },
2305 { 0x22, 0x7A9, 0x7A },
2306 { 0x22, 0x7AA, 0xC6 },
2307 { 0x22, 0x7AB, 0x39 },
2308 { 0x22, 0x7AC, 0x08 },
2309 { 0x22, 0x7AD, 0x80 },
2310 { 0x22, 0x7A6, 0xC4 },
2311 { 0x22, 0x7A7, 0xE9 },
2312 { 0x22, 0x7A8, 0xDC },
2313 { 0x22, 0x7A9, 0xC4 },
2314 { 0x22, 0x7AA, 0xE9 },
2315 { 0x22, 0x7AB, 0xDC },
2316 { 0x22, 0x7AC, 0x09 },
2317 { 0x22, 0x7AD, 0x80 },
2318 { 0x22, 0x7A6, 0x3D },
2319 { 0x22, 0x7A7, 0xE1 },
2320 { 0x22, 0x7A8, 0x0D },
2321 { 0x22, 0x7A9, 0x3D },
2322 { 0x22, 0x7AA, 0xE1 },
2323 { 0x22, 0x7AB, 0x0D },
2324 { 0x22, 0x7AC, 0x0A },
2325 { 0x22, 0x7AD, 0x80 },
2326 { 0x22, 0x7A6, 0x89 },
2327 { 0x22, 0x7A7, 0xB6 },
2328 { 0x22, 0x7A8, 0xEB },
2329 { 0x22, 0x7A9, 0x89 },
2330 { 0x22, 0x7AA, 0xB6 },
2331 { 0x22, 0x7AB, 0xEB },
2332 { 0x22, 0x7AC, 0x0B },
2333 { 0x22, 0x7AD, 0x80 },
2334 { 0x22, 0x7A6, 0x39 },
2335 { 0x22, 0x7A7, 0x9D },
2336 { 0x22, 0x7A8, 0xFE },
2337 { 0x22, 0x7A9, 0x39 },
2338 { 0x22, 0x7AA, 0x9D },
2339 { 0x22, 0x7AB, 0xFE },
2340 { 0x22, 0x7AC, 0x0C },
2341 { 0x22, 0x7AD, 0x80 },
2342 { 0x22, 0x7A6, 0x76 },
2343 { 0x22, 0x7A7, 0x49 },
2344 { 0x22, 0x7A8, 0x15 },
2345 { 0x22, 0x7A9, 0x76 },
2346 { 0x22, 0x7AA, 0x49 },
2347 { 0x22, 0x7AB, 0x15 },
2348 { 0x22, 0x7AC, 0x0D },
2349 { 0x22, 0x7AD, 0x80 },
2350 { 0x22, 0x7A6, 0xC8 },
2351 { 0x22, 0x7A7, 0x80 },
2352 { 0x22, 0x7A8, 0xF5 },
2353 { 0x22, 0x7A9, 0xC8 },
2354 { 0x22, 0x7AA, 0x80 },
2355 { 0x22, 0x7AB, 0xF5 },
2356 { 0x22, 0x7AC, 0x0E },
2357 { 0x22, 0x7AD, 0x80 },
2358 { 0x22, 0x7A6, 0x40 },
2359 { 0x22, 0x7A7, 0x00 },
2360 { 0x22, 0x7A8, 0x00 },
2361 { 0x22, 0x7A9, 0x40 },
2362 { 0x22, 0x7AA, 0x00 },
2363 { 0x22, 0x7AB, 0x00 },
2364 { 0x22, 0x7AC, 0x0F },
2365 { 0x22, 0x7AD, 0x80 },
2366 { 0x22, 0x7A6, 0x90 },
2367 { 0x22, 0x7A7, 0x68 },
2368 { 0x22, 0x7A8, 0xF1 },
2369 { 0x22, 0x7A9, 0x90 },
2370 { 0x22, 0x7AA, 0x68 },
2371 { 0x22, 0x7AB, 0xF1 },
2372 { 0x22, 0x7AC, 0x10 },
2373 { 0x22, 0x7AD, 0x80 },
2374 { 0x22, 0x7A6, 0x34 },
2375 { 0x22, 0x7A7, 0x47 },
2376 { 0x22, 0x7A8, 0x6C },
2377 { 0x22, 0x7A9, 0x34 },
2378 { 0x22, 0x7AA, 0x47 },
2379 { 0x22, 0x7AB, 0x6C },
2380 { 0x22, 0x7AC, 0x11 },
2381 { 0x22, 0x7AD, 0x80 },
2382 { 0x22, 0x7A6, 0x6F },
2383 { 0x22, 0x7A7, 0x97 },
2384 { 0x22, 0x7A8, 0x0F },
2385 { 0x22, 0x7A9, 0x6F },
2386 { 0x22, 0x7AA, 0x97 },
2387 { 0x22, 0x7AB, 0x0F },
2388 { 0x22, 0x7AC, 0x12 },
2389 { 0x22, 0x7AD, 0x80 },
2390 { 0x22, 0x7A6, 0xCB },
2391 { 0x22, 0x7A7, 0xB8 },
2392 { 0x22, 0x7A8, 0x94 },
2393 { 0x22, 0x7A9, 0xCB },
2394 { 0x22, 0x7AA, 0xB8 },
2395 { 0x22, 0x7AB, 0x94 },
2396 { 0x22, 0x7AC, 0x13 },
2397 { 0x22, 0x7AD, 0x80 },
2398 { 0x22, 0x7A6, 0x40 },
2399 { 0x22, 0x7A7, 0x00 },
2400 { 0x22, 0x7A8, 0x00 },
2401 { 0x22, 0x7A9, 0x40 },
2402 { 0x22, 0x7AA, 0x00 },
2403 { 0x22, 0x7AB, 0x00 },
2404 { 0x22, 0x7AC, 0x14 },
2405 { 0x22, 0x7AD, 0x80 },
2406 { 0x22, 0x7A6, 0x95 },
2407 { 0x22, 0x7A7, 0x76 },
2408 { 0x22, 0x7A8, 0x5B },
2409 { 0x22, 0x7A9, 0x95 },
2410 { 0x22, 0x7AA, 0x76 },
2411 { 0x22, 0x7AB, 0x5B },
2412 { 0x22, 0x7AC, 0x15 },
2413 { 0x22, 0x7AD, 0x80 },
2414 { 0x22, 0x7A6, 0x31 },
2415 { 0x22, 0x7A7, 0xAC },
2416 { 0x22, 0x7A8, 0x31 },
2417 { 0x22, 0x7A9, 0x31 },
2418 { 0x22, 0x7AA, 0xAC },
2419 { 0x22, 0x7AB, 0x31 },
2420 { 0x22, 0x7AC, 0x16 },
2421 { 0x22, 0x7AD, 0x80 },
2422 { 0x22, 0x7A6, 0x6A },
2423 { 0x22, 0x7A7, 0x89 },
2424 { 0x22, 0x7A8, 0xA5 },
2425 { 0x22, 0x7A9, 0x6A },
2426 { 0x22, 0x7AA, 0x89 },
2427 { 0x22, 0x7AB, 0xA5 },
2428 { 0x22, 0x7AC, 0x17 },
2429 { 0x22, 0x7AD, 0x80 },
2430 { 0x22, 0x7A6, 0xCE },
2431 { 0x22, 0x7A7, 0x53 },
2432 { 0x22, 0x7A8, 0xCF },
2433 { 0x22, 0x7A9, 0xCE },
2434 { 0x22, 0x7AA, 0x53 },
2435 { 0x22, 0x7AB, 0xCF },
2436 { 0x22, 0x7AC, 0x18 },
2437 { 0x22, 0x7AD, 0x80 },
2438 { 0x22, 0x7A6, 0x40 },
2439 { 0x22, 0x7A7, 0x00 },
2440 { 0x22, 0x7A8, 0x00 },
2441 { 0x22, 0x7A9, 0x40 },
2442 { 0x22, 0x7AA, 0x00 },
2443 { 0x22, 0x7AB, 0x00 },
2444 { 0x22, 0x7AC, 0x19 },
2445 { 0x22, 0x7AD, 0x80 },
2447 { 0x22, 0x7A6, 0x3E },
2448 { 0x22, 0x7A7, 0x88 },
2449 { 0x22, 0x7A8, 0xDC },
2450 { 0x22, 0x7A9, 0x3E },
2451 { 0x22, 0x7AA, 0x88 },
2452 { 0x22, 0x7AB, 0xDC },
2453 { 0x22, 0x7AC, 0x1A },
2454 { 0x22, 0x7AD, 0x80 },
2455 { 0x22, 0x7A6, 0x82 },
2456 { 0x22, 0x7A7, 0xEE },
2457 { 0x22, 0x7A8, 0x46 },
2458 { 0x22, 0x7A9, 0x82 },
2459 { 0x22, 0x7AA, 0xEE },
2460 { 0x22, 0x7AB, 0x46 },
2461 { 0x22, 0x7AC, 0x1B },
2462 { 0x22, 0x7AD, 0x80 },
2463 { 0x22, 0x7A6, 0x3E },
2464 { 0x22, 0x7A7, 0x88 },
2465 { 0x22, 0x7A8, 0xDC },
2466 { 0x22, 0x7A9, 0x3E },
2467 { 0x22, 0x7AA, 0x88 },
2468 { 0x22, 0x7AB, 0xDC },
2469 { 0x22, 0x7AC, 0x1C },
2470 { 0x22, 0x7AD, 0x80 },
2471 { 0x22, 0x7A6, 0x7D },
2472 { 0x22, 0x7A7, 0x09 },
2473 { 0x22, 0x7A8, 0x28 },
2474 { 0x22, 0x7A9, 0x7D },
2475 { 0x22, 0x7AA, 0x09 },
2476 { 0x22, 0x7AB, 0x28 },
2477 { 0x22, 0x7AC, 0x1D },
2478 { 0x22, 0x7AD, 0x80 },
2479 { 0x22, 0x7A6, 0xC2 },
2480 { 0x22, 0x7A7, 0xE5 },
2481 { 0x22, 0x7A8, 0xB4 },
2482 { 0x22, 0x7A9, 0xC2 },
2483 { 0x22, 0x7AA, 0xE5 },
2484 { 0x22, 0x7AB, 0xB4 },
2485 { 0x22, 0x7AC, 0x1E },
2486 { 0x22, 0x7AD, 0x80 },
2487 { 0x22, 0x7A6, 0x3E },
2488 { 0x22, 0x7A7, 0xA3 },
2489 { 0x22, 0x7A8, 0x1F },
2490 { 0x22, 0x7A9, 0x3E },
2491 { 0x22, 0x7AA, 0xA3 },
2492 { 0x22, 0x7AB, 0x1F },
2493 { 0x22, 0x7AC, 0x1F },
2494 { 0x22, 0x7AD, 0x80 },
2495 { 0x22, 0x7A6, 0x84 },
2496 { 0x22, 0x7A7, 0xCA },
2497 { 0x22, 0x7A8, 0xF1 },
2498 { 0x22, 0x7A9, 0x84 },
2499 { 0x22, 0x7AA, 0xCA },
2500 { 0x22, 0x7AB, 0xF1 },
2501 { 0x22, 0x7AC, 0x20 },
2502 { 0x22, 0x7AD, 0x80 },
2503 { 0x22, 0x7A6, 0x3C },
2504 { 0x22, 0x7A7, 0xD5 },
2505 { 0x22, 0x7A8, 0x9C },
2506 { 0x22, 0x7A9, 0x3C },
2507 { 0x22, 0x7AA, 0xD5 },
2508 { 0x22, 0x7AB, 0x9C },
2509 { 0x22, 0x7AC, 0x21 },
2510 { 0x22, 0x7AD, 0x80 },
2511 { 0x22, 0x7A6, 0x7B },
2512 { 0x22, 0x7A7, 0x35 },
2513 { 0x22, 0x7A8, 0x0F },
2514 { 0x22, 0x7A9, 0x7B },
2515 { 0x22, 0x7AA, 0x35 },
2516 { 0x22, 0x7AB, 0x0F },
2517 { 0x22, 0x7AC, 0x22 },
2518 { 0x22, 0x7AD, 0x80 },
2519 { 0x22, 0x7A6, 0xC4 },
2520 { 0x22, 0x7A7, 0x87 },
2521 { 0x22, 0x7A8, 0x45 },
2522 { 0x22, 0x7A9, 0xC4 },
2523 { 0x22, 0x7AA, 0x87 },
2524 { 0x22, 0x7AB, 0x45 },
2525 { 0x22, 0x7AC, 0x23 },
2526 { 0x22, 0x7AD, 0x80 },
2527 { 0x22, 0x7A6, 0x3E },
2528 { 0x22, 0x7A7, 0x0A },
2529 { 0x22, 0x7A8, 0x78 },
2530 { 0x22, 0x7A9, 0x3E },
2531 { 0x22, 0x7AA, 0x0A },
2532 { 0x22, 0x7AB, 0x78 },
2533 { 0x22, 0x7AC, 0x24 },
2534 { 0x22, 0x7AD, 0x80 },
2535 { 0x22, 0x7A6, 0x88 },
2536 { 0x22, 0x7A7, 0xE2 },
2537 { 0x22, 0x7A8, 0x05 },
2538 { 0x22, 0x7A9, 0x88 },
2539 { 0x22, 0x7AA, 0xE2 },
2540 { 0x22, 0x7AB, 0x05 },
2541 { 0x22, 0x7AC, 0x25 },
2542 { 0x22, 0x7AD, 0x80 },
2543 { 0x22, 0x7A6, 0x3A },
2544 { 0x22, 0x7A7, 0x1A },
2545 { 0x22, 0x7A8, 0xA3 },
2546 { 0x22, 0x7A9, 0x3A },
2547 { 0x22, 0x7AA, 0x1A },
2548 { 0x22, 0x7AB, 0xA3 },
2549 { 0x22, 0x7AC, 0x26 },
2550 { 0x22, 0x7AD, 0x80 },
2551 { 0x22, 0x7A6, 0x77 },
2552 { 0x22, 0x7A7, 0x1D },
2553 { 0x22, 0x7A8, 0xFB },
2554 { 0x22, 0x7A9, 0x77 },
2555 { 0x22, 0x7AA, 0x1D },
2556 { 0x22, 0x7AB, 0xFB },
2557 { 0x22, 0x7AC, 0x27 },
2558 { 0x22, 0x7AD, 0x80 },
2559 { 0x22, 0x7A6, 0xC7 },
2560 { 0x22, 0x7A7, 0xDA },
2561 { 0x22, 0x7A8, 0xE5 },
2562 { 0x22, 0x7A9, 0xC7 },
2563 { 0x22, 0x7AA, 0xDA },
2564 { 0x22, 0x7AB, 0xE5 },
2565 { 0x22, 0x7AC, 0x28 },
2566 { 0x22, 0x7AD, 0x80 },
2567 { 0x22, 0x7A6, 0x40 },
2568 { 0x22, 0x7A7, 0x00 },
2569 { 0x22, 0x7A8, 0x00 },
2570 { 0x22, 0x7A9, 0x40 },
2571 { 0x22, 0x7AA, 0x00 },
2572 { 0x22, 0x7AB, 0x00 },
2573 { 0x22, 0x7AC, 0x29 },
2574 { 0x22, 0x7AD, 0x80 },
2575 { 0x22, 0x7A6, 0x8E },
2576 { 0x22, 0x7A7, 0xD7 },
2577 { 0x22, 0x7A8, 0x22 },
2578 { 0x22, 0x7A9, 0x8E },
2579 { 0x22, 0x7AA, 0xD7 },
2580 { 0x22, 0x7AB, 0x22 },
2581 { 0x22, 0x7AC, 0x2A },
2582 { 0x22, 0x7AD, 0x80 },
2583 { 0x22, 0x7A6, 0x35 },
2584 { 0x22, 0x7A7, 0x26 },
2585 { 0x22, 0x7A8, 0xC6 },
2586 { 0x22, 0x7A9, 0x35 },
2587 { 0x22, 0x7AA, 0x26 },
2588 { 0x22, 0x7AB, 0xC6 },
2589 { 0x22, 0x7AC, 0x2B },
2590 { 0x22, 0x7AD, 0x80 },
2591 { 0x22, 0x7A6, 0x71 },
2592 { 0x22, 0x7A7, 0x28 },
2593 { 0x22, 0x7A8, 0xDE },
2594 { 0x22, 0x7A9, 0x71 },
2595 { 0x22, 0x7AA, 0x28 },
2596 { 0x22, 0x7AB, 0xDE },
2597 { 0x22, 0x7AC, 0x2C },
2598 { 0x22, 0x7AD, 0x80 },
2599 { 0x22, 0x7A6, 0xCA },
2600 { 0x22, 0x7A7, 0xD9 },
2601 { 0x22, 0x7A8, 0x3A },
2602 { 0x22, 0x7A9, 0xCA },
2603 { 0x22, 0x7AA, 0xD9 },
2604 { 0x22, 0x7AB, 0x3A },
2605 { 0x22, 0x7AC, 0x2D },
2606 { 0x22, 0x7AD, 0x80 },
2607 { 0x22, 0x7A6, 0x40 },
2608 { 0x22, 0x7A7, 0x00 },
2609 { 0x22, 0x7A8, 0x00 },
2610 { 0x22, 0x7A9, 0x40 },
2611 { 0x22, 0x7AA, 0x00 },
2612 { 0x22, 0x7AB, 0x00 },
2613 { 0x22, 0x7AC, 0x2E },
2614 { 0x22, 0x7AD, 0x80 },
2615 { 0x22, 0x7A6, 0x93 },
2616 { 0x22, 0x7A7, 0x5E },
2617 { 0x22, 0x7A8, 0xD8 },
2618 { 0x22, 0x7A9, 0x93 },
2619 { 0x22, 0x7AA, 0x5E },
2620 { 0x22, 0x7AB, 0xD8 },
2621 { 0x22, 0x7AC, 0x2F },
2622 { 0x22, 0x7AD, 0x80 },
2623 { 0x22, 0x7A6, 0x32 },
2624 { 0x22, 0x7A7, 0xB7 },
2625 { 0x22, 0x7A8, 0xB1 },
2626 { 0x22, 0x7A9, 0x32 },
2627 { 0x22, 0x7AA, 0xB7 },
2628 { 0x22, 0x7AB, 0xB1 },
2629 { 0x22, 0x7AC, 0x30 },
2630 { 0x22, 0x7AD, 0x80 },
2631 { 0x22, 0x7A6, 0x6C },
2632 { 0x22, 0x7A7, 0xA1 },
2633 { 0x22, 0x7A8, 0x28 },
2634 { 0x22, 0x7A9, 0x6C },
2635 { 0x22, 0x7AA, 0xA1 },
2636 { 0x22, 0x7AB, 0x28 },
2637 { 0x22, 0x7AC, 0x31 },
2638 { 0x22, 0x7AD, 0x80 },
2639 { 0x22, 0x7A6, 0xCD },
2640 { 0x22, 0x7A7, 0x48 },
2641 { 0x22, 0x7A8, 0x4F },
2642 { 0x22, 0x7A9, 0xCD },
2643 { 0x22, 0x7AA, 0x48 },
2644 { 0x22, 0x7AB, 0x4F },
2645 { 0x22, 0x7AC, 0x32 },
2646 { 0x22, 0x7AD, 0x80 },
2647 { 0x22, 0x7A6, 0x40 },
2648 { 0x22, 0x7A7, 0x00 },
2649 { 0x22, 0x7A8, 0x00 },
2650 { 0x22, 0x7A9, 0x40 },
2651 { 0x22, 0x7AA, 0x00 },
2652 { 0x22, 0x7AB, 0x00 },
2653 { 0x22, 0x7AC, 0x33 },
2654 { 0x22, 0x7AD, 0x80 },
2656 { 0x22, 0x782, 0xC1 },
2657 { 0x22, 0x771, 0x2C },
2658 { 0x22, 0x772, 0x2C },
2659 { 0x22, 0x788, 0x04 },
2660 { 0x01, 0x7B0, 0x08 },
2664 static const struct hda_fixup stac92hd83xxx_fixups[] = {
2665 [STAC_92HD83XXX_REF] = {
2666 .type = HDA_FIXUP_PINS,
2667 .v.pins = ref92hd83xxx_pin_configs,
2669 [STAC_92HD83XXX_PWR_REF] = {
2670 .type = HDA_FIXUP_PINS,
2671 .v.pins = ref92hd83xxx_pin_configs,
2674 .type = HDA_FIXUP_PINS,
2675 .v.pins = dell_s14_pin_configs,
2677 [STAC_DELL_VOSTRO_3500] = {
2678 .type = HDA_FIXUP_PINS,
2679 .v.pins = dell_vostro_3500_pin_configs,
2681 [STAC_92HD83XXX_HP_cNB11_INTQUAD] = {
2682 .type = HDA_FIXUP_PINS,
2683 .v.pins = hp_cNB11_intquad_pin_configs,
2685 .chain_id = STAC_92HD83XXX_HP,
2687 [STAC_92HD83XXX_HP] = {
2688 .type = HDA_FIXUP_FUNC,
2689 .v.func = stac92hd83xxx_fixup_hp,
2691 [STAC_HP_DV7_4000] = {
2692 .type = HDA_FIXUP_PINS,
2693 .v.pins = hp_dv7_4000_pin_configs,
2695 .chain_id = STAC_92HD83XXX_HP,
2697 [STAC_HP_ZEPHYR] = {
2698 .type = HDA_FIXUP_FUNC,
2699 .v.func = stac92hd83xxx_fixup_hp_zephyr,
2701 .chain_id = STAC_92HD83XXX_HP,
2703 [STAC_92HD83XXX_HP_LED] = {
2704 .type = HDA_FIXUP_FUNC,
2705 .v.func = stac92hd83xxx_fixup_hp_led,
2707 .chain_id = STAC_92HD83XXX_HP,
2709 [STAC_92HD83XXX_HP_INV_LED] = {
2710 .type = HDA_FIXUP_FUNC,
2711 .v.func = stac92hd83xxx_fixup_hp_inv_led,
2713 .chain_id = STAC_92HD83XXX_HP,
2715 [STAC_92HD83XXX_HP_MIC_LED] = {
2716 .type = HDA_FIXUP_FUNC,
2717 .v.func = stac92hd83xxx_fixup_hp_mic_led,
2719 .chain_id = STAC_92HD83XXX_HP,
2721 [STAC_HP_LED_GPIO10] = {
2722 .type = HDA_FIXUP_FUNC,
2723 .v.func = stac92hd83xxx_fixup_hp_led_gpio10,
2725 .chain_id = STAC_92HD83XXX_HP,
2727 [STAC_92HD83XXX_HEADSET_JACK] = {
2728 .type = HDA_FIXUP_FUNC,
2729 .v.func = stac92hd83xxx_fixup_headset_jack,
2731 [STAC_HP_ENVY_BASS] = {
2732 .type = HDA_FIXUP_PINS,
2733 .v.pins = (const struct hda_pintbl[]) {
2734 { 0x0f, 0x90170111 },
2738 [STAC_HP_BNB13_EQ] = {
2739 .type = HDA_FIXUP_VERBS,
2740 .v.verbs = hp_bnb13_eq_verbs,
2742 .chain_id = STAC_92HD83XXX_HP_MIC_LED,
2744 [STAC_HP_ENVY_TS_BASS] = {
2745 .type = HDA_FIXUP_PINS,
2746 .v.pins = (const struct hda_pintbl[]) {
2747 { 0x10, 0x92170111 },
2751 [STAC_HP_ENVY_TS_DAC_BIND] = {
2752 .type = HDA_FIXUP_FUNC,
2753 .v.func = hp_envy_ts_fixup_dac_bind,
2755 .chain_id = STAC_HP_ENVY_TS_BASS,
2757 [STAC_92HD83XXX_GPIO10_EAPD] = {
2758 .type = HDA_FIXUP_FUNC,
2759 .v.func = stac92hd83xxx_fixup_gpio10_eapd,
2763 static const struct hda_model_fixup stac92hd83xxx_models[] = {
2764 { .id = STAC_92HD83XXX_REF, .name = "ref" },
2765 { .id = STAC_92HD83XXX_PWR_REF, .name = "mic-ref" },
2766 { .id = STAC_DELL_S14, .name = "dell-s14" },
2767 { .id = STAC_DELL_VOSTRO_3500, .name = "dell-vostro-3500" },
2768 { .id = STAC_92HD83XXX_HP_cNB11_INTQUAD, .name = "hp_cNB11_intquad" },
2769 { .id = STAC_HP_DV7_4000, .name = "hp-dv7-4000" },
2770 { .id = STAC_HP_ZEPHYR, .name = "hp-zephyr" },
2771 { .id = STAC_92HD83XXX_HP_LED, .name = "hp-led" },
2772 { .id = STAC_92HD83XXX_HP_INV_LED, .name = "hp-inv-led" },
2773 { .id = STAC_92HD83XXX_HP_MIC_LED, .name = "hp-mic-led" },
2774 { .id = STAC_92HD83XXX_HEADSET_JACK, .name = "headset-jack" },
2775 { .id = STAC_HP_ENVY_BASS, .name = "hp-envy-bass" },
2776 { .id = STAC_HP_BNB13_EQ, .name = "hp-bnb13-eq" },
2777 { .id = STAC_HP_ENVY_TS_BASS, .name = "hp-envy-ts-bass" },
2781 static const struct snd_pci_quirk stac92hd83xxx_fixup_tbl[] = {
2782 /* SigmaTel reference board */
2783 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2668,
2784 "DFI LanParty", STAC_92HD83XXX_REF),
2785 SND_PCI_QUIRK(PCI_VENDOR_ID_DFI, 0x3101,
2786 "DFI LanParty", STAC_92HD83XXX_REF),
2787 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x02ba,
2788 "unknown Dell", STAC_DELL_S14),
2789 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0532,
2790 "Dell Latitude E6230", STAC_92HD83XXX_HEADSET_JACK),
2791 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0533,
2792 "Dell Latitude E6330", STAC_92HD83XXX_HEADSET_JACK),
2793 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0534,
2794 "Dell Latitude E6430", STAC_92HD83XXX_HEADSET_JACK),
2795 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0535,
2796 "Dell Latitude E6530", STAC_92HD83XXX_HEADSET_JACK),
2797 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x053c,
2798 "Dell Latitude E5430", STAC_92HD83XXX_HEADSET_JACK),
2799 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x053d,
2800 "Dell Latitude E5530", STAC_92HD83XXX_HEADSET_JACK),
2801 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0549,
2802 "Dell Latitude E5430", STAC_92HD83XXX_HEADSET_JACK),
2803 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x057d,
2804 "Dell Latitude E6430s", STAC_92HD83XXX_HEADSET_JACK),
2805 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0584,
2806 "Dell Latitude E6430U", STAC_92HD83XXX_HEADSET_JACK),
2807 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x1028,
2808 "Dell Vostro 3500", STAC_DELL_VOSTRO_3500),
2809 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x1656,
2810 "HP", STAC_92HD83XXX_HP_cNB11_INTQUAD),
2811 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x1657,
2812 "HP", STAC_92HD83XXX_HP_cNB11_INTQUAD),
2813 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x1658,
2814 "HP", STAC_92HD83XXX_HP_cNB11_INTQUAD),
2815 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x1659,
2816 "HP Pavilion dv7", STAC_HP_DV7_4000),
2817 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x165A,
2818 "HP", STAC_92HD83XXX_HP_cNB11_INTQUAD),
2819 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x165B,
2820 "HP", STAC_92HD83XXX_HP_cNB11_INTQUAD),
2821 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x1888,
2822 "HP Envy Spectre", STAC_HP_ENVY_BASS),
2823 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x1899,
2824 "HP Folio 13", STAC_HP_LED_GPIO10),
2825 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x18df,
2826 "HP Folio", STAC_HP_BNB13_EQ),
2827 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x18F8,
2828 "HP bNB13", STAC_HP_BNB13_EQ),
2829 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x1909,
2830 "HP bNB13", STAC_HP_BNB13_EQ),
2831 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x190A,
2832 "HP bNB13", STAC_HP_BNB13_EQ),
2833 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x190e,
2834 "HP ENVY TS", STAC_HP_ENVY_TS_BASS),
2835 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x1967,
2836 "HP ENVY TS", STAC_HP_ENVY_TS_DAC_BIND),
2837 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x1940,
2838 "HP bNB13", STAC_HP_BNB13_EQ),
2839 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x1941,
2840 "HP bNB13", STAC_HP_BNB13_EQ),
2841 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x1942,
2842 "HP bNB13", STAC_HP_BNB13_EQ),
2843 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x1943,
2844 "HP bNB13", STAC_HP_BNB13_EQ),
2845 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x1944,
2846 "HP bNB13", STAC_HP_BNB13_EQ),
2847 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x1945,
2848 "HP bNB13", STAC_HP_BNB13_EQ),
2849 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x1946,
2850 "HP bNB13", STAC_HP_BNB13_EQ),
2851 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x1948,
2852 "HP bNB13", STAC_HP_BNB13_EQ),
2853 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x1949,
2854 "HP bNB13", STAC_HP_BNB13_EQ),
2855 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x194A,
2856 "HP bNB13", STAC_HP_BNB13_EQ),
2857 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x194B,
2858 "HP bNB13", STAC_HP_BNB13_EQ),
2859 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x194C,
2860 "HP bNB13", STAC_HP_BNB13_EQ),
2861 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x194E,
2862 "HP bNB13", STAC_HP_BNB13_EQ),
2863 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x194F,
2864 "HP bNB13", STAC_HP_BNB13_EQ),
2865 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x1950,
2866 "HP bNB13", STAC_HP_BNB13_EQ),
2867 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x1951,
2868 "HP bNB13", STAC_HP_BNB13_EQ),
2869 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x195A,
2870 "HP bNB13", STAC_HP_BNB13_EQ),
2871 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x195B,
2872 "HP bNB13", STAC_HP_BNB13_EQ),
2873 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x195C,
2874 "HP bNB13", STAC_HP_BNB13_EQ),
2875 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x1991,
2876 "HP bNB13", STAC_HP_BNB13_EQ),
2877 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x2103,
2878 "HP bNB13", STAC_HP_BNB13_EQ),
2879 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x2104,
2880 "HP bNB13", STAC_HP_BNB13_EQ),
2881 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x2105,
2882 "HP bNB13", STAC_HP_BNB13_EQ),
2883 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x2106,
2884 "HP bNB13", STAC_HP_BNB13_EQ),
2885 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x2107,
2886 "HP bNB13", STAC_HP_BNB13_EQ),
2887 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x2108,
2888 "HP bNB13", STAC_HP_BNB13_EQ),
2889 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x2109,
2890 "HP bNB13", STAC_HP_BNB13_EQ),
2891 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x210A,
2892 "HP bNB13", STAC_HP_BNB13_EQ),
2893 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x210B,
2894 "HP bNB13", STAC_HP_BNB13_EQ),
2895 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x211C,
2896 "HP bNB13", STAC_HP_BNB13_EQ),
2897 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x211D,
2898 "HP bNB13", STAC_HP_BNB13_EQ),
2899 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x211E,
2900 "HP bNB13", STAC_HP_BNB13_EQ),
2901 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x211F,
2902 "HP bNB13", STAC_HP_BNB13_EQ),
2903 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x2120,
2904 "HP bNB13", STAC_HP_BNB13_EQ),
2905 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x2121,
2906 "HP bNB13", STAC_HP_BNB13_EQ),
2907 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x2122,
2908 "HP bNB13", STAC_HP_BNB13_EQ),
2909 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x2123,
2910 "HP bNB13", STAC_HP_BNB13_EQ),
2911 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x213E,
2912 "HP bNB13", STAC_HP_BNB13_EQ),
2913 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x213F,
2914 "HP bNB13", STAC_HP_BNB13_EQ),
2915 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x2140,
2916 "HP bNB13", STAC_HP_BNB13_EQ),
2917 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x21B2,
2918 "HP bNB13", STAC_HP_BNB13_EQ),
2919 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x21B3,
2920 "HP bNB13", STAC_HP_BNB13_EQ),
2921 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x21B5,
2922 "HP bNB13", STAC_HP_BNB13_EQ),
2923 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x21B6,
2924 "HP bNB13", STAC_HP_BNB13_EQ),
2925 SND_PCI_QUIRK_MASK(PCI_VENDOR_ID_HP, 0xff00, 0x1900,
2926 "HP", STAC_92HD83XXX_HP_MIC_LED),
2927 SND_PCI_QUIRK_MASK(PCI_VENDOR_ID_HP, 0xff00, 0x2000,
2928 "HP", STAC_92HD83XXX_HP_MIC_LED),
2929 SND_PCI_QUIRK_MASK(PCI_VENDOR_ID_HP, 0xff00, 0x2100,
2930 "HP", STAC_92HD83XXX_HP_MIC_LED),
2931 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x3388,
2932 "HP", STAC_92HD83XXX_HP_cNB11_INTQUAD),
2933 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x3389,
2934 "HP", STAC_92HD83XXX_HP_cNB11_INTQUAD),
2935 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x355B,
2936 "HP", STAC_92HD83XXX_HP_cNB11_INTQUAD),
2937 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x355C,
2938 "HP", STAC_92HD83XXX_HP_cNB11_INTQUAD),
2939 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x355D,
2940 "HP", STAC_92HD83XXX_HP_cNB11_INTQUAD),
2941 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x355E,
2942 "HP", STAC_92HD83XXX_HP_cNB11_INTQUAD),
2943 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x355F,
2944 "HP", STAC_92HD83XXX_HP_cNB11_INTQUAD),
2945 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x3560,
2946 "HP", STAC_92HD83XXX_HP_cNB11_INTQUAD),
2947 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x358B,
2948 "HP", STAC_92HD83XXX_HP_cNB11_INTQUAD),
2949 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x358C,
2950 "HP", STAC_92HD83XXX_HP_cNB11_INTQUAD),
2951 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x358D,
2952 "HP", STAC_92HD83XXX_HP_cNB11_INTQUAD),
2953 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x3591,
2954 "HP", STAC_92HD83XXX_HP_cNB11_INTQUAD),
2955 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x3592,
2956 "HP", STAC_92HD83XXX_HP_cNB11_INTQUAD),
2957 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x3593,
2958 "HP", STAC_92HD83XXX_HP_cNB11_INTQUAD),
2959 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x3561,
2960 "HP", STAC_HP_ZEPHYR),
2961 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x3660,
2962 "HP Mini", STAC_92HD83XXX_HP_LED),
2963 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x144E,
2964 "HP Pavilion dv5", STAC_92HD83XXX_HP_INV_LED),
2965 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x148a,
2966 "HP Mini", STAC_92HD83XXX_HP_LED),
2967 SND_PCI_QUIRK_VENDOR(PCI_VENDOR_ID_HP, "HP", STAC_92HD83XXX_HP),
2968 /* match both for 0xfa91 and 0xfa93 */
2969 SND_PCI_QUIRK_MASK(PCI_VENDOR_ID_TOSHIBA, 0xfffd, 0xfa91,
2970 "Toshiba Satellite S50D", STAC_92HD83XXX_GPIO10_EAPD),
2974 /* HP dv7 bass switch - GPIO5 */
2975 #define stac_hp_bass_gpio_info snd_ctl_boolean_mono_info
2976 static int stac_hp_bass_gpio_get(struct snd_kcontrol *kcontrol,
2977 struct snd_ctl_elem_value *ucontrol)
2979 struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
2980 struct sigmatel_spec *spec = codec->spec;
2981 ucontrol->value.integer.value[0] = !!(spec->gpio_data & 0x20);
2985 static int stac_hp_bass_gpio_put(struct snd_kcontrol *kcontrol,
2986 struct snd_ctl_elem_value *ucontrol)
2988 struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
2989 struct sigmatel_spec *spec = codec->spec;
2990 unsigned int gpio_data;
2992 gpio_data = (spec->gpio_data & ~0x20) |
2993 (ucontrol->value.integer.value[0] ? 0x20 : 0);
2994 if (gpio_data == spec->gpio_data)
2996 spec->gpio_data = gpio_data;
2997 stac_gpio_set(codec, spec->gpio_mask, spec->gpio_dir, spec->gpio_data);
3001 static const struct snd_kcontrol_new stac_hp_bass_sw_ctrl = {
3002 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
3003 .info = stac_hp_bass_gpio_info,
3004 .get = stac_hp_bass_gpio_get,
3005 .put = stac_hp_bass_gpio_put,
3008 static int stac_add_hp_bass_switch(struct hda_codec *codec)
3010 struct sigmatel_spec *spec = codec->spec;
3012 if (!snd_hda_gen_add_kctl(&spec->gen, "Bass Speaker Playback Switch",
3013 &stac_hp_bass_sw_ctrl))
3016 spec->gpio_mask |= 0x20;
3017 spec->gpio_dir |= 0x20;
3018 spec->gpio_data |= 0x20;
3022 static const struct hda_pintbl ref92hd71bxx_pin_configs[] = {
3023 { 0x0a, 0x02214030 },
3024 { 0x0b, 0x02a19040 },
3025 { 0x0c, 0x01a19020 },
3026 { 0x0d, 0x01014010 },
3027 { 0x0e, 0x0181302e },
3028 { 0x0f, 0x01014010 },
3029 { 0x14, 0x01019020 },
3030 { 0x18, 0x90a000f0 },
3031 { 0x19, 0x90a000f0 },
3032 { 0x1e, 0x01452050 },
3033 { 0x1f, 0x01452050 },
3037 static const struct hda_pintbl dell_m4_1_pin_configs[] = {
3038 { 0x0a, 0x0421101f },
3039 { 0x0b, 0x04a11221 },
3040 { 0x0c, 0x40f000f0 },
3041 { 0x0d, 0x90170110 },
3042 { 0x0e, 0x23a1902e },
3043 { 0x0f, 0x23014250 },
3044 { 0x14, 0x40f000f0 },
3045 { 0x18, 0x90a000f0 },
3046 { 0x19, 0x40f000f0 },
3047 { 0x1e, 0x4f0000f0 },
3048 { 0x1f, 0x4f0000f0 },
3052 static const struct hda_pintbl dell_m4_2_pin_configs[] = {
3053 { 0x0a, 0x0421101f },
3054 { 0x0b, 0x04a11221 },
3055 { 0x0c, 0x90a70330 },
3056 { 0x0d, 0x90170110 },
3057 { 0x0e, 0x23a1902e },
3058 { 0x0f, 0x23014250 },
3059 { 0x14, 0x40f000f0 },
3060 { 0x18, 0x40f000f0 },
3061 { 0x19, 0x40f000f0 },
3062 { 0x1e, 0x044413b0 },
3063 { 0x1f, 0x044413b0 },
3067 static const struct hda_pintbl dell_m4_3_pin_configs[] = {
3068 { 0x0a, 0x0421101f },
3069 { 0x0b, 0x04a11221 },
3070 { 0x0c, 0x90a70330 },
3071 { 0x0d, 0x90170110 },
3072 { 0x0e, 0x40f000f0 },
3073 { 0x0f, 0x40f000f0 },
3074 { 0x14, 0x40f000f0 },
3075 { 0x18, 0x90a000f0 },
3076 { 0x19, 0x40f000f0 },
3077 { 0x1e, 0x044413b0 },
3078 { 0x1f, 0x044413b0 },
3082 static void stac92hd71bxx_fixup_ref(struct hda_codec *codec,
3083 const struct hda_fixup *fix, int action)
3085 struct sigmatel_spec *spec = codec->spec;
3087 if (action != HDA_FIXUP_ACT_PRE_PROBE)
3090 snd_hda_apply_pincfgs(codec, ref92hd71bxx_pin_configs);
3091 spec->gpio_mask = spec->gpio_dir = spec->gpio_data = 0;
3094 static void stac92hd71bxx_fixup_hp_m4(struct hda_codec *codec,
3095 const struct hda_fixup *fix, int action)
3097 struct sigmatel_spec *spec = codec->spec;
3098 struct hda_jack_callback *jack;
3100 if (action != HDA_FIXUP_ACT_PRE_PROBE)
3103 /* Enable VREF power saving on GPIO1 detect */
3104 snd_hda_codec_write_cache(codec, codec->core.afg, 0,
3105 AC_VERB_SET_GPIO_UNSOLICITED_RSP_MASK, 0x02);
3106 jack = snd_hda_jack_detect_enable_callback(codec, codec->core.afg,
3109 jack->private_data = 0x02;
3111 spec->gpio_mask |= 0x02;
3113 /* enable internal microphone */
3114 snd_hda_codec_set_pincfg(codec, 0x0e, 0x01813040);
3117 static void stac92hd71bxx_fixup_hp_dv4(struct hda_codec *codec,
3118 const struct hda_fixup *fix, int action)
3120 struct sigmatel_spec *spec = codec->spec;
3122 if (action != HDA_FIXUP_ACT_PRE_PROBE)
3124 spec->gpio_led = 0x01;
3127 static void stac92hd71bxx_fixup_hp_dv5(struct hda_codec *codec,
3128 const struct hda_fixup *fix, int action)
3133 case HDA_FIXUP_ACT_PRE_PROBE:
3134 snd_hda_codec_set_pincfg(codec, 0x0d, 0x90170010);
3137 case HDA_FIXUP_ACT_PROBE:
3138 /* enable bass on HP dv7 */
3139 cap = snd_hda_param_read(codec, 0x1, AC_PAR_GPIO_CAP);
3140 cap &= AC_GPIO_IO_COUNT;
3142 stac_add_hp_bass_switch(codec);
3147 static void stac92hd71bxx_fixup_hp_hdx(struct hda_codec *codec,
3148 const struct hda_fixup *fix, int action)
3150 struct sigmatel_spec *spec = codec->spec;
3152 if (action != HDA_FIXUP_ACT_PRE_PROBE)
3154 spec->gpio_led = 0x08;
3157 static bool is_hp_output(struct hda_codec *codec, hda_nid_t pin)
3159 unsigned int pin_cfg = snd_hda_codec_get_pincfg(codec, pin);
3161 /* count line-out, too, as BIOS sets often so */
3162 return get_defcfg_connect(pin_cfg) != AC_JACK_PORT_NONE &&
3163 (get_defcfg_device(pin_cfg) == AC_JACK_LINE_OUT ||
3164 get_defcfg_device(pin_cfg) == AC_JACK_HP_OUT);
3167 static void fixup_hp_headphone(struct hda_codec *codec, hda_nid_t pin)
3169 unsigned int pin_cfg = snd_hda_codec_get_pincfg(codec, pin);
3171 /* It was changed in the BIOS to just satisfy MS DTM.
3172 * Lets turn it back into slaved HP
3174 pin_cfg = (pin_cfg & (~AC_DEFCFG_DEVICE)) |
3175 (AC_JACK_HP_OUT << AC_DEFCFG_DEVICE_SHIFT);
3176 pin_cfg = (pin_cfg & (~(AC_DEFCFG_DEF_ASSOC | AC_DEFCFG_SEQUENCE))) |
3178 snd_hda_codec_set_pincfg(codec, pin, pin_cfg);
3181 static void stac92hd71bxx_fixup_hp(struct hda_codec *codec,
3182 const struct hda_fixup *fix, int action)
3184 struct sigmatel_spec *spec = codec->spec;
3186 if (action != HDA_FIXUP_ACT_PRE_PROBE)
3189 /* when both output A and F are assigned, these are supposedly
3190 * dock and built-in headphones; fix both pin configs
3192 if (is_hp_output(codec, 0x0a) && is_hp_output(codec, 0x0f)) {
3193 fixup_hp_headphone(codec, 0x0a);
3194 fixup_hp_headphone(codec, 0x0f);
3197 if (find_mute_led_cfg(codec, 1))
3198 codec_dbg(codec, "mute LED gpio %d polarity %d\n",
3200 spec->gpio_led_polarity);
3204 static const struct hda_fixup stac92hd71bxx_fixups[] = {
3205 [STAC_92HD71BXX_REF] = {
3206 .type = HDA_FIXUP_FUNC,
3207 .v.func = stac92hd71bxx_fixup_ref,
3209 [STAC_DELL_M4_1] = {
3210 .type = HDA_FIXUP_PINS,
3211 .v.pins = dell_m4_1_pin_configs,
3213 [STAC_DELL_M4_2] = {
3214 .type = HDA_FIXUP_PINS,
3215 .v.pins = dell_m4_2_pin_configs,
3217 [STAC_DELL_M4_3] = {
3218 .type = HDA_FIXUP_PINS,
3219 .v.pins = dell_m4_3_pin_configs,
3222 .type = HDA_FIXUP_FUNC,
3223 .v.func = stac92hd71bxx_fixup_hp_m4,
3225 .chain_id = STAC_92HD71BXX_HP,
3228 .type = HDA_FIXUP_FUNC,
3229 .v.func = stac92hd71bxx_fixup_hp_dv4,
3231 .chain_id = STAC_HP_DV5,
3234 .type = HDA_FIXUP_FUNC,
3235 .v.func = stac92hd71bxx_fixup_hp_dv5,
3237 .chain_id = STAC_92HD71BXX_HP,
3240 .type = HDA_FIXUP_FUNC,
3241 .v.func = stac92hd71bxx_fixup_hp_hdx,
3243 .chain_id = STAC_92HD71BXX_HP,
3245 [STAC_92HD71BXX_HP] = {
3246 .type = HDA_FIXUP_FUNC,
3247 .v.func = stac92hd71bxx_fixup_hp,
3251 static const struct hda_model_fixup stac92hd71bxx_models[] = {
3252 { .id = STAC_92HD71BXX_REF, .name = "ref" },
3253 { .id = STAC_DELL_M4_1, .name = "dell-m4-1" },
3254 { .id = STAC_DELL_M4_2, .name = "dell-m4-2" },
3255 { .id = STAC_DELL_M4_3, .name = "dell-m4-3" },
3256 { .id = STAC_HP_M4, .name = "hp-m4" },
3257 { .id = STAC_HP_DV4, .name = "hp-dv4" },
3258 { .id = STAC_HP_DV5, .name = "hp-dv5" },
3259 { .id = STAC_HP_HDX, .name = "hp-hdx" },
3260 { .id = STAC_HP_DV4, .name = "hp-dv4-1222nr" },
3264 static const struct snd_pci_quirk stac92hd71bxx_fixup_tbl[] = {
3265 /* SigmaTel reference board */
3266 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2668,
3267 "DFI LanParty", STAC_92HD71BXX_REF),
3268 SND_PCI_QUIRK(PCI_VENDOR_ID_DFI, 0x3101,
3269 "DFI LanParty", STAC_92HD71BXX_REF),
3270 SND_PCI_QUIRK_MASK(PCI_VENDOR_ID_HP, 0xfff0, 0x1720,
3272 SND_PCI_QUIRK_MASK(PCI_VENDOR_ID_HP, 0xfff0, 0x3080,
3274 SND_PCI_QUIRK_MASK(PCI_VENDOR_ID_HP, 0xfff0, 0x30f0,
3275 "HP dv4-7", STAC_HP_DV4),
3276 SND_PCI_QUIRK_MASK(PCI_VENDOR_ID_HP, 0xfff0, 0x3600,
3277 "HP dv4-7", STAC_HP_DV5),
3278 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x3610,
3279 "HP HDX", STAC_HP_HDX), /* HDX18 */
3280 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x361a,
3281 "HP mini 1000", STAC_HP_M4),
3282 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x361b,
3283 "HP HDX", STAC_HP_HDX), /* HDX16 */
3284 SND_PCI_QUIRK_MASK(PCI_VENDOR_ID_HP, 0xfff0, 0x3620,
3285 "HP dv6", STAC_HP_DV5),
3286 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x3061,
3287 "HP dv6", STAC_HP_DV5), /* HP dv6-1110ax */
3288 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x363e,
3289 "HP DV6", STAC_HP_DV5),
3290 SND_PCI_QUIRK_MASK(PCI_VENDOR_ID_HP, 0xfff0, 0x7010,
3292 SND_PCI_QUIRK_VENDOR(PCI_VENDOR_ID_HP, "HP", STAC_92HD71BXX_HP),
3293 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0233,
3294 "unknown Dell", STAC_DELL_M4_1),
3295 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0234,
3296 "unknown Dell", STAC_DELL_M4_1),
3297 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0250,
3298 "unknown Dell", STAC_DELL_M4_1),
3299 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x024f,
3300 "unknown Dell", STAC_DELL_M4_1),
3301 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x024d,
3302 "unknown Dell", STAC_DELL_M4_1),
3303 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0251,
3304 "unknown Dell", STAC_DELL_M4_1),
3305 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0277,
3306 "unknown Dell", STAC_DELL_M4_1),
3307 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0263,
3308 "unknown Dell", STAC_DELL_M4_2),
3309 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0265,
3310 "unknown Dell", STAC_DELL_M4_2),
3311 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0262,
3312 "unknown Dell", STAC_DELL_M4_2),
3313 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0264,
3314 "unknown Dell", STAC_DELL_M4_2),
3315 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x02aa,
3316 "unknown Dell", STAC_DELL_M4_3),
3320 static const struct hda_pintbl ref922x_pin_configs[] = {
3321 { 0x0a, 0x01014010 },
3322 { 0x0b, 0x01016011 },
3323 { 0x0c, 0x01012012 },
3324 { 0x0d, 0x0221401f },
3325 { 0x0e, 0x01813122 },
3326 { 0x0f, 0x01011014 },
3327 { 0x10, 0x01441030 },
3328 { 0x11, 0x01c41030 },
3329 { 0x15, 0x40000100 },
3330 { 0x1b, 0x40000100 },
3335 STAC 922X pin configs for
3342 static const struct hda_pintbl dell_922x_d81_pin_configs[] = {
3343 { 0x0a, 0x02214030 },
3344 { 0x0b, 0x01a19021 },
3345 { 0x0c, 0x01111012 },
3346 { 0x0d, 0x01114010 },
3347 { 0x0e, 0x02a19020 },
3348 { 0x0f, 0x01117011 },
3349 { 0x10, 0x400001f0 },
3350 { 0x11, 0x400001f1 },
3351 { 0x15, 0x01813122 },
3352 { 0x1b, 0x400001f2 },
3357 STAC 922X pin configs for
3361 static const struct hda_pintbl dell_922x_d82_pin_configs[] = {
3362 { 0x0a, 0x02214030 },
3363 { 0x0b, 0x01a19021 },
3364 { 0x0c, 0x01111012 },
3365 { 0x0d, 0x01114010 },
3366 { 0x0e, 0x02a19020 },
3367 { 0x0f, 0x01117011 },
3368 { 0x10, 0x01451140 },
3369 { 0x11, 0x400001f0 },
3370 { 0x15, 0x01813122 },
3371 { 0x1b, 0x400001f1 },
3376 STAC 922X pin configs for
3379 static const struct hda_pintbl dell_922x_m81_pin_configs[] = {
3380 { 0x0a, 0x0321101f },
3381 { 0x0b, 0x01112024 },
3382 { 0x0c, 0x01111222 },
3383 { 0x0d, 0x91174220 },
3384 { 0x0e, 0x03a11050 },
3385 { 0x0f, 0x01116221 },
3386 { 0x10, 0x90a70330 },
3387 { 0x11, 0x01452340 },
3388 { 0x15, 0x40C003f1 },
3389 { 0x1b, 0x405003f0 },
3394 STAC 9221 A1 pin configs for
3395 102801D7 (Dell XPS M1210)
3397 static const struct hda_pintbl dell_922x_m82_pin_configs[] = {
3398 { 0x0a, 0x02211211 },
3399 { 0x0b, 0x408103ff },
3400 { 0x0c, 0x02a1123e },
3401 { 0x0d, 0x90100310 },
3402 { 0x0e, 0x408003f1 },
3403 { 0x0f, 0x0221121f },
3404 { 0x10, 0x03451340 },
3405 { 0x11, 0x40c003f2 },
3406 { 0x15, 0x508003f3 },
3407 { 0x1b, 0x405003f4 },
3411 static const struct hda_pintbl d945gtp3_pin_configs[] = {
3412 { 0x0a, 0x0221401f },
3413 { 0x0b, 0x01a19022 },
3414 { 0x0c, 0x01813021 },
3415 { 0x0d, 0x01014010 },
3416 { 0x0e, 0x40000100 },
3417 { 0x0f, 0x40000100 },
3418 { 0x10, 0x40000100 },
3419 { 0x11, 0x40000100 },
3420 { 0x15, 0x02a19120 },
3421 { 0x1b, 0x40000100 },
3425 static const struct hda_pintbl d945gtp5_pin_configs[] = {
3426 { 0x0a, 0x0221401f },
3427 { 0x0b, 0x01011012 },
3428 { 0x0c, 0x01813024 },
3429 { 0x0d, 0x01014010 },
3430 { 0x0e, 0x01a19021 },
3431 { 0x0f, 0x01016011 },
3432 { 0x10, 0x01452130 },
3433 { 0x11, 0x40000100 },
3434 { 0x15, 0x02a19320 },
3435 { 0x1b, 0x40000100 },
3439 static const struct hda_pintbl intel_mac_v1_pin_configs[] = {
3440 { 0x0a, 0x0121e21f },
3441 { 0x0b, 0x400000ff },
3442 { 0x0c, 0x9017e110 },
3443 { 0x0d, 0x400000fd },
3444 { 0x0e, 0x400000fe },
3445 { 0x0f, 0x0181e020 },
3446 { 0x10, 0x1145e030 },
3447 { 0x11, 0x11c5e240 },
3448 { 0x15, 0x400000fc },
3449 { 0x1b, 0x400000fb },
3453 static const struct hda_pintbl intel_mac_v2_pin_configs[] = {
3454 { 0x0a, 0x0121e21f },
3455 { 0x0b, 0x90a7012e },
3456 { 0x0c, 0x9017e110 },
3457 { 0x0d, 0x400000fd },
3458 { 0x0e, 0x400000fe },
3459 { 0x0f, 0x0181e020 },
3460 { 0x10, 0x1145e230 },
3461 { 0x11, 0x500000fa },
3462 { 0x15, 0x400000fc },
3463 { 0x1b, 0x400000fb },
3467 static const struct hda_pintbl intel_mac_v3_pin_configs[] = {
3468 { 0x0a, 0x0121e21f },
3469 { 0x0b, 0x90a7012e },
3470 { 0x0c, 0x9017e110 },
3471 { 0x0d, 0x400000fd },
3472 { 0x0e, 0x400000fe },
3473 { 0x0f, 0x0181e020 },
3474 { 0x10, 0x1145e230 },
3475 { 0x11, 0x11c5e240 },
3476 { 0x15, 0x400000fc },
3477 { 0x1b, 0x400000fb },
3481 static const struct hda_pintbl intel_mac_v4_pin_configs[] = {
3482 { 0x0a, 0x0321e21f },
3483 { 0x0b, 0x03a1e02e },
3484 { 0x0c, 0x9017e110 },
3485 { 0x0d, 0x9017e11f },
3486 { 0x0e, 0x400000fe },
3487 { 0x0f, 0x0381e020 },
3488 { 0x10, 0x1345e230 },
3489 { 0x11, 0x13c5e240 },
3490 { 0x15, 0x400000fc },
3491 { 0x1b, 0x400000fb },
3495 static const struct hda_pintbl intel_mac_v5_pin_configs[] = {
3496 { 0x0a, 0x0321e21f },
3497 { 0x0b, 0x03a1e02e },
3498 { 0x0c, 0x9017e110 },
3499 { 0x0d, 0x9017e11f },
3500 { 0x0e, 0x400000fe },
3501 { 0x0f, 0x0381e020 },
3502 { 0x10, 0x1345e230 },
3503 { 0x11, 0x13c5e240 },
3504 { 0x15, 0x400000fc },
3505 { 0x1b, 0x400000fb },
3509 static const struct hda_pintbl ecs202_pin_configs[] = {
3510 { 0x0a, 0x0221401f },
3511 { 0x0b, 0x02a19020 },
3512 { 0x0c, 0x01a19020 },
3513 { 0x0d, 0x01114010 },
3514 { 0x0e, 0x408000f0 },
3515 { 0x0f, 0x01813022 },
3516 { 0x10, 0x074510a0 },
3517 { 0x11, 0x40c400f1 },
3518 { 0x15, 0x9037012e },
3519 { 0x1b, 0x40e000f2 },
3523 /* codec SSIDs for Intel Mac sharing the same PCI SSID 8384:7680 */
3524 static const struct snd_pci_quirk stac922x_intel_mac_fixup_tbl[] = {
3525 SND_PCI_QUIRK(0x0000, 0x0100, "Mac Mini", STAC_INTEL_MAC_V3),
3526 SND_PCI_QUIRK(0x106b, 0x0800, "Mac", STAC_INTEL_MAC_V1),
3527 SND_PCI_QUIRK(0x106b, 0x0600, "Mac", STAC_INTEL_MAC_V2),
3528 SND_PCI_QUIRK(0x106b, 0x0700, "Mac", STAC_INTEL_MAC_V2),
3529 SND_PCI_QUIRK(0x106b, 0x0e00, "Mac", STAC_INTEL_MAC_V3),
3530 SND_PCI_QUIRK(0x106b, 0x0f00, "Mac", STAC_INTEL_MAC_V3),
3531 SND_PCI_QUIRK(0x106b, 0x1600, "Mac", STAC_INTEL_MAC_V3),
3532 SND_PCI_QUIRK(0x106b, 0x1700, "Mac", STAC_INTEL_MAC_V3),
3533 SND_PCI_QUIRK(0x106b, 0x0200, "Mac", STAC_INTEL_MAC_V3),
3534 SND_PCI_QUIRK(0x106b, 0x1e00, "Mac", STAC_INTEL_MAC_V3),
3535 SND_PCI_QUIRK(0x106b, 0x1a00, "Mac", STAC_INTEL_MAC_V4),
3536 SND_PCI_QUIRK(0x106b, 0x0a00, "Mac", STAC_INTEL_MAC_V5),
3537 SND_PCI_QUIRK(0x106b, 0x2200, "Mac", STAC_INTEL_MAC_V5),
3541 static const struct hda_fixup stac922x_fixups[];
3543 /* remap the fixup from codec SSID and apply it */
3544 static void stac922x_fixup_intel_mac_auto(struct hda_codec *codec,
3545 const struct hda_fixup *fix,
3548 if (action != HDA_FIXUP_ACT_PRE_PROBE)
3551 codec->fixup_id = HDA_FIXUP_ID_NOT_SET;
3552 snd_hda_pick_fixup(codec, NULL, stac922x_intel_mac_fixup_tbl,
3554 if (codec->fixup_id != HDA_FIXUP_ID_NOT_SET)
3555 snd_hda_apply_fixup(codec, action);
3558 static void stac922x_fixup_intel_mac_gpio(struct hda_codec *codec,
3559 const struct hda_fixup *fix,
3562 struct sigmatel_spec *spec = codec->spec;
3564 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
3565 spec->gpio_mask = spec->gpio_dir = 0x03;
3566 spec->gpio_data = 0x03;
3570 static const struct hda_fixup stac922x_fixups[] = {
3572 .type = HDA_FIXUP_PINS,
3573 .v.pins = ref922x_pin_configs,
3576 .type = HDA_FIXUP_PINS,
3577 .v.pins = d945gtp3_pin_configs,
3580 .type = HDA_FIXUP_PINS,
3581 .v.pins = d945gtp5_pin_configs,
3583 [STAC_INTEL_MAC_AUTO] = {
3584 .type = HDA_FIXUP_FUNC,
3585 .v.func = stac922x_fixup_intel_mac_auto,
3587 [STAC_INTEL_MAC_V1] = {
3588 .type = HDA_FIXUP_PINS,
3589 .v.pins = intel_mac_v1_pin_configs,
3591 .chain_id = STAC_922X_INTEL_MAC_GPIO,
3593 [STAC_INTEL_MAC_V2] = {
3594 .type = HDA_FIXUP_PINS,
3595 .v.pins = intel_mac_v2_pin_configs,
3597 .chain_id = STAC_922X_INTEL_MAC_GPIO,
3599 [STAC_INTEL_MAC_V3] = {
3600 .type = HDA_FIXUP_PINS,
3601 .v.pins = intel_mac_v3_pin_configs,
3603 .chain_id = STAC_922X_INTEL_MAC_GPIO,
3605 [STAC_INTEL_MAC_V4] = {
3606 .type = HDA_FIXUP_PINS,
3607 .v.pins = intel_mac_v4_pin_configs,
3609 .chain_id = STAC_922X_INTEL_MAC_GPIO,
3611 [STAC_INTEL_MAC_V5] = {
3612 .type = HDA_FIXUP_PINS,
3613 .v.pins = intel_mac_v5_pin_configs,
3615 .chain_id = STAC_922X_INTEL_MAC_GPIO,
3617 [STAC_922X_INTEL_MAC_GPIO] = {
3618 .type = HDA_FIXUP_FUNC,
3619 .v.func = stac922x_fixup_intel_mac_gpio,
3622 .type = HDA_FIXUP_PINS,
3623 .v.pins = ecs202_pin_configs,
3625 [STAC_922X_DELL_D81] = {
3626 .type = HDA_FIXUP_PINS,
3627 .v.pins = dell_922x_d81_pin_configs,
3629 [STAC_922X_DELL_D82] = {
3630 .type = HDA_FIXUP_PINS,
3631 .v.pins = dell_922x_d82_pin_configs,
3633 [STAC_922X_DELL_M81] = {
3634 .type = HDA_FIXUP_PINS,
3635 .v.pins = dell_922x_m81_pin_configs,
3637 [STAC_922X_DELL_M82] = {
3638 .type = HDA_FIXUP_PINS,
3639 .v.pins = dell_922x_m82_pin_configs,
3643 static const struct hda_model_fixup stac922x_models[] = {
3644 { .id = STAC_D945_REF, .name = "ref" },
3645 { .id = STAC_D945GTP5, .name = "5stack" },
3646 { .id = STAC_D945GTP3, .name = "3stack" },
3647 { .id = STAC_INTEL_MAC_V1, .name = "intel-mac-v1" },
3648 { .id = STAC_INTEL_MAC_V2, .name = "intel-mac-v2" },
3649 { .id = STAC_INTEL_MAC_V3, .name = "intel-mac-v3" },
3650 { .id = STAC_INTEL_MAC_V4, .name = "intel-mac-v4" },
3651 { .id = STAC_INTEL_MAC_V5, .name = "intel-mac-v5" },
3652 { .id = STAC_INTEL_MAC_AUTO, .name = "intel-mac-auto" },
3653 { .id = STAC_ECS_202, .name = "ecs202" },
3654 { .id = STAC_922X_DELL_D81, .name = "dell-d81" },
3655 { .id = STAC_922X_DELL_D82, .name = "dell-d82" },
3656 { .id = STAC_922X_DELL_M81, .name = "dell-m81" },
3657 { .id = STAC_922X_DELL_M82, .name = "dell-m82" },
3658 /* for backward compatibility */
3659 { .id = STAC_INTEL_MAC_V3, .name = "macmini" },
3660 { .id = STAC_INTEL_MAC_V5, .name = "macbook" },
3661 { .id = STAC_INTEL_MAC_V3, .name = "macbook-pro-v1" },
3662 { .id = STAC_INTEL_MAC_V3, .name = "macbook-pro" },
3663 { .id = STAC_INTEL_MAC_V2, .name = "imac-intel" },
3664 { .id = STAC_INTEL_MAC_V3, .name = "imac-intel-20" },
3668 static const struct snd_pci_quirk stac922x_fixup_tbl[] = {
3669 /* SigmaTel reference board */
3670 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2668,
3671 "DFI LanParty", STAC_D945_REF),
3672 SND_PCI_QUIRK(PCI_VENDOR_ID_DFI, 0x3101,
3673 "DFI LanParty", STAC_D945_REF),
3674 /* Intel 945G based systems */
3675 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x0101,
3676 "Intel D945G", STAC_D945GTP3),
3677 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x0202,
3678 "Intel D945G", STAC_D945GTP3),
3679 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x0606,
3680 "Intel D945G", STAC_D945GTP3),
3681 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x0601,
3682 "Intel D945G", STAC_D945GTP3),
3683 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x0111,
3684 "Intel D945G", STAC_D945GTP3),
3685 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x1115,
3686 "Intel D945G", STAC_D945GTP3),
3687 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x1116,
3688 "Intel D945G", STAC_D945GTP3),
3689 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x1117,
3690 "Intel D945G", STAC_D945GTP3),
3691 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x1118,
3692 "Intel D945G", STAC_D945GTP3),
3693 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x1119,
3694 "Intel D945G", STAC_D945GTP3),
3695 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x8826,
3696 "Intel D945G", STAC_D945GTP3),
3697 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x5049,
3698 "Intel D945G", STAC_D945GTP3),
3699 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x5055,
3700 "Intel D945G", STAC_D945GTP3),
3701 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x5048,
3702 "Intel D945G", STAC_D945GTP3),
3703 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x0110,
3704 "Intel D945G", STAC_D945GTP3),
3705 /* Intel D945G 5-stack systems */
3706 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x0404,
3707 "Intel D945G", STAC_D945GTP5),
3708 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x0303,
3709 "Intel D945G", STAC_D945GTP5),
3710 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x0013,
3711 "Intel D945G", STAC_D945GTP5),
3712 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x0417,
3713 "Intel D945G", STAC_D945GTP5),
3714 /* Intel 945P based systems */
3715 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x0b0b,
3716 "Intel D945P", STAC_D945GTP3),
3717 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x0112,
3718 "Intel D945P", STAC_D945GTP3),
3719 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x0d0d,
3720 "Intel D945P", STAC_D945GTP3),
3721 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x0909,
3722 "Intel D945P", STAC_D945GTP3),
3723 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x0505,
3724 "Intel D945P", STAC_D945GTP3),
3725 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x0707,
3726 "Intel D945P", STAC_D945GTP5),
3728 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x0204,
3729 "Intel D945", STAC_D945_REF),
3732 /* Apple Intel Mac (Mac Mini, MacBook, MacBook Pro...) */
3733 SND_PCI_QUIRK(0x8384, 0x7680, "Mac", STAC_INTEL_MAC_AUTO),
3736 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01a7,
3737 "unknown Dell", STAC_922X_DELL_D81),
3738 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01a9,
3739 "unknown Dell", STAC_922X_DELL_D81),
3740 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01ab,
3741 "unknown Dell", STAC_922X_DELL_D81),
3742 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01ac,
3743 "unknown Dell", STAC_922X_DELL_D82),
3744 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01bf,
3745 "unknown Dell", STAC_922X_DELL_M81),
3746 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01d0,
3747 "unknown Dell", STAC_922X_DELL_D82),
3748 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01d1,
3749 "unknown Dell", STAC_922X_DELL_D81),
3750 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01d2,
3751 "unknown Dell", STAC_922X_DELL_D81),
3752 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01d7,
3753 "Dell XPS M1210", STAC_922X_DELL_M82),
3754 /* ECS/PC Chips boards */
3755 SND_PCI_QUIRK_MASK(0x1019, 0xf000, 0x2000,
3756 "ECS/PC chips", STAC_ECS_202),
3760 static const struct hda_pintbl ref927x_pin_configs[] = {
3761 { 0x0a, 0x02214020 },
3762 { 0x0b, 0x02a19080 },
3763 { 0x0c, 0x0181304e },
3764 { 0x0d, 0x01014010 },
3765 { 0x0e, 0x01a19040 },
3766 { 0x0f, 0x01011012 },
3767 { 0x10, 0x01016011 },
3768 { 0x11, 0x0101201f },
3769 { 0x12, 0x183301f0 },
3770 { 0x13, 0x18a001f0 },
3771 { 0x14, 0x18a001f0 },
3772 { 0x21, 0x01442070 },
3773 { 0x22, 0x01c42190 },
3774 { 0x23, 0x40000100 },
3778 static const struct hda_pintbl d965_3st_pin_configs[] = {
3779 { 0x0a, 0x0221401f },
3780 { 0x0b, 0x02a19120 },
3781 { 0x0c, 0x40000100 },
3782 { 0x0d, 0x01014011 },
3783 { 0x0e, 0x01a19021 },
3784 { 0x0f, 0x01813024 },
3785 { 0x10, 0x40000100 },
3786 { 0x11, 0x40000100 },
3787 { 0x12, 0x40000100 },
3788 { 0x13, 0x40000100 },
3789 { 0x14, 0x40000100 },
3790 { 0x21, 0x40000100 },
3791 { 0x22, 0x40000100 },
3792 { 0x23, 0x40000100 },
3796 static const struct hda_pintbl d965_5st_pin_configs[] = {
3797 { 0x0a, 0x02214020 },
3798 { 0x0b, 0x02a19080 },
3799 { 0x0c, 0x0181304e },
3800 { 0x0d, 0x01014010 },
3801 { 0x0e, 0x01a19040 },
3802 { 0x0f, 0x01011012 },
3803 { 0x10, 0x01016011 },
3804 { 0x11, 0x40000100 },
3805 { 0x12, 0x40000100 },
3806 { 0x13, 0x40000100 },
3807 { 0x14, 0x40000100 },
3808 { 0x21, 0x01442070 },
3809 { 0x22, 0x40000100 },
3810 { 0x23, 0x40000100 },
3814 static const struct hda_pintbl d965_5st_no_fp_pin_configs[] = {
3815 { 0x0a, 0x40000100 },
3816 { 0x0b, 0x40000100 },
3817 { 0x0c, 0x0181304e },
3818 { 0x0d, 0x01014010 },
3819 { 0x0e, 0x01a19040 },
3820 { 0x0f, 0x01011012 },
3821 { 0x10, 0x01016011 },
3822 { 0x11, 0x40000100 },
3823 { 0x12, 0x40000100 },
3824 { 0x13, 0x40000100 },
3825 { 0x14, 0x40000100 },
3826 { 0x21, 0x01442070 },
3827 { 0x22, 0x40000100 },
3828 { 0x23, 0x40000100 },
3832 static const struct hda_pintbl dell_3st_pin_configs[] = {
3833 { 0x0a, 0x02211230 },
3834 { 0x0b, 0x02a11220 },
3835 { 0x0c, 0x01a19040 },
3836 { 0x0d, 0x01114210 },
3837 { 0x0e, 0x01111212 },
3838 { 0x0f, 0x01116211 },
3839 { 0x10, 0x01813050 },
3840 { 0x11, 0x01112214 },
3841 { 0x12, 0x403003fa },
3842 { 0x13, 0x90a60040 },
3843 { 0x14, 0x90a60040 },
3844 { 0x21, 0x404003fb },
3845 { 0x22, 0x40c003fc },
3846 { 0x23, 0x40000100 },
3850 static void stac927x_fixup_ref_no_jd(struct hda_codec *codec,
3851 const struct hda_fixup *fix, int action)
3853 /* no jack detecion for ref-no-jd model */
3854 if (action == HDA_FIXUP_ACT_PRE_PROBE)
3855 codec->no_jack_detect = 1;
3858 static void stac927x_fixup_ref(struct hda_codec *codec,
3859 const struct hda_fixup *fix, int action)
3861 struct sigmatel_spec *spec = codec->spec;
3863 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
3864 snd_hda_apply_pincfgs(codec, ref927x_pin_configs);
3865 spec->eapd_mask = spec->gpio_mask = 0;
3866 spec->gpio_dir = spec->gpio_data = 0;
3870 static void stac927x_fixup_dell_dmic(struct hda_codec *codec,
3871 const struct hda_fixup *fix, int action)
3873 struct sigmatel_spec *spec = codec->spec;
3875 if (action != HDA_FIXUP_ACT_PRE_PROBE)
3878 if (codec->core.subsystem_id != 0x1028022f) {
3879 /* GPIO2 High = Enable EAPD */
3880 spec->eapd_mask = spec->gpio_mask = 0x04;
3881 spec->gpio_dir = spec->gpio_data = 0x04;
3884 snd_hda_add_verbs(codec, dell_3st_core_init);
3885 spec->volknob_init = 1;
3888 static void stac927x_fixup_volknob(struct hda_codec *codec,
3889 const struct hda_fixup *fix, int action)
3891 struct sigmatel_spec *spec = codec->spec;
3893 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
3894 snd_hda_add_verbs(codec, stac927x_volknob_core_init);
3895 spec->volknob_init = 1;
3899 static const struct hda_fixup stac927x_fixups[] = {
3900 [STAC_D965_REF_NO_JD] = {
3901 .type = HDA_FIXUP_FUNC,
3902 .v.func = stac927x_fixup_ref_no_jd,
3904 .chain_id = STAC_D965_REF,
3907 .type = HDA_FIXUP_FUNC,
3908 .v.func = stac927x_fixup_ref,
3911 .type = HDA_FIXUP_PINS,
3912 .v.pins = d965_3st_pin_configs,
3914 .chain_id = STAC_D965_VERBS,
3917 .type = HDA_FIXUP_PINS,
3918 .v.pins = d965_5st_pin_configs,
3920 .chain_id = STAC_D965_VERBS,
3922 [STAC_D965_VERBS] = {
3923 .type = HDA_FIXUP_VERBS,
3924 .v.verbs = d965_core_init,
3926 [STAC_D965_5ST_NO_FP] = {
3927 .type = HDA_FIXUP_PINS,
3928 .v.pins = d965_5st_no_fp_pin_configs,
3930 [STAC_NEMO_DEFAULT] = {
3931 .type = HDA_FIXUP_PINS,
3932 .v.pins = nemo_pin_configs,
3935 .type = HDA_FIXUP_PINS,
3936 .v.pins = dell_3st_pin_configs,
3938 .chain_id = STAC_927X_DELL_DMIC,
3940 [STAC_DELL_BIOS] = {
3941 .type = HDA_FIXUP_PINS,
3942 .v.pins = (const struct hda_pintbl[]) {
3943 /* correct the front output jack as a hp out */
3944 { 0x0f, 0x0221101f },
3945 /* correct the front input jack as a mic */
3946 { 0x0e, 0x02a79130 },
3950 .chain_id = STAC_927X_DELL_DMIC,
3952 [STAC_DELL_BIOS_AMIC] = {
3953 .type = HDA_FIXUP_PINS,
3954 .v.pins = (const struct hda_pintbl[]) {
3955 /* configure the analog microphone on some laptops */
3956 { 0x0c, 0x90a79130 },
3960 .chain_id = STAC_DELL_BIOS,
3962 [STAC_DELL_BIOS_SPDIF] = {
3963 .type = HDA_FIXUP_PINS,
3964 .v.pins = (const struct hda_pintbl[]) {
3965 /* correct the device field to SPDIF out */
3966 { 0x21, 0x01442070 },
3970 .chain_id = STAC_DELL_BIOS,
3972 [STAC_927X_DELL_DMIC] = {
3973 .type = HDA_FIXUP_FUNC,
3974 .v.func = stac927x_fixup_dell_dmic,
3976 [STAC_927X_VOLKNOB] = {
3977 .type = HDA_FIXUP_FUNC,
3978 .v.func = stac927x_fixup_volknob,
3982 static const struct hda_model_fixup stac927x_models[] = {
3983 { .id = STAC_D965_REF_NO_JD, .name = "ref-no-jd" },
3984 { .id = STAC_D965_REF, .name = "ref" },
3985 { .id = STAC_D965_3ST, .name = "3stack" },
3986 { .id = STAC_D965_5ST, .name = "5stack" },
3987 { .id = STAC_D965_5ST_NO_FP, .name = "5stack-no-fp" },
3988 { .id = STAC_DELL_3ST, .name = "dell-3stack" },
3989 { .id = STAC_DELL_BIOS, .name = "dell-bios" },
3990 { .id = STAC_NEMO_DEFAULT, .name = "nemo-default" },
3991 { .id = STAC_DELL_BIOS_AMIC, .name = "dell-bios-amic" },
3992 { .id = STAC_927X_VOLKNOB, .name = "volknob" },
3996 static const struct snd_pci_quirk stac927x_fixup_tbl[] = {
3997 /* SigmaTel reference board */
3998 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2668,
3999 "DFI LanParty", STAC_D965_REF),
4000 SND_PCI_QUIRK(PCI_VENDOR_ID_DFI, 0x3101,
4001 "DFI LanParty", STAC_D965_REF),
4002 /* Intel 946 based systems */
4003 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x3d01, "Intel D946", STAC_D965_3ST),
4004 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0xa301, "Intel D946", STAC_D965_3ST),
4005 /* 965 based 3 stack systems */
4006 SND_PCI_QUIRK_MASK(PCI_VENDOR_ID_INTEL, 0xff00, 0x2100,
4007 "Intel D965", STAC_D965_3ST),
4008 SND_PCI_QUIRK_MASK(PCI_VENDOR_ID_INTEL, 0xff00, 0x2000,
4009 "Intel D965", STAC_D965_3ST),
4010 /* Dell 3 stack systems */
4011 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01dd, "Dell Dimension E520", STAC_DELL_3ST),
4012 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01ed, "Dell ", STAC_DELL_3ST),
4013 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01f4, "Dell ", STAC_DELL_3ST),
4014 /* Dell 3 stack systems with verb table in BIOS */
4015 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01f3, "Dell Inspiron 1420", STAC_DELL_BIOS),
4016 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01f7, "Dell XPS M1730", STAC_DELL_BIOS),
4017 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0227, "Dell Vostro 1400 ", STAC_DELL_BIOS),
4018 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x022e, "Dell ", STAC_DELL_BIOS_SPDIF),
4019 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x022f, "Dell Inspiron 1525", STAC_DELL_BIOS),
4020 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0242, "Dell ", STAC_DELL_BIOS),
4021 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0243, "Dell ", STAC_DELL_BIOS),
4022 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x02ff, "Dell ", STAC_DELL_BIOS),
4023 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0209, "Dell XPS 1330", STAC_DELL_BIOS_SPDIF),
4024 /* 965 based 5 stack systems */
4025 SND_PCI_QUIRK_MASK(PCI_VENDOR_ID_INTEL, 0xff00, 0x2300,
4026 "Intel D965", STAC_D965_5ST),
4027 SND_PCI_QUIRK_MASK(PCI_VENDOR_ID_INTEL, 0xff00, 0x2500,
4028 "Intel D965", STAC_D965_5ST),
4030 SND_PCI_QUIRK(0x1888, 0x1000, "AmigaOne X1000", STAC_NEMO_DEFAULT),
4031 /* volume-knob fixes */
4032 SND_PCI_QUIRK_VENDOR(0x10cf, "FSC", STAC_927X_VOLKNOB),
4036 static const struct hda_pintbl ref9205_pin_configs[] = {
4037 { 0x0a, 0x40000100 },
4038 { 0x0b, 0x40000100 },
4039 { 0x0c, 0x01016011 },
4040 { 0x0d, 0x01014010 },
4041 { 0x0e, 0x01813122 },
4042 { 0x0f, 0x01a19021 },
4043 { 0x14, 0x01019020 },
4044 { 0x16, 0x40000100 },
4045 { 0x17, 0x90a000f0 },
4046 { 0x18, 0x90a000f0 },
4047 { 0x21, 0x01441030 },
4048 { 0x22, 0x01c41030 },
4053 STAC 9205 pin configs for
4060 10280228 (Dell Vostro 1500)
4061 10280229 (Dell Vostro 1700)
4063 static const struct hda_pintbl dell_9205_m42_pin_configs[] = {
4064 { 0x0a, 0x0321101F },
4065 { 0x0b, 0x03A11020 },
4066 { 0x0c, 0x400003FA },
4067 { 0x0d, 0x90170310 },
4068 { 0x0e, 0x400003FB },
4069 { 0x0f, 0x400003FC },
4070 { 0x14, 0x400003FD },
4071 { 0x16, 0x40F000F9 },
4072 { 0x17, 0x90A60330 },
4073 { 0x18, 0x400003FF },
4074 { 0x21, 0x0144131F },
4075 { 0x22, 0x40C003FE },
4080 STAC 9205 pin configs for
4084 102801FF (Dell Precision M4300)
4089 static const struct hda_pintbl dell_9205_m43_pin_configs[] = {
4090 { 0x0a, 0x0321101f },
4091 { 0x0b, 0x03a11020 },
4092 { 0x0c, 0x90a70330 },
4093 { 0x0d, 0x90170310 },
4094 { 0x0e, 0x400000fe },
4095 { 0x0f, 0x400000ff },
4096 { 0x14, 0x400000fd },
4097 { 0x16, 0x40f000f9 },
4098 { 0x17, 0x400000fa },
4099 { 0x18, 0x400000fc },
4100 { 0x21, 0x0144131f },
4101 { 0x22, 0x40c003f8 },
4102 /* Enable SPDIF in/out */
4103 { 0x1f, 0x01441030 },
4104 { 0x20, 0x1c410030 },
4108 static const struct hda_pintbl dell_9205_m44_pin_configs[] = {
4109 { 0x0a, 0x0421101f },
4110 { 0x0b, 0x04a11020 },
4111 { 0x0c, 0x400003fa },
4112 { 0x0d, 0x90170310 },
4113 { 0x0e, 0x400003fb },
4114 { 0x0f, 0x400003fc },
4115 { 0x14, 0x400003fd },
4116 { 0x16, 0x400003f9 },
4117 { 0x17, 0x90a60330 },
4118 { 0x18, 0x400003ff },
4119 { 0x21, 0x01441340 },
4120 { 0x22, 0x40c003fe },
4124 static void stac9205_fixup_ref(struct hda_codec *codec,
4125 const struct hda_fixup *fix, int action)
4127 struct sigmatel_spec *spec = codec->spec;
4129 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4130 snd_hda_apply_pincfgs(codec, ref9205_pin_configs);
4131 /* SPDIF-In enabled */
4132 spec->eapd_mask = spec->gpio_mask = spec->gpio_dir = 0;
4136 static void stac9205_fixup_dell_m43(struct hda_codec *codec,
4137 const struct hda_fixup *fix, int action)
4139 struct sigmatel_spec *spec = codec->spec;
4140 struct hda_jack_callback *jack;
4142 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4143 snd_hda_apply_pincfgs(codec, dell_9205_m43_pin_configs);
4145 /* Enable unsol response for GPIO4/Dock HP connection */
4146 snd_hda_codec_write_cache(codec, codec->core.afg, 0,
4147 AC_VERB_SET_GPIO_UNSOLICITED_RSP_MASK, 0x10);
4148 jack = snd_hda_jack_detect_enable_callback(codec, codec->core.afg,
4151 jack->private_data = 0x01;
4153 spec->gpio_dir = 0x0b;
4154 spec->eapd_mask = 0x01;
4155 spec->gpio_mask = 0x1b;
4156 spec->gpio_mute = 0x10;
4157 /* GPIO0 High = EAPD, GPIO1 Low = Headphone Mute,
4160 spec->gpio_data = 0x01;
4164 static void stac9205_fixup_eapd(struct hda_codec *codec,
4165 const struct hda_fixup *fix, int action)
4167 struct sigmatel_spec *spec = codec->spec;
4169 if (action == HDA_FIXUP_ACT_PRE_PROBE)
4170 spec->eapd_switch = 0;
4173 static const struct hda_fixup stac9205_fixups[] = {
4175 .type = HDA_FIXUP_FUNC,
4176 .v.func = stac9205_fixup_ref,
4178 [STAC_9205_DELL_M42] = {
4179 .type = HDA_FIXUP_PINS,
4180 .v.pins = dell_9205_m42_pin_configs,
4182 [STAC_9205_DELL_M43] = {
4183 .type = HDA_FIXUP_FUNC,
4184 .v.func = stac9205_fixup_dell_m43,
4186 [STAC_9205_DELL_M44] = {
4187 .type = HDA_FIXUP_PINS,
4188 .v.pins = dell_9205_m44_pin_configs,
4190 [STAC_9205_EAPD] = {
4191 .type = HDA_FIXUP_FUNC,
4192 .v.func = stac9205_fixup_eapd,
4197 static const struct hda_model_fixup stac9205_models[] = {
4198 { .id = STAC_9205_REF, .name = "ref" },
4199 { .id = STAC_9205_DELL_M42, .name = "dell-m42" },
4200 { .id = STAC_9205_DELL_M43, .name = "dell-m43" },
4201 { .id = STAC_9205_DELL_M44, .name = "dell-m44" },
4202 { .id = STAC_9205_EAPD, .name = "eapd" },
4206 static const struct snd_pci_quirk stac9205_fixup_tbl[] = {
4207 /* SigmaTel reference board */
4208 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2668,
4209 "DFI LanParty", STAC_9205_REF),
4210 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0xfb30,
4211 "SigmaTel", STAC_9205_REF),
4212 SND_PCI_QUIRK(PCI_VENDOR_ID_DFI, 0x3101,
4213 "DFI LanParty", STAC_9205_REF),
4215 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01f1,
4216 "unknown Dell", STAC_9205_DELL_M42),
4217 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01f2,
4218 "unknown Dell", STAC_9205_DELL_M42),
4219 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01f8,
4220 "Dell Precision", STAC_9205_DELL_M43),
4221 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01f9,
4222 "Dell Precision", STAC_9205_DELL_M43),
4223 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01fa,
4224 "Dell Precision", STAC_9205_DELL_M43),
4225 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01fc,
4226 "unknown Dell", STAC_9205_DELL_M42),
4227 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01fd,
4228 "unknown Dell", STAC_9205_DELL_M42),
4229 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01fe,
4230 "Dell Precision", STAC_9205_DELL_M43),
4231 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01ff,
4232 "Dell Precision M4300", STAC_9205_DELL_M43),
4233 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0204,
4234 "unknown Dell", STAC_9205_DELL_M42),
4235 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0206,
4236 "Dell Precision", STAC_9205_DELL_M43),
4237 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x021b,
4238 "Dell Precision", STAC_9205_DELL_M43),
4239 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x021c,
4240 "Dell Precision", STAC_9205_DELL_M43),
4241 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x021f,
4242 "Dell Inspiron", STAC_9205_DELL_M44),
4243 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0228,
4244 "Dell Vostro 1500", STAC_9205_DELL_M42),
4245 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0229,
4246 "Dell Vostro 1700", STAC_9205_DELL_M42),
4248 SND_PCI_QUIRK(0x107b, 0x0560, "Gateway T6834c", STAC_9205_EAPD),
4249 SND_PCI_QUIRK(0x107b, 0x0565, "Gateway T1616", STAC_9205_EAPD),
4253 static void stac92hd95_fixup_hp_led(struct hda_codec *codec,
4254 const struct hda_fixup *fix, int action)
4256 struct sigmatel_spec *spec = codec->spec;
4258 if (action != HDA_FIXUP_ACT_PRE_PROBE)
4261 if (find_mute_led_cfg(codec, spec->default_polarity))
4262 codec_dbg(codec, "mute LED gpio %d polarity %d\n",
4264 spec->gpio_led_polarity);
4267 static const struct hda_fixup stac92hd95_fixups[] = {
4268 [STAC_92HD95_HP_LED] = {
4269 .type = HDA_FIXUP_FUNC,
4270 .v.func = stac92hd95_fixup_hp_led,
4272 [STAC_92HD95_HP_BASS] = {
4273 .type = HDA_FIXUP_VERBS,
4274 .v.verbs = (const struct hda_verb[]) {
4275 {0x1a, 0x795, 0x00}, /* HPF to 100Hz */
4279 .chain_id = STAC_92HD95_HP_LED,
4283 static const struct snd_pci_quirk stac92hd95_fixup_tbl[] = {
4284 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x1911, "HP Spectre 13", STAC_92HD95_HP_BASS),
4288 static const struct hda_model_fixup stac92hd95_models[] = {
4289 { .id = STAC_92HD95_HP_LED, .name = "hp-led" },
4290 { .id = STAC_92HD95_HP_BASS, .name = "hp-bass" },
4295 static int stac_parse_auto_config(struct hda_codec *codec)
4297 struct sigmatel_spec *spec = codec->spec;
4301 if (spec->headset_jack)
4302 flags |= HDA_PINCFG_HEADSET_MIC;
4304 err = snd_hda_parse_pin_defcfg(codec, &spec->gen.autocfg, NULL, flags);
4309 spec->gen.pcm_playback_hook = stac_playback_pcm_hook;
4310 spec->gen.pcm_capture_hook = stac_capture_pcm_hook;
4312 spec->gen.automute_hook = stac_update_outputs;
4314 err = snd_hda_gen_parse_auto_config(codec, &spec->gen.autocfg);
4318 if (spec->vref_mute_led_nid) {
4319 err = snd_hda_gen_fix_pin_power(codec, spec->vref_mute_led_nid);
4324 /* setup analog beep controls */
4325 if (spec->anabeep_nid > 0) {
4326 err = stac_auto_create_beep_ctls(codec,
4332 /* setup digital beep controls and input device */
4333 #ifdef CONFIG_SND_HDA_INPUT_BEEP
4334 if (spec->gen.beep_nid) {
4335 hda_nid_t nid = spec->gen.beep_nid;
4338 err = stac_auto_create_beep_ctls(codec, nid);
4342 /* IDT/STAC codecs have linear beep tone parameter */
4343 codec->beep->linear_tone = spec->linear_tone_beep;
4344 /* if no beep switch is available, make its own one */
4345 caps = query_amp_caps(codec, nid, HDA_OUTPUT);
4346 if (!(caps & AC_AMPCAP_MUTE)) {
4347 err = stac_beep_switch_ctl(codec);
4356 spec->gen.vmaster_mute.hook = stac_vmaster_hook;
4358 if (spec->aloopback_ctl &&
4359 snd_hda_get_bool_hint(codec, "loopback") == 1) {
4360 unsigned int wr_verb =
4361 spec->aloopback_ctl->private_value >> 16;
4362 if (snd_hdac_regmap_add_vendor_verb(&codec->core, wr_verb))
4364 if (!snd_hda_gen_add_kctl(&spec->gen, NULL, spec->aloopback_ctl))
4368 if (spec->have_spdif_mux) {
4369 err = stac_create_spdif_mux_ctls(codec);
4374 stac_init_power_map(codec);
4379 static int stac_init(struct hda_codec *codec)
4381 struct sigmatel_spec *spec = codec->spec;
4384 /* override some hints */
4385 stac_store_hints(codec);
4388 /* turn on EAPD statically when spec->eapd_switch isn't set.
4389 * otherwise, unsol event will turn it on/off dynamically
4391 if (!spec->eapd_switch)
4392 spec->gpio_data |= spec->eapd_mask;
4393 stac_gpio_set(codec, spec->gpio_mask, spec->gpio_dir, spec->gpio_data);
4395 snd_hda_gen_init(codec);
4397 /* sync the power-map */
4399 snd_hda_codec_write(codec, codec->core.afg, 0,
4400 AC_VERB_IDT_SET_POWER_MAP,
4401 spec->power_map_bits);
4403 /* power down inactive ADCs */
4404 if (spec->powerdown_adcs) {
4405 for (i = 0; i < spec->gen.num_all_adcs; i++) {
4406 if (spec->active_adcs & (1 << i))
4408 snd_hda_codec_write(codec, spec->gen.all_adcs[i], 0,
4409 AC_VERB_SET_POWER_STATE,
4417 static void stac_shutup(struct hda_codec *codec)
4419 struct sigmatel_spec *spec = codec->spec;
4421 snd_hda_shutup_pins(codec);
4423 if (spec->eapd_mask)
4424 stac_gpio_set(codec, spec->gpio_mask,
4425 spec->gpio_dir, spec->gpio_data &
4429 #define stac_free snd_hda_gen_free
4431 #ifdef CONFIG_SND_PROC_FS
4432 static void stac92hd_proc_hook(struct snd_info_buffer *buffer,
4433 struct hda_codec *codec, hda_nid_t nid)
4435 if (nid == codec->core.afg)
4436 snd_iprintf(buffer, "Power-Map: 0x%02x\n",
4437 snd_hda_codec_read(codec, nid, 0,
4438 AC_VERB_IDT_GET_POWER_MAP, 0));
4441 static void analog_loop_proc_hook(struct snd_info_buffer *buffer,
4442 struct hda_codec *codec,
4445 snd_iprintf(buffer, "Analog Loopback: 0x%02x\n",
4446 snd_hda_codec_read(codec, codec->core.afg, 0, verb, 0));
4449 /* stac92hd71bxx, stac92hd73xx */
4450 static void stac92hd7x_proc_hook(struct snd_info_buffer *buffer,
4451 struct hda_codec *codec, hda_nid_t nid)
4453 stac92hd_proc_hook(buffer, codec, nid);
4454 if (nid == codec->core.afg)
4455 analog_loop_proc_hook(buffer, codec, 0xfa0);
4458 static void stac9205_proc_hook(struct snd_info_buffer *buffer,
4459 struct hda_codec *codec, hda_nid_t nid)
4461 if (nid == codec->core.afg)
4462 analog_loop_proc_hook(buffer, codec, 0xfe0);
4465 static void stac927x_proc_hook(struct snd_info_buffer *buffer,
4466 struct hda_codec *codec, hda_nid_t nid)
4468 if (nid == codec->core.afg)
4469 analog_loop_proc_hook(buffer, codec, 0xfeb);
4472 #define stac92hd_proc_hook NULL
4473 #define stac92hd7x_proc_hook NULL
4474 #define stac9205_proc_hook NULL
4475 #define stac927x_proc_hook NULL
4479 static int stac_suspend(struct hda_codec *codec)
4485 #define stac_suspend NULL
4486 #endif /* CONFIG_PM */
4488 static const struct hda_codec_ops stac_patch_ops = {
4489 .build_controls = snd_hda_gen_build_controls,
4490 .build_pcms = snd_hda_gen_build_pcms,
4493 .unsol_event = snd_hda_jack_unsol_event,
4495 .suspend = stac_suspend,
4497 .reboot_notify = stac_shutup,
4500 static int alloc_stac_spec(struct hda_codec *codec)
4502 struct sigmatel_spec *spec;
4504 spec = kzalloc(sizeof(*spec), GFP_KERNEL);
4507 snd_hda_gen_spec_init(&spec->gen);
4509 codec->no_trigger_sense = 1; /* seems common with STAC/IDT codecs */
4510 spec->gen.dac_min_mute = true;
4511 codec->patch_ops = stac_patch_ops;
4515 static int patch_stac9200(struct hda_codec *codec)
4517 struct sigmatel_spec *spec;
4520 err = alloc_stac_spec(codec);
4525 spec->linear_tone_beep = 1;
4526 spec->gen.own_eapd_ctl = 1;
4528 codec->power_filter = snd_hda_codec_eapd_power_filter;
4530 snd_hda_add_verbs(codec, stac9200_eapd_init);
4532 snd_hda_pick_fixup(codec, stac9200_models, stac9200_fixup_tbl,
4534 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
4536 err = stac_parse_auto_config(codec);
4542 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
4547 static int patch_stac925x(struct hda_codec *codec)
4549 struct sigmatel_spec *spec;
4552 err = alloc_stac_spec(codec);
4557 spec->linear_tone_beep = 1;
4558 spec->gen.own_eapd_ctl = 1;
4560 snd_hda_add_verbs(codec, stac925x_core_init);
4562 snd_hda_pick_fixup(codec, stac925x_models, stac925x_fixup_tbl,
4564 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
4566 err = stac_parse_auto_config(codec);
4572 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
4577 static int patch_stac92hd73xx(struct hda_codec *codec)
4579 struct sigmatel_spec *spec;
4583 err = alloc_stac_spec(codec);
4588 /* enable power_save_node only for new 92HD89xx chips, as it causes
4589 * click noises on old 92HD73xx chips.
4591 if ((codec->core.vendor_id & 0xfffffff0) != 0x111d7670)
4592 codec->power_save_node = 1;
4593 spec->linear_tone_beep = 0;
4594 spec->gen.mixer_nid = 0x1d;
4595 spec->have_spdif_mux = 1;
4597 num_dacs = snd_hda_get_num_conns(codec, 0x0a) - 1;
4598 if (num_dacs < 3 || num_dacs > 5) {
4600 "Could not determine number of channels defaulting to DAC count\n");
4605 case 0x3: /* 6 Channel */
4606 spec->aloopback_ctl = &stac92hd73xx_6ch_loopback;
4608 case 0x4: /* 8 Channel */
4609 spec->aloopback_ctl = &stac92hd73xx_8ch_loopback;
4611 case 0x5: /* 10 Channel */
4612 spec->aloopback_ctl = &stac92hd73xx_10ch_loopback;
4616 spec->aloopback_mask = 0x01;
4617 spec->aloopback_shift = 8;
4619 spec->gen.beep_nid = 0x1c; /* digital beep */
4621 /* GPIO0 High = Enable EAPD */
4622 spec->eapd_mask = spec->gpio_mask = spec->gpio_dir = 0x1;
4623 spec->gpio_data = 0x01;
4625 spec->eapd_switch = 1;
4627 spec->num_pwrs = ARRAY_SIZE(stac92hd73xx_pwr_nids);
4628 spec->pwr_nids = stac92hd73xx_pwr_nids;
4630 spec->gen.own_eapd_ctl = 1;
4631 spec->gen.power_down_unused = 1;
4633 snd_hda_pick_fixup(codec, stac92hd73xx_models, stac92hd73xx_fixup_tbl,
4634 stac92hd73xx_fixups);
4635 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
4637 if (!spec->volknob_init)
4638 snd_hda_add_verbs(codec, stac92hd73xx_core_init);
4640 err = stac_parse_auto_config(codec);
4646 /* Don't GPIO-mute speakers if there are no internal speakers, because
4647 * the GPIO might be necessary for Headphone
4649 if (spec->eapd_switch && !has_builtin_speaker(codec))
4650 spec->eapd_switch = 0;
4652 codec->proc_widget_hook = stac92hd7x_proc_hook;
4654 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
4659 static void stac_setup_gpio(struct hda_codec *codec)
4661 struct sigmatel_spec *spec = codec->spec;
4663 spec->gpio_mask |= spec->eapd_mask;
4664 if (spec->gpio_led) {
4665 if (!spec->vref_mute_led_nid) {
4666 spec->gpio_mask |= spec->gpio_led;
4667 spec->gpio_dir |= spec->gpio_led;
4668 spec->gpio_data |= spec->gpio_led;
4670 codec->power_filter = stac_vref_led_power_filter;
4674 if (spec->mic_mute_led_gpio) {
4675 spec->gpio_mask |= spec->mic_mute_led_gpio;
4676 spec->gpio_dir |= spec->mic_mute_led_gpio;
4677 spec->mic_enabled = 0;
4678 spec->gpio_data |= spec->mic_mute_led_gpio;
4680 spec->gen.cap_sync_hook = stac_capture_led_hook;
4684 static int patch_stac92hd83xxx(struct hda_codec *codec)
4686 struct sigmatel_spec *spec;
4689 err = alloc_stac_spec(codec);
4693 /* longer delay needed for D3 */
4694 codec->core.power_caps &= ~AC_PWRST_EPSS;
4697 codec->power_save_node = 1;
4698 spec->linear_tone_beep = 0;
4699 spec->gen.own_eapd_ctl = 1;
4700 spec->gen.power_down_unused = 1;
4701 spec->gen.mixer_nid = 0x1b;
4703 spec->gen.beep_nid = 0x21; /* digital beep */
4704 spec->pwr_nids = stac92hd83xxx_pwr_nids;
4705 spec->num_pwrs = ARRAY_SIZE(stac92hd83xxx_pwr_nids);
4706 spec->default_polarity = -1; /* no default cfg */
4708 snd_hda_add_verbs(codec, stac92hd83xxx_core_init);
4710 snd_hda_pick_fixup(codec, stac92hd83xxx_models, stac92hd83xxx_fixup_tbl,
4711 stac92hd83xxx_fixups);
4712 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
4714 stac_setup_gpio(codec);
4716 err = stac_parse_auto_config(codec);
4722 codec->proc_widget_hook = stac92hd_proc_hook;
4724 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
4729 static const hda_nid_t stac92hd95_pwr_nids[] = {
4730 0x0a, 0x0b, 0x0c, 0x0d
4733 static int patch_stac92hd95(struct hda_codec *codec)
4735 struct sigmatel_spec *spec;
4738 err = alloc_stac_spec(codec);
4742 /* longer delay needed for D3 */
4743 codec->core.power_caps &= ~AC_PWRST_EPSS;
4746 codec->power_save_node = 1;
4747 spec->linear_tone_beep = 0;
4748 spec->gen.own_eapd_ctl = 1;
4749 spec->gen.power_down_unused = 1;
4751 spec->gen.beep_nid = 0x19; /* digital beep */
4752 spec->pwr_nids = stac92hd95_pwr_nids;
4753 spec->num_pwrs = ARRAY_SIZE(stac92hd95_pwr_nids);
4754 spec->default_polarity = 0;
4756 snd_hda_pick_fixup(codec, stac92hd95_models, stac92hd95_fixup_tbl,
4758 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
4760 stac_setup_gpio(codec);
4762 err = stac_parse_auto_config(codec);
4768 codec->proc_widget_hook = stac92hd_proc_hook;
4770 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
4775 static int patch_stac92hd71bxx(struct hda_codec *codec)
4777 struct sigmatel_spec *spec;
4778 const hda_nid_t *unmute_nids = stac92hd71bxx_unmute_nids;
4781 err = alloc_stac_spec(codec);
4786 /* disabled power_save_node since it causes noises on a Dell machine */
4787 /* codec->power_save_node = 1; */
4788 spec->linear_tone_beep = 0;
4789 spec->gen.own_eapd_ctl = 1;
4790 spec->gen.power_down_unused = 1;
4791 spec->gen.mixer_nid = 0x17;
4792 spec->have_spdif_mux = 1;
4795 spec->gpio_mask = 0x01;
4796 spec->gpio_dir = 0x01;
4797 spec->gpio_data = 0x01;
4799 switch (codec->core.vendor_id) {
4800 case 0x111d76b6: /* 4 Port without Analog Mixer */
4804 case 0x111d7608: /* 5 Port with Analog Mixer */
4805 if ((codec->core.revision_id & 0xf) == 0 ||
4806 (codec->core.revision_id & 0xf) == 1)
4807 spec->stream_delay = 40; /* 40 milliseconds */
4811 snd_hda_codec_set_pincfg(codec, 0x0f, 0x40f000f0);
4812 snd_hda_codec_set_pincfg(codec, 0x19, 0x40f000f3);
4814 case 0x111d7603: /* 6 Port with Analog Mixer */
4815 if ((codec->core.revision_id & 0xf) == 1)
4816 spec->stream_delay = 40; /* 40 milliseconds */
4821 if (get_wcaps_type(get_wcaps(codec, 0x28)) == AC_WID_VOL_KNB)
4822 snd_hda_add_verbs(codec, stac92hd71bxx_core_init);
4824 if (get_wcaps(codec, 0xa) & AC_WCAP_IN_AMP) {
4826 for (p = unmute_nids; *p; p++)
4827 snd_hda_codec_amp_init_stereo(codec, *p, HDA_INPUT, 0,
4831 spec->aloopback_ctl = &stac92hd71bxx_loopback;
4832 spec->aloopback_mask = 0x50;
4833 spec->aloopback_shift = 0;
4835 spec->powerdown_adcs = 1;
4836 spec->gen.beep_nid = 0x26; /* digital beep */
4837 spec->num_pwrs = ARRAY_SIZE(stac92hd71bxx_pwr_nids);
4838 spec->pwr_nids = stac92hd71bxx_pwr_nids;
4840 snd_hda_pick_fixup(codec, stac92hd71bxx_models, stac92hd71bxx_fixup_tbl,
4841 stac92hd71bxx_fixups);
4842 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
4844 stac_setup_gpio(codec);
4846 err = stac_parse_auto_config(codec);
4852 codec->proc_widget_hook = stac92hd7x_proc_hook;
4854 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
4859 static int patch_stac922x(struct hda_codec *codec)
4861 struct sigmatel_spec *spec;
4864 err = alloc_stac_spec(codec);
4869 spec->linear_tone_beep = 1;
4870 spec->gen.own_eapd_ctl = 1;
4872 snd_hda_add_verbs(codec, stac922x_core_init);
4874 /* Fix Mux capture level; max to 2 */
4875 snd_hda_override_amp_caps(codec, 0x12, HDA_OUTPUT,
4876 (0 << AC_AMPCAP_OFFSET_SHIFT) |
4877 (2 << AC_AMPCAP_NUM_STEPS_SHIFT) |
4878 (0x27 << AC_AMPCAP_STEP_SIZE_SHIFT) |
4879 (0 << AC_AMPCAP_MUTE_SHIFT));
4881 snd_hda_pick_fixup(codec, stac922x_models, stac922x_fixup_tbl,
4883 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
4885 err = stac_parse_auto_config(codec);
4891 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
4896 static const char * const stac927x_spdif_labels[] = {
4897 "Digital Playback", "ADAT", "Analog Mux 1",
4898 "Analog Mux 2", "Analog Mux 3", NULL
4901 static int patch_stac927x(struct hda_codec *codec)
4903 struct sigmatel_spec *spec;
4906 err = alloc_stac_spec(codec);
4911 spec->linear_tone_beep = 1;
4912 spec->gen.own_eapd_ctl = 1;
4913 spec->have_spdif_mux = 1;
4914 spec->spdif_labels = stac927x_spdif_labels;
4916 spec->gen.beep_nid = 0x23; /* digital beep */
4918 /* GPIO0 High = Enable EAPD */
4919 spec->eapd_mask = spec->gpio_mask = 0x01;
4920 spec->gpio_dir = spec->gpio_data = 0x01;
4922 spec->aloopback_ctl = &stac927x_loopback;
4923 spec->aloopback_mask = 0x40;
4924 spec->aloopback_shift = 0;
4925 spec->eapd_switch = 1;
4927 snd_hda_pick_fixup(codec, stac927x_models, stac927x_fixup_tbl,
4929 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
4931 if (!spec->volknob_init)
4932 snd_hda_add_verbs(codec, stac927x_core_init);
4934 err = stac_parse_auto_config(codec);
4940 codec->proc_widget_hook = stac927x_proc_hook;
4944 * The STAC927x seem to require fairly long delays for certain
4945 * command sequences. With too short delays (even if the answer
4946 * is set to RIRB properly), it results in the silence output
4947 * on some hardwares like Dell.
4949 * The below flag enables the longer delay (see get_response
4952 codec->bus->needs_damn_long_delay = 1;
4954 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
4959 static int patch_stac9205(struct hda_codec *codec)
4961 struct sigmatel_spec *spec;
4964 err = alloc_stac_spec(codec);
4969 spec->linear_tone_beep = 1;
4970 spec->gen.own_eapd_ctl = 1;
4971 spec->have_spdif_mux = 1;
4973 spec->gen.beep_nid = 0x23; /* digital beep */
4975 snd_hda_add_verbs(codec, stac9205_core_init);
4976 spec->aloopback_ctl = &stac9205_loopback;
4978 spec->aloopback_mask = 0x40;
4979 spec->aloopback_shift = 0;
4981 /* GPIO0 High = EAPD */
4982 spec->eapd_mask = spec->gpio_mask = spec->gpio_dir = 0x1;
4983 spec->gpio_data = 0x01;
4985 /* Turn on/off EAPD per HP plugging */
4986 spec->eapd_switch = 1;
4988 snd_hda_pick_fixup(codec, stac9205_models, stac9205_fixup_tbl,
4990 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
4992 err = stac_parse_auto_config(codec);
4998 codec->proc_widget_hook = stac9205_proc_hook;
5000 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
5009 static const struct hda_verb stac9872_core_init[] = {
5010 {0x15, AC_VERB_SET_CONNECT_SEL, 0x1}, /* mic-sel: 0a,0d,14,02 */
5011 {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, /* Mic-in -> 0x9 */
5015 static const struct hda_pintbl stac9872_vaio_pin_configs[] = {
5016 { 0x0a, 0x03211020 },
5017 { 0x0b, 0x411111f0 },
5018 { 0x0c, 0x411111f0 },
5019 { 0x0d, 0x03a15030 },
5020 { 0x0e, 0x411111f0 },
5021 { 0x0f, 0x90170110 },
5022 { 0x11, 0x411111f0 },
5023 { 0x13, 0x411111f0 },
5024 { 0x14, 0x90a7013e },
5028 static const struct hda_model_fixup stac9872_models[] = {
5029 { .id = STAC_9872_VAIO, .name = "vaio" },
5033 static const struct hda_fixup stac9872_fixups[] = {
5034 [STAC_9872_VAIO] = {
5035 .type = HDA_FIXUP_PINS,
5036 .v.pins = stac9872_vaio_pin_configs,
5040 static const struct snd_pci_quirk stac9872_fixup_tbl[] = {
5041 SND_PCI_QUIRK_MASK(0x104d, 0xfff0, 0x81e0,
5042 "Sony VAIO F/S", STAC_9872_VAIO),
5046 static int patch_stac9872(struct hda_codec *codec)
5048 struct sigmatel_spec *spec;
5051 err = alloc_stac_spec(codec);
5056 spec->linear_tone_beep = 1;
5057 spec->gen.own_eapd_ctl = 1;
5059 snd_hda_add_verbs(codec, stac9872_core_init);
5061 snd_hda_pick_fixup(codec, stac9872_models, stac9872_fixup_tbl,
5063 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
5065 err = stac_parse_auto_config(codec);
5071 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
5080 static const struct hda_device_id snd_hda_id_sigmatel[] = {
5081 HDA_CODEC_ENTRY(0x83847690, "STAC9200", patch_stac9200),
5082 HDA_CODEC_ENTRY(0x83847882, "STAC9220 A1", patch_stac922x),
5083 HDA_CODEC_ENTRY(0x83847680, "STAC9221 A1", patch_stac922x),
5084 HDA_CODEC_ENTRY(0x83847880, "STAC9220 A2", patch_stac922x),
5085 HDA_CODEC_ENTRY(0x83847681, "STAC9220D/9223D A2", patch_stac922x),
5086 HDA_CODEC_ENTRY(0x83847682, "STAC9221 A2", patch_stac922x),
5087 HDA_CODEC_ENTRY(0x83847683, "STAC9221D A2", patch_stac922x),
5088 HDA_CODEC_ENTRY(0x83847618, "STAC9227", patch_stac927x),
5089 HDA_CODEC_ENTRY(0x83847619, "STAC9227", patch_stac927x),
5090 HDA_CODEC_ENTRY(0x83847638, "STAC92HD700", patch_stac927x),
5091 HDA_CODEC_ENTRY(0x83847616, "STAC9228", patch_stac927x),
5092 HDA_CODEC_ENTRY(0x83847617, "STAC9228", patch_stac927x),
5093 HDA_CODEC_ENTRY(0x83847614, "STAC9229", patch_stac927x),
5094 HDA_CODEC_ENTRY(0x83847615, "STAC9229", patch_stac927x),
5095 HDA_CODEC_ENTRY(0x83847620, "STAC9274", patch_stac927x),
5096 HDA_CODEC_ENTRY(0x83847621, "STAC9274D", patch_stac927x),
5097 HDA_CODEC_ENTRY(0x83847622, "STAC9273X", patch_stac927x),
5098 HDA_CODEC_ENTRY(0x83847623, "STAC9273D", patch_stac927x),
5099 HDA_CODEC_ENTRY(0x83847624, "STAC9272X", patch_stac927x),
5100 HDA_CODEC_ENTRY(0x83847625, "STAC9272D", patch_stac927x),
5101 HDA_CODEC_ENTRY(0x83847626, "STAC9271X", patch_stac927x),
5102 HDA_CODEC_ENTRY(0x83847627, "STAC9271D", patch_stac927x),
5103 HDA_CODEC_ENTRY(0x83847628, "STAC9274X5NH", patch_stac927x),
5104 HDA_CODEC_ENTRY(0x83847629, "STAC9274D5NH", patch_stac927x),
5105 HDA_CODEC_ENTRY(0x83847632, "STAC9202", patch_stac925x),
5106 HDA_CODEC_ENTRY(0x83847633, "STAC9202D", patch_stac925x),
5107 HDA_CODEC_ENTRY(0x83847634, "STAC9250", patch_stac925x),
5108 HDA_CODEC_ENTRY(0x83847635, "STAC9250D", patch_stac925x),
5109 HDA_CODEC_ENTRY(0x83847636, "STAC9251", patch_stac925x),
5110 HDA_CODEC_ENTRY(0x83847637, "STAC9250D", patch_stac925x),
5111 HDA_CODEC_ENTRY(0x83847645, "92HD206X", patch_stac927x),
5112 HDA_CODEC_ENTRY(0x83847646, "92HD206D", patch_stac927x),
5113 /* The following does not take into account .id=0x83847661 when subsys =
5114 * 104D0C00 which is STAC9225s. Because of this, some SZ Notebooks are
5115 * currently not fully supported.
5117 HDA_CODEC_ENTRY(0x83847661, "CXD9872RD/K", patch_stac9872),
5118 HDA_CODEC_ENTRY(0x83847662, "STAC9872AK", patch_stac9872),
5119 HDA_CODEC_ENTRY(0x83847664, "CXD9872AKD", patch_stac9872),
5120 HDA_CODEC_ENTRY(0x83847698, "STAC9205", patch_stac9205),
5121 HDA_CODEC_ENTRY(0x838476a0, "STAC9205", patch_stac9205),
5122 HDA_CODEC_ENTRY(0x838476a1, "STAC9205D", patch_stac9205),
5123 HDA_CODEC_ENTRY(0x838476a2, "STAC9204", patch_stac9205),
5124 HDA_CODEC_ENTRY(0x838476a3, "STAC9204D", patch_stac9205),
5125 HDA_CODEC_ENTRY(0x838476a4, "STAC9255", patch_stac9205),
5126 HDA_CODEC_ENTRY(0x838476a5, "STAC9255D", patch_stac9205),
5127 HDA_CODEC_ENTRY(0x838476a6, "STAC9254", patch_stac9205),
5128 HDA_CODEC_ENTRY(0x838476a7, "STAC9254D", patch_stac9205),
5129 HDA_CODEC_ENTRY(0x111d7603, "92HD75B3X5", patch_stac92hd71bxx),
5130 HDA_CODEC_ENTRY(0x111d7604, "92HD83C1X5", patch_stac92hd83xxx),
5131 HDA_CODEC_ENTRY(0x111d76d4, "92HD83C1C5", patch_stac92hd83xxx),
5132 HDA_CODEC_ENTRY(0x111d7605, "92HD81B1X5", patch_stac92hd83xxx),
5133 HDA_CODEC_ENTRY(0x111d76d5, "92HD81B1C5", patch_stac92hd83xxx),
5134 HDA_CODEC_ENTRY(0x111d76d1, "92HD87B1/3", patch_stac92hd83xxx),
5135 HDA_CODEC_ENTRY(0x111d76d9, "92HD87B2/4", patch_stac92hd83xxx),
5136 HDA_CODEC_ENTRY(0x111d7666, "92HD88B3", patch_stac92hd83xxx),
5137 HDA_CODEC_ENTRY(0x111d7667, "92HD88B1", patch_stac92hd83xxx),
5138 HDA_CODEC_ENTRY(0x111d7668, "92HD88B2", patch_stac92hd83xxx),
5139 HDA_CODEC_ENTRY(0x111d7669, "92HD88B4", patch_stac92hd83xxx),
5140 HDA_CODEC_ENTRY(0x111d7608, "92HD75B2X5", patch_stac92hd71bxx),
5141 HDA_CODEC_ENTRY(0x111d7674, "92HD73D1X5", patch_stac92hd73xx),
5142 HDA_CODEC_ENTRY(0x111d7675, "92HD73C1X5", patch_stac92hd73xx),
5143 HDA_CODEC_ENTRY(0x111d7676, "92HD73E1X5", patch_stac92hd73xx),
5144 HDA_CODEC_ENTRY(0x111d7695, "92HD95", patch_stac92hd95),
5145 HDA_CODEC_ENTRY(0x111d76b0, "92HD71B8X", patch_stac92hd71bxx),
5146 HDA_CODEC_ENTRY(0x111d76b1, "92HD71B8X", patch_stac92hd71bxx),
5147 HDA_CODEC_ENTRY(0x111d76b2, "92HD71B7X", patch_stac92hd71bxx),
5148 HDA_CODEC_ENTRY(0x111d76b3, "92HD71B7X", patch_stac92hd71bxx),
5149 HDA_CODEC_ENTRY(0x111d76b4, "92HD71B6X", patch_stac92hd71bxx),
5150 HDA_CODEC_ENTRY(0x111d76b5, "92HD71B6X", patch_stac92hd71bxx),
5151 HDA_CODEC_ENTRY(0x111d76b6, "92HD71B5X", patch_stac92hd71bxx),
5152 HDA_CODEC_ENTRY(0x111d76b7, "92HD71B5X", patch_stac92hd71bxx),
5153 HDA_CODEC_ENTRY(0x111d76c0, "92HD89C3", patch_stac92hd73xx),
5154 HDA_CODEC_ENTRY(0x111d76c1, "92HD89C2", patch_stac92hd73xx),
5155 HDA_CODEC_ENTRY(0x111d76c2, "92HD89C1", patch_stac92hd73xx),
5156 HDA_CODEC_ENTRY(0x111d76c3, "92HD89B3", patch_stac92hd73xx),
5157 HDA_CODEC_ENTRY(0x111d76c4, "92HD89B2", patch_stac92hd73xx),
5158 HDA_CODEC_ENTRY(0x111d76c5, "92HD89B1", patch_stac92hd73xx),
5159 HDA_CODEC_ENTRY(0x111d76c6, "92HD89E3", patch_stac92hd73xx),
5160 HDA_CODEC_ENTRY(0x111d76c7, "92HD89E2", patch_stac92hd73xx),
5161 HDA_CODEC_ENTRY(0x111d76c8, "92HD89E1", patch_stac92hd73xx),
5162 HDA_CODEC_ENTRY(0x111d76c9, "92HD89D3", patch_stac92hd73xx),
5163 HDA_CODEC_ENTRY(0x111d76ca, "92HD89D2", patch_stac92hd73xx),
5164 HDA_CODEC_ENTRY(0x111d76cb, "92HD89D1", patch_stac92hd73xx),
5165 HDA_CODEC_ENTRY(0x111d76cc, "92HD89F3", patch_stac92hd73xx),
5166 HDA_CODEC_ENTRY(0x111d76cd, "92HD89F2", patch_stac92hd73xx),
5167 HDA_CODEC_ENTRY(0x111d76ce, "92HD89F1", patch_stac92hd73xx),
5168 HDA_CODEC_ENTRY(0x111d76df, "92HD93BXX", patch_stac92hd83xxx),
5169 HDA_CODEC_ENTRY(0x111d76e0, "92HD91BXX", patch_stac92hd83xxx),
5170 HDA_CODEC_ENTRY(0x111d76e3, "92HD98BXX", patch_stac92hd83xxx),
5171 HDA_CODEC_ENTRY(0x111d76e5, "92HD99BXX", patch_stac92hd83xxx),
5172 HDA_CODEC_ENTRY(0x111d76e7, "92HD90BXX", patch_stac92hd83xxx),
5173 HDA_CODEC_ENTRY(0x111d76e8, "92HD66B1X5", patch_stac92hd83xxx),
5174 HDA_CODEC_ENTRY(0x111d76e9, "92HD66B2X5", patch_stac92hd83xxx),
5175 HDA_CODEC_ENTRY(0x111d76ea, "92HD66B3X5", patch_stac92hd83xxx),
5176 HDA_CODEC_ENTRY(0x111d76eb, "92HD66C1X5", patch_stac92hd83xxx),
5177 HDA_CODEC_ENTRY(0x111d76ec, "92HD66C2X5", patch_stac92hd83xxx),
5178 HDA_CODEC_ENTRY(0x111d76ed, "92HD66C3X5", patch_stac92hd83xxx),
5179 HDA_CODEC_ENTRY(0x111d76ee, "92HD66B1X3", patch_stac92hd83xxx),
5180 HDA_CODEC_ENTRY(0x111d76ef, "92HD66B2X3", patch_stac92hd83xxx),
5181 HDA_CODEC_ENTRY(0x111d76f0, "92HD66B3X3", patch_stac92hd83xxx),
5182 HDA_CODEC_ENTRY(0x111d76f1, "92HD66C1X3", patch_stac92hd83xxx),
5183 HDA_CODEC_ENTRY(0x111d76f2, "92HD66C2X3", patch_stac92hd83xxx),
5184 HDA_CODEC_ENTRY(0x111d76f3, "92HD66C3/65", patch_stac92hd83xxx),
5187 MODULE_DEVICE_TABLE(hdaudio, snd_hda_id_sigmatel);
5189 MODULE_LICENSE("GPL");
5190 MODULE_DESCRIPTION("IDT/Sigmatel HD-audio codec");
5192 static struct hda_codec_driver sigmatel_driver = {
5193 .id = snd_hda_id_sigmatel,
5196 module_hda_codec_driver(sigmatel_driver);