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 <sound/tlv.h>
36 #include "hda_codec.h"
37 #include "hda_local.h"
38 #include "hda_auto_parser.h"
41 #include "hda_generic.h"
78 STAC_92HD73XX_NO_JD, /* no jack-detection */
86 STAC_92HD89XX_HP_FRONT_JACK,
87 STAC_92HD89XX_HP_Z1_G2_RIGHT_MIC_JACK,
93 STAC_92HD83XXX_PWR_REF,
95 STAC_DELL_VOSTRO_3500,
96 STAC_92HD83XXX_HP_cNB11_INTQUAD,
99 STAC_92HD83XXX_HP_LED,
100 STAC_92HD83XXX_HP_INV_LED,
101 STAC_92HD83XXX_HP_MIC_LED,
103 STAC_92HD83XXX_HEADSET_JACK,
106 STAC_92HD83XXX_MODELS
119 STAC_92HD71BXX_NO_DMIC,
120 STAC_92HD71BXX_NO_SMUX,
121 STAC_92HD71BXX_MODELS
151 STAC_922X_INTEL_MAC_GPIO,
156 STAC_D965_REF_NO_JD, /* no jack-detection */
164 STAC_DELL_BIOS_SPDIF,
175 struct sigmatel_spec {
176 struct hda_gen_spec gen;
178 unsigned int eapd_switch: 1;
179 unsigned int linear_tone_beep:1;
180 unsigned int headset_jack:1; /* 4-pin headset jack (hp + mono mic) */
181 unsigned int volknob_init:1; /* special volume-knob initialization */
182 unsigned int powerdown_adcs:1;
183 unsigned int have_spdif_mux:1;
186 unsigned int eapd_mask;
187 unsigned int gpio_mask;
188 unsigned int gpio_dir;
189 unsigned int gpio_data;
190 unsigned int gpio_mute;
191 unsigned int gpio_led;
192 unsigned int gpio_led_polarity;
193 unsigned int vref_mute_led_nid; /* pin NID for mute-LED vref control */
194 unsigned int vref_led;
195 int default_polarity;
197 unsigned int mic_mute_led_gpio; /* capture mute LED GPIO */
198 bool mic_mute_led_on; /* current mic mute state */
201 unsigned int stream_delay;
203 /* analog loopback */
204 const struct snd_kcontrol_new *aloopback_ctl;
205 unsigned int aloopback;
206 unsigned char aloopback_mask;
207 unsigned char aloopback_shift;
209 /* power management */
210 unsigned int power_map_bits;
211 unsigned int num_pwrs;
212 const hda_nid_t *pwr_nids;
213 unsigned int active_adcs;
216 hda_nid_t anabeep_nid;
219 const char * const *spdif_labels;
220 struct hda_input_mux spdif_mux;
221 unsigned int cur_smux[2];
224 #define AC_VERB_IDT_SET_POWER_MAP 0x7ec
225 #define AC_VERB_IDT_GET_POWER_MAP 0xfec
227 static const hda_nid_t stac92hd73xx_pwr_nids[8] = {
228 0x0a, 0x0b, 0x0c, 0xd, 0x0e,
232 static const hda_nid_t stac92hd83xxx_pwr_nids[7] = {
233 0x0a, 0x0b, 0x0c, 0xd, 0x0e,
237 static const hda_nid_t stac92hd71bxx_pwr_nids[3] = {
245 static void stac_playback_pcm_hook(struct hda_pcm_stream *hinfo,
246 struct hda_codec *codec,
247 struct snd_pcm_substream *substream,
250 struct sigmatel_spec *spec = codec->spec;
251 if (action == HDA_GEN_PCM_ACT_OPEN && spec->stream_delay)
252 msleep(spec->stream_delay);
255 static void stac_capture_pcm_hook(struct hda_pcm_stream *hinfo,
256 struct hda_codec *codec,
257 struct snd_pcm_substream *substream,
260 struct sigmatel_spec *spec = codec->spec;
263 if (!spec->powerdown_adcs)
266 for (i = 0; i < spec->gen.num_all_adcs; i++) {
267 if (spec->gen.all_adcs[i] == hinfo->nid) {
274 case HDA_GEN_PCM_ACT_OPEN:
276 snd_hda_codec_write(codec, hinfo->nid, 0,
277 AC_VERB_SET_POWER_STATE, AC_PWRST_D0);
278 spec->active_adcs |= (1 << idx);
280 case HDA_GEN_PCM_ACT_CLOSE:
281 snd_hda_codec_write(codec, hinfo->nid, 0,
282 AC_VERB_SET_POWER_STATE, AC_PWRST_D3);
283 spec->active_adcs &= ~(1 << idx);
289 * Early 2006 Intel Macintoshes with STAC9220X5 codecs seem to have a
290 * funky external mute control using GPIO pins.
293 static void stac_gpio_set(struct hda_codec *codec, unsigned int mask,
294 unsigned int dir_mask, unsigned int data)
296 unsigned int gpiostate, gpiomask, gpiodir;
298 snd_printdd("%s msk %x dir %x gpio %x\n", __func__, mask, dir_mask, data);
300 gpiostate = snd_hda_codec_read(codec, codec->afg, 0,
301 AC_VERB_GET_GPIO_DATA, 0);
302 gpiostate = (gpiostate & ~dir_mask) | (data & dir_mask);
304 gpiomask = snd_hda_codec_read(codec, codec->afg, 0,
305 AC_VERB_GET_GPIO_MASK, 0);
308 gpiodir = snd_hda_codec_read(codec, codec->afg, 0,
309 AC_VERB_GET_GPIO_DIRECTION, 0);
312 /* Configure GPIOx as CMOS */
313 snd_hda_codec_write(codec, codec->afg, 0, 0x7e7, 0);
315 snd_hda_codec_write(codec, codec->afg, 0,
316 AC_VERB_SET_GPIO_MASK, gpiomask);
317 snd_hda_codec_read(codec, codec->afg, 0,
318 AC_VERB_SET_GPIO_DIRECTION, gpiodir); /* sync */
322 snd_hda_codec_read(codec, codec->afg, 0,
323 AC_VERB_SET_GPIO_DATA, gpiostate); /* sync */
326 /* hook for controlling mic-mute LED GPIO */
327 static void stac_capture_led_hook(struct hda_codec *codec,
328 struct snd_ctl_elem_value *ucontrol)
330 struct sigmatel_spec *spec = codec->spec;
336 mute = !(ucontrol->value.integer.value[0] ||
337 ucontrol->value.integer.value[1]);
338 if (spec->mic_mute_led_on != mute) {
339 spec->mic_mute_led_on = mute;
341 spec->gpio_data |= spec->mic_mute_led_gpio;
343 spec->gpio_data &= ~spec->mic_mute_led_gpio;
344 stac_gpio_set(codec, spec->gpio_mask,
345 spec->gpio_dir, spec->gpio_data);
349 static int stac_vrefout_set(struct hda_codec *codec,
350 hda_nid_t nid, unsigned int new_vref)
354 snd_printdd("%s, nid %x ctl %x\n", __func__, nid, new_vref);
355 pinctl = snd_hda_codec_read(codec, nid, 0,
356 AC_VERB_GET_PIN_WIDGET_CONTROL, 0);
362 pinctl &= ~AC_PINCTL_VREFEN;
363 pinctl |= (new_vref & AC_PINCTL_VREFEN);
365 error = snd_hda_set_pin_ctl_cache(codec, nid, pinctl);
372 /* update mute-LED accoring to the master switch */
373 static void stac_update_led_status(struct hda_codec *codec, int enabled)
375 struct sigmatel_spec *spec = codec->spec;
376 int muted = !enabled;
381 /* LED state is inverted on these systems */
382 if (spec->gpio_led_polarity)
385 if (!spec->vref_mute_led_nid) {
387 spec->gpio_data |= spec->gpio_led;
389 spec->gpio_data &= ~spec->gpio_led;
390 stac_gpio_set(codec, spec->gpio_mask,
391 spec->gpio_dir, spec->gpio_data);
393 spec->vref_led = muted ? AC_PINCTL_VREF_50 : AC_PINCTL_VREF_GRD;
394 stac_vrefout_set(codec, spec->vref_mute_led_nid,
399 /* vmaster hook to update mute LED */
400 static void stac_vmaster_hook(void *private_data, int val)
402 stac_update_led_status(private_data, val);
405 /* automute hook to handle GPIO mute and EAPD updates */
406 static void stac_update_outputs(struct hda_codec *codec)
408 struct sigmatel_spec *spec = codec->spec;
411 spec->gen.master_mute =
412 !(snd_hda_codec_read(codec, codec->afg, 0,
413 AC_VERB_GET_GPIO_DATA, 0) & spec->gpio_mute);
415 snd_hda_gen_update_outputs(codec);
417 if (spec->eapd_mask && spec->eapd_switch) {
418 unsigned int val = spec->gpio_data;
419 if (spec->gen.speaker_muted)
420 val &= ~spec->eapd_mask;
422 val |= spec->eapd_mask;
423 if (spec->gpio_data != val) {
424 spec->gpio_data = val;
425 stac_gpio_set(codec, spec->gpio_mask, spec->gpio_dir,
431 static void stac_toggle_power_map(struct hda_codec *codec, hda_nid_t nid,
432 bool enable, bool do_write)
434 struct sigmatel_spec *spec = codec->spec;
435 unsigned int idx, val;
437 for (idx = 0; idx < spec->num_pwrs; idx++) {
438 if (spec->pwr_nids[idx] == nid)
441 if (idx >= spec->num_pwrs)
446 val = spec->power_map_bits;
452 /* power down unused output ports */
453 if (val != spec->power_map_bits) {
454 spec->power_map_bits = val;
456 snd_hda_codec_write(codec, codec->afg, 0,
457 AC_VERB_IDT_SET_POWER_MAP, val);
461 /* update power bit per jack plug/unplug */
462 static void jack_update_power(struct hda_codec *codec,
463 struct hda_jack_tbl *jack)
465 struct sigmatel_spec *spec = codec->spec;
471 if (jack && jack->nid) {
472 stac_toggle_power_map(codec, jack->nid,
473 snd_hda_jack_detect(codec, jack->nid),
478 /* update all jacks */
479 for (i = 0; i < spec->num_pwrs; i++) {
480 hda_nid_t nid = spec->pwr_nids[i];
481 jack = snd_hda_jack_tbl_get(codec, nid);
482 if (!jack || !jack->action)
484 if (jack->action == STAC_PWR_EVENT ||
485 jack->action <= HDA_GEN_LAST_EVENT)
486 stac_toggle_power_map(codec, nid,
487 snd_hda_jack_detect(codec, nid),
491 snd_hda_codec_write(codec, codec->afg, 0, AC_VERB_IDT_SET_POWER_MAP,
492 spec->power_map_bits);
495 static void stac_hp_automute(struct hda_codec *codec,
496 struct hda_jack_tbl *jack)
498 snd_hda_gen_hp_automute(codec, jack);
499 jack_update_power(codec, jack);
502 static void stac_line_automute(struct hda_codec *codec,
503 struct hda_jack_tbl *jack)
505 snd_hda_gen_line_automute(codec, jack);
506 jack_update_power(codec, jack);
509 static void stac_mic_autoswitch(struct hda_codec *codec,
510 struct hda_jack_tbl *jack)
512 snd_hda_gen_mic_autoswitch(codec, jack);
513 jack_update_power(codec, jack);
516 static void stac_vref_event(struct hda_codec *codec, struct hda_jack_tbl *event)
520 data = snd_hda_codec_read(codec, codec->afg, 0,
521 AC_VERB_GET_GPIO_DATA, 0);
522 /* toggle VREF state based on GPIOx status */
523 snd_hda_codec_write(codec, codec->afg, 0, 0x7e0,
524 !!(data & (1 << event->private_data)));
527 /* initialize the power map and enable the power event to jacks that
528 * haven't been assigned to automute
530 static void stac_init_power_map(struct hda_codec *codec)
532 struct sigmatel_spec *spec = codec->spec;
535 for (i = 0; i < spec->num_pwrs; i++) {
536 hda_nid_t nid = spec->pwr_nids[i];
537 unsigned int def_conf = snd_hda_codec_get_pincfg(codec, nid);
538 def_conf = get_defcfg_connect(def_conf);
539 if (snd_hda_jack_tbl_get(codec, nid))
541 if (def_conf == AC_JACK_PORT_COMPLEX &&
542 spec->vref_mute_led_nid != nid &&
543 is_jack_detectable(codec, nid)) {
544 snd_hda_jack_detect_enable_callback(codec, nid,
548 if (def_conf == AC_JACK_PORT_NONE)
549 stac_toggle_power_map(codec, nid, false, false);
551 stac_toggle_power_map(codec, nid, true, false);
559 static inline bool get_int_hint(struct hda_codec *codec, const char *key,
562 return !snd_hda_get_int_hint(codec, key, valp);
565 /* override some hints from the hwdep entry */
566 static void stac_store_hints(struct hda_codec *codec)
568 struct sigmatel_spec *spec = codec->spec;
571 if (get_int_hint(codec, "gpio_mask", &spec->gpio_mask)) {
572 spec->eapd_mask = spec->gpio_dir = spec->gpio_data =
575 if (get_int_hint(codec, "gpio_dir", &spec->gpio_dir))
576 spec->gpio_dir &= spec->gpio_mask;
577 if (get_int_hint(codec, "gpio_data", &spec->gpio_data))
578 spec->gpio_data &= spec->gpio_mask;
579 if (get_int_hint(codec, "eapd_mask", &spec->eapd_mask))
580 spec->eapd_mask &= spec->gpio_mask;
581 if (get_int_hint(codec, "gpio_mute", &spec->gpio_mute))
582 spec->gpio_mute &= spec->gpio_mask;
583 val = snd_hda_get_bool_hint(codec, "eapd_switch");
585 spec->eapd_switch = val;
592 #define stac_aloopback_info snd_ctl_boolean_mono_info
594 static int stac_aloopback_get(struct snd_kcontrol *kcontrol,
595 struct snd_ctl_elem_value *ucontrol)
597 struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
598 unsigned int idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
599 struct sigmatel_spec *spec = codec->spec;
601 ucontrol->value.integer.value[0] = !!(spec->aloopback &
602 (spec->aloopback_mask << idx));
606 static int stac_aloopback_put(struct snd_kcontrol *kcontrol,
607 struct snd_ctl_elem_value *ucontrol)
609 struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
610 struct sigmatel_spec *spec = codec->spec;
611 unsigned int idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
612 unsigned int dac_mode;
613 unsigned int val, idx_val;
615 idx_val = spec->aloopback_mask << idx;
616 if (ucontrol->value.integer.value[0])
617 val = spec->aloopback | idx_val;
619 val = spec->aloopback & ~idx_val;
620 if (spec->aloopback == val)
623 spec->aloopback = val;
625 /* Only return the bits defined by the shift value of the
626 * first two bytes of the mask
628 dac_mode = snd_hda_codec_read(codec, codec->afg, 0,
629 kcontrol->private_value & 0xFFFF, 0x0);
630 dac_mode >>= spec->aloopback_shift;
632 if (spec->aloopback & idx_val) {
633 snd_hda_power_up(codec);
636 snd_hda_power_down(codec);
637 dac_mode &= ~idx_val;
640 snd_hda_codec_write_cache(codec, codec->afg, 0,
641 kcontrol->private_value >> 16, dac_mode);
646 #define STAC_ANALOG_LOOPBACK(verb_read, verb_write, cnt) \
648 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \
649 .name = "Analog Loopback", \
651 .info = stac_aloopback_info, \
652 .get = stac_aloopback_get, \
653 .put = stac_aloopback_put, \
654 .private_value = verb_read | (verb_write << 16), \
658 * Mute LED handling on HP laptops
661 /* check whether it's a HP laptop with a docking port */
662 static bool hp_bnb2011_with_dock(struct hda_codec *codec)
664 if (codec->vendor_id != 0x111d7605 &&
665 codec->vendor_id != 0x111d76d1)
668 switch (codec->subsystem_id) {
702 static bool hp_blike_system(u32 subsystem_id)
704 switch (subsystem_id) {
731 static void set_hp_led_gpio(struct hda_codec *codec)
733 struct sigmatel_spec *spec = codec->spec;
739 gpio = snd_hda_param_read(codec, codec->afg, AC_PAR_GPIO_CAP);
740 gpio &= AC_GPIO_IO_COUNT;
742 spec->gpio_led = 0x08; /* GPIO 3 */
744 spec->gpio_led = 0x01; /* GPIO 0 */
748 * This method searches for the mute LED GPIO configuration
749 * provided as OEM string in SMBIOS. The format of that string
750 * is HP_Mute_LED_P_G or HP_Mute_LED_P
751 * where P can be 0 or 1 and defines mute LED GPIO control state (low/high)
752 * that corresponds to the NOT muted state of the master volume
753 * and G is the index of the GPIO to use as the mute LED control (0..9)
754 * If _G portion is missing it is assigned based on the codec ID
756 * So, HP B-series like systems may have HP_Mute_LED_0 (current models)
757 * or HP_Mute_LED_0_3 (future models) OEM SMBIOS strings
760 * The dv-series laptops don't seem to have the HP_Mute_LED* strings in
761 * SMBIOS - at least the ones I have seen do not have them - which include
762 * my own system (HP Pavilion dv6-1110ax) and my cousin's
763 * HP Pavilion dv9500t CTO.
764 * Need more information on whether it is true across the entire series.
767 static int find_mute_led_cfg(struct hda_codec *codec, int default_polarity)
769 struct sigmatel_spec *spec = codec->spec;
770 const struct dmi_device *dev = NULL;
772 if (get_int_hint(codec, "gpio_led", &spec->gpio_led)) {
773 get_int_hint(codec, "gpio_led_polarity",
774 &spec->gpio_led_polarity);
778 while ((dev = dmi_find_device(DMI_DEV_TYPE_OEM_STRING, NULL, dev))) {
779 if (sscanf(dev->name, "HP_Mute_LED_%d_%x",
780 &spec->gpio_led_polarity,
781 &spec->gpio_led) == 2) {
782 unsigned int max_gpio;
783 max_gpio = snd_hda_param_read(codec, codec->afg,
785 max_gpio &= AC_GPIO_IO_COUNT;
786 if (spec->gpio_led < max_gpio)
787 spec->gpio_led = 1 << spec->gpio_led;
789 spec->vref_mute_led_nid = spec->gpio_led;
792 if (sscanf(dev->name, "HP_Mute_LED_%d",
793 &spec->gpio_led_polarity) == 1) {
794 set_hp_led_gpio(codec);
797 /* BIOS bug: unfilled OEM string */
798 if (strstr(dev->name, "HP_Mute_LED_P_G")) {
799 set_hp_led_gpio(codec);
800 if (default_polarity >= 0)
801 spec->gpio_led_polarity = default_polarity;
803 spec->gpio_led_polarity = 1;
809 * Fallback case - if we don't find the DMI strings,
810 * we statically set the GPIO - if not a B-series system
811 * and default polarity is provided
813 if (!hp_blike_system(codec->subsystem_id) &&
814 (default_polarity == 0 || default_polarity == 1)) {
815 set_hp_led_gpio(codec);
816 spec->gpio_led_polarity = default_polarity;
822 /* check whether a built-in speaker is included in parsed pins */
823 static bool has_builtin_speaker(struct hda_codec *codec)
825 struct sigmatel_spec *spec = codec->spec;
829 if (spec->gen.autocfg.line_out_type == AUTO_PIN_SPEAKER_OUT) {
830 nid_pin = spec->gen.autocfg.line_out_pins;
831 nids = spec->gen.autocfg.line_outs;
833 nid_pin = spec->gen.autocfg.speaker_pins;
834 nids = spec->gen.autocfg.speaker_outs;
837 for (i = 0; i < nids; i++) {
838 unsigned int def_conf = snd_hda_codec_get_pincfg(codec, nid_pin[i]);
839 if (snd_hda_get_input_pin_attr(def_conf) == INPUT_PIN_ATTR_INT)
849 /* create PC beep volume controls */
850 static int stac_auto_create_beep_ctls(struct hda_codec *codec,
853 struct sigmatel_spec *spec = codec->spec;
854 u32 caps = query_amp_caps(codec, nid, HDA_OUTPUT);
855 struct snd_kcontrol_new *knew;
856 static struct snd_kcontrol_new abeep_mute_ctl =
857 HDA_CODEC_MUTE(NULL, 0, 0, 0);
858 static struct snd_kcontrol_new dbeep_mute_ctl =
859 HDA_CODEC_MUTE_BEEP(NULL, 0, 0, 0);
860 static struct snd_kcontrol_new beep_vol_ctl =
861 HDA_CODEC_VOLUME(NULL, 0, 0, 0);
863 /* check for mute support for the the amp */
864 if ((caps & AC_AMPCAP_MUTE) >> AC_AMPCAP_MUTE_SHIFT) {
865 const struct snd_kcontrol_new *temp;
866 if (spec->anabeep_nid == nid)
867 temp = &abeep_mute_ctl;
869 temp = &dbeep_mute_ctl;
870 knew = snd_hda_gen_add_kctl(&spec->gen,
871 "Beep Playback Switch", temp);
874 knew->private_value =
875 HDA_COMPOSE_AMP_VAL(nid, 1, 0, HDA_OUTPUT);
878 /* check to see if there is volume support for the amp */
879 if ((caps & AC_AMPCAP_NUM_STEPS) >> AC_AMPCAP_NUM_STEPS_SHIFT) {
880 knew = snd_hda_gen_add_kctl(&spec->gen,
881 "Beep Playback Volume",
885 knew->private_value =
886 HDA_COMPOSE_AMP_VAL(nid, 1, 0, HDA_OUTPUT);
891 #ifdef CONFIG_SND_HDA_INPUT_BEEP
892 #define stac_dig_beep_switch_info snd_ctl_boolean_mono_info
894 static int stac_dig_beep_switch_get(struct snd_kcontrol *kcontrol,
895 struct snd_ctl_elem_value *ucontrol)
897 struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
898 ucontrol->value.integer.value[0] = codec->beep->enabled;
902 static int stac_dig_beep_switch_put(struct snd_kcontrol *kcontrol,
903 struct snd_ctl_elem_value *ucontrol)
905 struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
906 return snd_hda_enable_beep_device(codec, ucontrol->value.integer.value[0]);
909 static const struct snd_kcontrol_new stac_dig_beep_ctrl = {
910 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
911 .name = "Beep Playback Switch",
912 .info = stac_dig_beep_switch_info,
913 .get = stac_dig_beep_switch_get,
914 .put = stac_dig_beep_switch_put,
917 static int stac_beep_switch_ctl(struct hda_codec *codec)
919 struct sigmatel_spec *spec = codec->spec;
921 if (!snd_hda_gen_add_kctl(&spec->gen, NULL, &stac_dig_beep_ctrl))
928 * SPDIF-out mux controls
931 static int stac_smux_enum_info(struct snd_kcontrol *kcontrol,
932 struct snd_ctl_elem_info *uinfo)
934 struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
935 struct sigmatel_spec *spec = codec->spec;
936 return snd_hda_input_mux_info(&spec->spdif_mux, uinfo);
939 static int stac_smux_enum_get(struct snd_kcontrol *kcontrol,
940 struct snd_ctl_elem_value *ucontrol)
942 struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
943 struct sigmatel_spec *spec = codec->spec;
944 unsigned int smux_idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
946 ucontrol->value.enumerated.item[0] = spec->cur_smux[smux_idx];
950 static int stac_smux_enum_put(struct snd_kcontrol *kcontrol,
951 struct snd_ctl_elem_value *ucontrol)
953 struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
954 struct sigmatel_spec *spec = codec->spec;
955 unsigned int smux_idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
957 return snd_hda_input_mux_put(codec, &spec->spdif_mux, ucontrol,
958 spec->gen.autocfg.dig_out_pins[smux_idx],
959 &spec->cur_smux[smux_idx]);
962 static struct snd_kcontrol_new stac_smux_mixer = {
963 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
964 .name = "IEC958 Playback Source",
965 /* count set later */
966 .info = stac_smux_enum_info,
967 .get = stac_smux_enum_get,
968 .put = stac_smux_enum_put,
971 static const char * const stac_spdif_labels[] = {
972 "Digital Playback", "Analog Mux 1", "Analog Mux 2", NULL
975 static int stac_create_spdif_mux_ctls(struct hda_codec *codec)
977 struct sigmatel_spec *spec = codec->spec;
978 struct auto_pin_cfg *cfg = &spec->gen.autocfg;
979 const char * const *labels = spec->spdif_labels;
980 struct snd_kcontrol_new *kctl;
983 if (cfg->dig_outs < 1)
986 num_cons = snd_hda_get_num_conns(codec, cfg->dig_out_pins[0]);
991 labels = stac_spdif_labels;
992 for (i = 0; i < num_cons; i++) {
993 if (snd_BUG_ON(!labels[i]))
995 snd_hda_add_imux_item(&spec->spdif_mux, labels[i], i, NULL);
998 kctl = snd_hda_gen_add_kctl(&spec->gen, NULL, &stac_smux_mixer);
1001 kctl->count = cfg->dig_outs;
1009 static const struct hda_verb stac9200_core_init[] = {
1010 /* set dac0mux for dac converter */
1011 { 0x07, AC_VERB_SET_CONNECT_SEL, 0x00},
1015 static const struct hda_verb stac9200_eapd_init[] = {
1016 /* set dac0mux for dac converter */
1017 {0x07, AC_VERB_SET_CONNECT_SEL, 0x00},
1018 {0x08, AC_VERB_SET_EAPD_BTLENABLE, 0x02},
1022 static const struct hda_verb dell_eq_core_init[] = {
1023 /* set master volume to max value without distortion
1024 * and direct control */
1025 { 0x1f, AC_VERB_SET_VOLUME_KNOB_CONTROL, 0xec},
1029 static const struct hda_verb stac92hd73xx_core_init[] = {
1030 /* set master volume and direct control */
1031 { 0x1f, AC_VERB_SET_VOLUME_KNOB_CONTROL, 0xff},
1035 static const struct hda_verb stac92hd83xxx_core_init[] = {
1036 /* power state controls amps */
1037 { 0x01, AC_VERB_SET_EAPD, 1 << 2},
1041 static const struct hda_verb stac92hd83xxx_hp_zephyr_init[] = {
1042 { 0x22, 0x785, 0x43 },
1043 { 0x22, 0x782, 0xe0 },
1044 { 0x22, 0x795, 0x00 },
1048 static const struct hda_verb stac92hd71bxx_core_init[] = {
1049 /* set master volume and direct control */
1050 { 0x28, AC_VERB_SET_VOLUME_KNOB_CONTROL, 0xff},
1054 static const struct hda_verb stac92hd71bxx_unmute_core_init[] = {
1055 /* unmute right and left channels for nodes 0x0f, 0xa, 0x0d */
1056 { 0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
1057 { 0x0a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
1058 { 0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
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 },
1366 static void stac9200_fixup_panasonic(struct hda_codec *codec,
1367 const struct hda_fixup *fix, int action)
1369 struct sigmatel_spec *spec = codec->spec;
1371 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
1372 spec->gpio_mask = spec->gpio_dir = 0x09;
1373 spec->gpio_data = 0x00;
1374 /* CF-74 has no headphone detection, and the driver should *NOT*
1375 * do detection and HP/speaker toggle because the hardware does it.
1377 spec->gen.suppress_auto_mute = 1;
1382 static const struct hda_fixup stac9200_fixups[] = {
1384 .type = HDA_FIXUP_PINS,
1385 .v.pins = ref9200_pin_configs,
1388 .type = HDA_FIXUP_PINS,
1389 .v.pins = oqo9200_pin_configs,
1391 .chain_id = STAC_9200_EAPD_INIT,
1393 [STAC_9200_DELL_D21] = {
1394 .type = HDA_FIXUP_PINS,
1395 .v.pins = dell9200_d21_pin_configs,
1397 [STAC_9200_DELL_D22] = {
1398 .type = HDA_FIXUP_PINS,
1399 .v.pins = dell9200_d22_pin_configs,
1401 [STAC_9200_DELL_D23] = {
1402 .type = HDA_FIXUP_PINS,
1403 .v.pins = dell9200_d23_pin_configs,
1405 [STAC_9200_DELL_M21] = {
1406 .type = HDA_FIXUP_PINS,
1407 .v.pins = dell9200_m21_pin_configs,
1409 [STAC_9200_DELL_M22] = {
1410 .type = HDA_FIXUP_PINS,
1411 .v.pins = dell9200_m22_pin_configs,
1413 [STAC_9200_DELL_M23] = {
1414 .type = HDA_FIXUP_PINS,
1415 .v.pins = dell9200_m23_pin_configs,
1417 [STAC_9200_DELL_M24] = {
1418 .type = HDA_FIXUP_PINS,
1419 .v.pins = dell9200_m24_pin_configs,
1421 [STAC_9200_DELL_M25] = {
1422 .type = HDA_FIXUP_PINS,
1423 .v.pins = dell9200_m25_pin_configs,
1425 [STAC_9200_DELL_M26] = {
1426 .type = HDA_FIXUP_PINS,
1427 .v.pins = dell9200_m26_pin_configs,
1429 [STAC_9200_DELL_M27] = {
1430 .type = HDA_FIXUP_PINS,
1431 .v.pins = dell9200_m27_pin_configs,
1434 .type = HDA_FIXUP_PINS,
1435 .v.pins = gateway9200_m4_pin_configs,
1437 .chain_id = STAC_9200_EAPD_INIT,
1439 [STAC_9200_M4_2] = {
1440 .type = HDA_FIXUP_PINS,
1441 .v.pins = gateway9200_m4_2_pin_configs,
1443 .chain_id = STAC_9200_EAPD_INIT,
1445 [STAC_9200_PANASONIC] = {
1446 .type = HDA_FIXUP_FUNC,
1447 .v.func = stac9200_fixup_panasonic,
1449 [STAC_9200_EAPD_INIT] = {
1450 .type = HDA_FIXUP_VERBS,
1451 .v.verbs = (const struct hda_verb[]) {
1452 {0x08, AC_VERB_SET_EAPD_BTLENABLE, 0x02},
1458 static const struct hda_model_fixup stac9200_models[] = {
1459 { .id = STAC_REF, .name = "ref" },
1460 { .id = STAC_9200_OQO, .name = "oqo" },
1461 { .id = STAC_9200_DELL_D21, .name = "dell-d21" },
1462 { .id = STAC_9200_DELL_D22, .name = "dell-d22" },
1463 { .id = STAC_9200_DELL_D23, .name = "dell-d23" },
1464 { .id = STAC_9200_DELL_M21, .name = "dell-m21" },
1465 { .id = STAC_9200_DELL_M22, .name = "dell-m22" },
1466 { .id = STAC_9200_DELL_M23, .name = "dell-m23" },
1467 { .id = STAC_9200_DELL_M24, .name = "dell-m24" },
1468 { .id = STAC_9200_DELL_M25, .name = "dell-m25" },
1469 { .id = STAC_9200_DELL_M26, .name = "dell-m26" },
1470 { .id = STAC_9200_DELL_M27, .name = "dell-m27" },
1471 { .id = STAC_9200_M4, .name = "gateway-m4" },
1472 { .id = STAC_9200_M4_2, .name = "gateway-m4-2" },
1473 { .id = STAC_9200_PANASONIC, .name = "panasonic" },
1477 static const struct snd_pci_quirk stac9200_fixup_tbl[] = {
1478 /* SigmaTel reference board */
1479 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2668,
1480 "DFI LanParty", STAC_REF),
1481 SND_PCI_QUIRK(PCI_VENDOR_ID_DFI, 0x3101,
1482 "DFI LanParty", STAC_REF),
1483 /* Dell laptops have BIOS problem */
1484 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01a8,
1485 "unknown Dell", STAC_9200_DELL_D21),
1486 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01b5,
1487 "Dell Inspiron 630m", STAC_9200_DELL_M21),
1488 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01bd,
1489 "Dell Inspiron E1505n", STAC_9200_DELL_M25),
1490 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01c0,
1491 "unknown Dell", STAC_9200_DELL_D22),
1492 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01c1,
1493 "unknown Dell", STAC_9200_DELL_D22),
1494 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01c2,
1495 "Dell Latitude D620", STAC_9200_DELL_M22),
1496 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01c5,
1497 "unknown Dell", STAC_9200_DELL_D23),
1498 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01c7,
1499 "unknown Dell", STAC_9200_DELL_D23),
1500 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01c8,
1501 "unknown Dell", STAC_9200_DELL_M22),
1502 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01c9,
1503 "unknown Dell", STAC_9200_DELL_M24),
1504 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01ca,
1505 "unknown Dell", STAC_9200_DELL_M24),
1506 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01cb,
1507 "Dell Latitude 120L", STAC_9200_DELL_M24),
1508 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01cc,
1509 "Dell Latitude D820", STAC_9200_DELL_M22),
1510 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01cd,
1511 "Dell Inspiron E1705/9400", STAC_9200_DELL_M27),
1512 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01ce,
1513 "Dell XPS M1710", STAC_9200_DELL_M23),
1514 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01cf,
1515 "Dell Precision M90", STAC_9200_DELL_M23),
1516 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01d3,
1517 "unknown Dell", STAC_9200_DELL_M22),
1518 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01d4,
1519 "unknown Dell", STAC_9200_DELL_M22),
1520 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01d6,
1521 "unknown Dell", STAC_9200_DELL_M22),
1522 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01d8,
1523 "Dell Inspiron 640m", STAC_9200_DELL_M21),
1524 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01d9,
1525 "unknown Dell", STAC_9200_DELL_D23),
1526 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01da,
1527 "unknown Dell", STAC_9200_DELL_D23),
1528 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01de,
1529 "unknown Dell", STAC_9200_DELL_D21),
1530 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01e3,
1531 "unknown Dell", STAC_9200_DELL_D23),
1532 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01e8,
1533 "unknown Dell", STAC_9200_DELL_D21),
1534 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01ee,
1535 "unknown Dell", STAC_9200_DELL_M25),
1536 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01ef,
1537 "unknown Dell", STAC_9200_DELL_M25),
1538 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01f5,
1539 "Dell Inspiron 1501", STAC_9200_DELL_M26),
1540 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01f6,
1541 "unknown Dell", STAC_9200_DELL_M26),
1543 SND_PCI_QUIRK(0x10f7, 0x8338, "Panasonic CF-74", STAC_9200_PANASONIC),
1544 /* Gateway machines needs EAPD to be set on resume */
1545 SND_PCI_QUIRK(0x107b, 0x0205, "Gateway S-7110M", STAC_9200_M4),
1546 SND_PCI_QUIRK(0x107b, 0x0317, "Gateway MT3423, MX341*", STAC_9200_M4_2),
1547 SND_PCI_QUIRK(0x107b, 0x0318, "Gateway ML3019, MT3707", STAC_9200_M4_2),
1549 SND_PCI_QUIRK(0x1106, 0x3288, "OQO Model 2", STAC_9200_OQO),
1553 static const struct hda_pintbl ref925x_pin_configs[] = {
1554 { 0x07, 0x40c003f0 },
1555 { 0x08, 0x424503f2 },
1556 { 0x0a, 0x01813022 },
1557 { 0x0b, 0x02a19021 },
1558 { 0x0c, 0x90a70320 },
1559 { 0x0d, 0x02214210 },
1560 { 0x10, 0x01019020 },
1561 { 0x11, 0x9033032e },
1565 static const struct hda_pintbl stac925xM1_pin_configs[] = {
1566 { 0x07, 0x40c003f4 },
1567 { 0x08, 0x424503f2 },
1568 { 0x0a, 0x400000f3 },
1569 { 0x0b, 0x02a19020 },
1570 { 0x0c, 0x40a000f0 },
1571 { 0x0d, 0x90100210 },
1572 { 0x10, 0x400003f1 },
1573 { 0x11, 0x9033032e },
1577 static const struct hda_pintbl stac925xM1_2_pin_configs[] = {
1578 { 0x07, 0x40c003f4 },
1579 { 0x08, 0x424503f2 },
1580 { 0x0a, 0x400000f3 },
1581 { 0x0b, 0x02a19020 },
1582 { 0x0c, 0x40a000f0 },
1583 { 0x0d, 0x90100210 },
1584 { 0x10, 0x400003f1 },
1585 { 0x11, 0x9033032e },
1589 static const struct hda_pintbl stac925xM2_pin_configs[] = {
1590 { 0x07, 0x40c003f4 },
1591 { 0x08, 0x424503f2 },
1592 { 0x0a, 0x400000f3 },
1593 { 0x0b, 0x02a19020 },
1594 { 0x0c, 0x40a000f0 },
1595 { 0x0d, 0x90100210 },
1596 { 0x10, 0x400003f1 },
1597 { 0x11, 0x9033032e },
1601 static const struct hda_pintbl stac925xM2_2_pin_configs[] = {
1602 { 0x07, 0x40c003f4 },
1603 { 0x08, 0x424503f2 },
1604 { 0x0a, 0x400000f3 },
1605 { 0x0b, 0x02a19020 },
1606 { 0x0c, 0x40a000f0 },
1607 { 0x0d, 0x90100210 },
1608 { 0x10, 0x400003f1 },
1609 { 0x11, 0x9033032e },
1613 static const struct hda_pintbl stac925xM3_pin_configs[] = {
1614 { 0x07, 0x40c003f4 },
1615 { 0x08, 0x424503f2 },
1616 { 0x0a, 0x400000f3 },
1617 { 0x0b, 0x02a19020 },
1618 { 0x0c, 0x40a000f0 },
1619 { 0x0d, 0x90100210 },
1620 { 0x10, 0x400003f1 },
1621 { 0x11, 0x503303f3 },
1625 static const struct hda_pintbl stac925xM5_pin_configs[] = {
1626 { 0x07, 0x40c003f4 },
1627 { 0x08, 0x424503f2 },
1628 { 0x0a, 0x400000f3 },
1629 { 0x0b, 0x02a19020 },
1630 { 0x0c, 0x40a000f0 },
1631 { 0x0d, 0x90100210 },
1632 { 0x10, 0x400003f1 },
1633 { 0x11, 0x9033032e },
1637 static const struct hda_pintbl stac925xM6_pin_configs[] = {
1638 { 0x07, 0x40c003f4 },
1639 { 0x08, 0x424503f2 },
1640 { 0x0a, 0x400000f3 },
1641 { 0x0b, 0x02a19020 },
1642 { 0x0c, 0x40a000f0 },
1643 { 0x0d, 0x90100210 },
1644 { 0x10, 0x400003f1 },
1645 { 0x11, 0x90330320 },
1649 static const struct hda_fixup stac925x_fixups[] = {
1651 .type = HDA_FIXUP_PINS,
1652 .v.pins = ref925x_pin_configs,
1655 .type = HDA_FIXUP_PINS,
1656 .v.pins = stac925xM1_pin_configs,
1659 .type = HDA_FIXUP_PINS,
1660 .v.pins = stac925xM1_2_pin_configs,
1663 .type = HDA_FIXUP_PINS,
1664 .v.pins = stac925xM2_pin_configs,
1667 .type = HDA_FIXUP_PINS,
1668 .v.pins = stac925xM2_2_pin_configs,
1671 .type = HDA_FIXUP_PINS,
1672 .v.pins = stac925xM3_pin_configs,
1675 .type = HDA_FIXUP_PINS,
1676 .v.pins = stac925xM5_pin_configs,
1679 .type = HDA_FIXUP_PINS,
1680 .v.pins = stac925xM6_pin_configs,
1684 static const struct hda_model_fixup stac925x_models[] = {
1685 { .id = STAC_REF, .name = "ref" },
1686 { .id = STAC_M1, .name = "m1" },
1687 { .id = STAC_M1_2, .name = "m1-2" },
1688 { .id = STAC_M2, .name = "m2" },
1689 { .id = STAC_M2_2, .name = "m2-2" },
1690 { .id = STAC_M3, .name = "m3" },
1691 { .id = STAC_M5, .name = "m5" },
1692 { .id = STAC_M6, .name = "m6" },
1696 static const struct snd_pci_quirk stac925x_fixup_tbl[] = {
1697 /* SigmaTel reference board */
1698 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2668, "DFI LanParty", STAC_REF),
1699 SND_PCI_QUIRK(PCI_VENDOR_ID_DFI, 0x3101, "DFI LanParty", STAC_REF),
1700 SND_PCI_QUIRK(0x8384, 0x7632, "Stac9202 Reference Board", STAC_REF),
1702 /* Default table for unknown ID */
1703 SND_PCI_QUIRK(0x1002, 0x437b, "Gateway mobile", STAC_M2_2),
1705 /* gateway machines are checked via codec ssid */
1706 SND_PCI_QUIRK(0x107b, 0x0316, "Gateway M255", STAC_M2),
1707 SND_PCI_QUIRK(0x107b, 0x0366, "Gateway MP6954", STAC_M5),
1708 SND_PCI_QUIRK(0x107b, 0x0461, "Gateway NX560XL", STAC_M1),
1709 SND_PCI_QUIRK(0x107b, 0x0681, "Gateway NX860", STAC_M2),
1710 SND_PCI_QUIRK(0x107b, 0x0367, "Gateway MX6453", STAC_M1_2),
1711 /* Not sure about the brand name for those */
1712 SND_PCI_QUIRK(0x107b, 0x0281, "Gateway mobile", STAC_M1),
1713 SND_PCI_QUIRK(0x107b, 0x0507, "Gateway mobile", STAC_M3),
1714 SND_PCI_QUIRK(0x107b, 0x0281, "Gateway mobile", STAC_M6),
1715 SND_PCI_QUIRK(0x107b, 0x0685, "Gateway mobile", STAC_M2_2),
1719 static const struct hda_pintbl ref92hd73xx_pin_configs[] = {
1720 { 0x0a, 0x02214030 },
1721 { 0x0b, 0x02a19040 },
1722 { 0x0c, 0x01a19020 },
1723 { 0x0d, 0x02214030 },
1724 { 0x0e, 0x0181302e },
1725 { 0x0f, 0x01014010 },
1726 { 0x10, 0x01014020 },
1727 { 0x11, 0x01014030 },
1728 { 0x12, 0x02319040 },
1729 { 0x13, 0x90a000f0 },
1730 { 0x14, 0x90a000f0 },
1731 { 0x22, 0x01452050 },
1732 { 0x23, 0x01452050 },
1736 static const struct hda_pintbl dell_m6_pin_configs[] = {
1737 { 0x0a, 0x0321101f },
1738 { 0x0b, 0x4f00000f },
1739 { 0x0c, 0x4f0000f0 },
1740 { 0x0d, 0x90170110 },
1741 { 0x0e, 0x03a11020 },
1742 { 0x0f, 0x0321101f },
1743 { 0x10, 0x4f0000f0 },
1744 { 0x11, 0x4f0000f0 },
1745 { 0x12, 0x4f0000f0 },
1746 { 0x13, 0x90a60160 },
1747 { 0x14, 0x4f0000f0 },
1748 { 0x22, 0x4f0000f0 },
1749 { 0x23, 0x4f0000f0 },
1753 static const struct hda_pintbl alienware_m17x_pin_configs[] = {
1754 { 0x0a, 0x0321101f },
1755 { 0x0b, 0x0321101f },
1756 { 0x0c, 0x03a11020 },
1757 { 0x0d, 0x03014020 },
1758 { 0x0e, 0x90170110 },
1759 { 0x0f, 0x4f0000f0 },
1760 { 0x10, 0x4f0000f0 },
1761 { 0x11, 0x4f0000f0 },
1762 { 0x12, 0x4f0000f0 },
1763 { 0x13, 0x90a60160 },
1764 { 0x14, 0x4f0000f0 },
1765 { 0x22, 0x4f0000f0 },
1766 { 0x23, 0x904601b0 },
1770 static const struct hda_pintbl intel_dg45id_pin_configs[] = {
1771 { 0x0a, 0x02214230 },
1772 { 0x0b, 0x02A19240 },
1773 { 0x0c, 0x01013214 },
1774 { 0x0d, 0x01014210 },
1775 { 0x0e, 0x01A19250 },
1776 { 0x0f, 0x01011212 },
1777 { 0x10, 0x01016211 },
1781 static const struct hda_pintbl stac92hd89xx_hp_front_jack_pin_configs[] = {
1782 { 0x0a, 0x02214030 },
1783 { 0x0b, 0x02A19010 },
1787 static const struct hda_pintbl stac92hd89xx_hp_z1_g2_right_mic_jack_pin_configs[] = {
1788 { 0x0e, 0x400000f0 },
1792 static void stac92hd73xx_fixup_ref(struct hda_codec *codec,
1793 const struct hda_fixup *fix, int action)
1795 struct sigmatel_spec *spec = codec->spec;
1797 if (action != HDA_FIXUP_ACT_PRE_PROBE)
1800 snd_hda_apply_pincfgs(codec, ref92hd73xx_pin_configs);
1801 spec->gpio_mask = spec->gpio_dir = spec->gpio_data = 0;
1804 static void stac92hd73xx_fixup_dell(struct hda_codec *codec)
1806 struct sigmatel_spec *spec = codec->spec;
1808 snd_hda_apply_pincfgs(codec, dell_m6_pin_configs);
1809 spec->eapd_switch = 0;
1812 static void stac92hd73xx_fixup_dell_eq(struct hda_codec *codec,
1813 const struct hda_fixup *fix, int action)
1815 struct sigmatel_spec *spec = codec->spec;
1817 if (action != HDA_FIXUP_ACT_PRE_PROBE)
1820 stac92hd73xx_fixup_dell(codec);
1821 snd_hda_add_verbs(codec, dell_eq_core_init);
1822 spec->volknob_init = 1;
1826 static void stac92hd73xx_fixup_dell_m6_amic(struct hda_codec *codec,
1827 const struct hda_fixup *fix, int action)
1829 if (action != HDA_FIXUP_ACT_PRE_PROBE)
1832 stac92hd73xx_fixup_dell(codec);
1833 snd_hda_codec_set_pincfg(codec, 0x0b, 0x90A70170);
1837 static void stac92hd73xx_fixup_dell_m6_dmic(struct hda_codec *codec,
1838 const struct hda_fixup *fix, int action)
1840 if (action != HDA_FIXUP_ACT_PRE_PROBE)
1843 stac92hd73xx_fixup_dell(codec);
1844 snd_hda_codec_set_pincfg(codec, 0x13, 0x90A60160);
1848 static void stac92hd73xx_fixup_dell_m6_both(struct hda_codec *codec,
1849 const struct hda_fixup *fix, int action)
1851 if (action != HDA_FIXUP_ACT_PRE_PROBE)
1854 stac92hd73xx_fixup_dell(codec);
1855 snd_hda_codec_set_pincfg(codec, 0x0b, 0x90A70170);
1856 snd_hda_codec_set_pincfg(codec, 0x13, 0x90A60160);
1859 static void stac92hd73xx_fixup_alienware_m17x(struct hda_codec *codec,
1860 const struct hda_fixup *fix, int action)
1862 struct sigmatel_spec *spec = codec->spec;
1864 if (action != HDA_FIXUP_ACT_PRE_PROBE)
1867 snd_hda_apply_pincfgs(codec, alienware_m17x_pin_configs);
1868 spec->eapd_switch = 0;
1871 static void stac92hd73xx_fixup_no_jd(struct hda_codec *codec,
1872 const struct hda_fixup *fix, int action)
1874 if (action == HDA_FIXUP_ACT_PRE_PROBE)
1875 codec->no_jack_detect = 1;
1878 static const struct hda_fixup stac92hd73xx_fixups[] = {
1879 [STAC_92HD73XX_REF] = {
1880 .type = HDA_FIXUP_FUNC,
1881 .v.func = stac92hd73xx_fixup_ref,
1883 [STAC_DELL_M6_AMIC] = {
1884 .type = HDA_FIXUP_FUNC,
1885 .v.func = stac92hd73xx_fixup_dell_m6_amic,
1887 [STAC_DELL_M6_DMIC] = {
1888 .type = HDA_FIXUP_FUNC,
1889 .v.func = stac92hd73xx_fixup_dell_m6_dmic,
1891 [STAC_DELL_M6_BOTH] = {
1892 .type = HDA_FIXUP_FUNC,
1893 .v.func = stac92hd73xx_fixup_dell_m6_both,
1896 .type = HDA_FIXUP_FUNC,
1897 .v.func = stac92hd73xx_fixup_dell_eq,
1899 [STAC_ALIENWARE_M17X] = {
1900 .type = HDA_FIXUP_FUNC,
1901 .v.func = stac92hd73xx_fixup_alienware_m17x,
1903 [STAC_92HD73XX_INTEL] = {
1904 .type = HDA_FIXUP_PINS,
1905 .v.pins = intel_dg45id_pin_configs,
1907 [STAC_92HD73XX_NO_JD] = {
1908 .type = HDA_FIXUP_FUNC,
1909 .v.func = stac92hd73xx_fixup_no_jd,
1911 [STAC_92HD89XX_HP_FRONT_JACK] = {
1912 .type = HDA_FIXUP_PINS,
1913 .v.pins = stac92hd89xx_hp_front_jack_pin_configs,
1915 [STAC_92HD89XX_HP_Z1_G2_RIGHT_MIC_JACK] = {
1916 .type = HDA_FIXUP_PINS,
1917 .v.pins = stac92hd89xx_hp_z1_g2_right_mic_jack_pin_configs,
1921 static const struct hda_model_fixup stac92hd73xx_models[] = {
1922 { .id = STAC_92HD73XX_NO_JD, .name = "no-jd" },
1923 { .id = STAC_92HD73XX_REF, .name = "ref" },
1924 { .id = STAC_92HD73XX_INTEL, .name = "intel" },
1925 { .id = STAC_DELL_M6_AMIC, .name = "dell-m6-amic" },
1926 { .id = STAC_DELL_M6_DMIC, .name = "dell-m6-dmic" },
1927 { .id = STAC_DELL_M6_BOTH, .name = "dell-m6" },
1928 { .id = STAC_DELL_EQ, .name = "dell-eq" },
1929 { .id = STAC_ALIENWARE_M17X, .name = "alienware" },
1933 static const struct snd_pci_quirk stac92hd73xx_fixup_tbl[] = {
1934 /* SigmaTel reference board */
1935 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2668,
1936 "DFI LanParty", STAC_92HD73XX_REF),
1937 SND_PCI_QUIRK(PCI_VENDOR_ID_DFI, 0x3101,
1938 "DFI LanParty", STAC_92HD73XX_REF),
1939 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x5002,
1940 "Intel DG45ID", STAC_92HD73XX_INTEL),
1941 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x5003,
1942 "Intel DG45FC", STAC_92HD73XX_INTEL),
1943 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0254,
1944 "Dell Studio 1535", STAC_DELL_M6_DMIC),
1945 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0255,
1946 "unknown Dell", STAC_DELL_M6_DMIC),
1947 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0256,
1948 "unknown Dell", STAC_DELL_M6_BOTH),
1949 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0257,
1950 "unknown Dell", STAC_DELL_M6_BOTH),
1951 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x025e,
1952 "unknown Dell", STAC_DELL_M6_AMIC),
1953 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x025f,
1954 "unknown Dell", STAC_DELL_M6_AMIC),
1955 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0271,
1956 "unknown Dell", STAC_DELL_M6_DMIC),
1957 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0272,
1958 "unknown Dell", STAC_DELL_M6_DMIC),
1959 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x029f,
1960 "Dell Studio 1537", STAC_DELL_M6_DMIC),
1961 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x02a0,
1962 "Dell Studio 17", STAC_DELL_M6_DMIC),
1963 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x02be,
1964 "Dell Studio 1555", STAC_DELL_M6_DMIC),
1965 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x02bd,
1966 "Dell Studio 1557", STAC_DELL_M6_DMIC),
1967 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x02fe,
1968 "Dell Studio XPS 1645", STAC_DELL_M6_DMIC),
1969 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0413,
1970 "Dell Studio 1558", STAC_DELL_M6_DMIC),
1971 /* codec SSID matching */
1972 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x02a1,
1973 "Alienware M17x", STAC_ALIENWARE_M17X),
1974 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x043a,
1975 "Alienware M17x", STAC_ALIENWARE_M17X),
1976 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0490,
1977 "Alienware M17x R3", STAC_DELL_EQ),
1978 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x1927,
1979 "HP Z1 G2", STAC_92HD89XX_HP_Z1_G2_RIGHT_MIC_JACK),
1980 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x2b17,
1981 "unknown HP", STAC_92HD89XX_HP_FRONT_JACK),
1985 static const struct hda_pintbl ref92hd83xxx_pin_configs[] = {
1986 { 0x0a, 0x02214030 },
1987 { 0x0b, 0x02211010 },
1988 { 0x0c, 0x02a19020 },
1989 { 0x0d, 0x02170130 },
1990 { 0x0e, 0x01014050 },
1991 { 0x0f, 0x01819040 },
1992 { 0x10, 0x01014020 },
1993 { 0x11, 0x90a3014e },
1994 { 0x1f, 0x01451160 },
1995 { 0x20, 0x98560170 },
1999 static const struct hda_pintbl dell_s14_pin_configs[] = {
2000 { 0x0a, 0x0221403f },
2001 { 0x0b, 0x0221101f },
2002 { 0x0c, 0x02a19020 },
2003 { 0x0d, 0x90170110 },
2004 { 0x0e, 0x40f000f0 },
2005 { 0x0f, 0x40f000f0 },
2006 { 0x10, 0x40f000f0 },
2007 { 0x11, 0x90a60160 },
2008 { 0x1f, 0x40f000f0 },
2009 { 0x20, 0x40f000f0 },
2013 static const struct hda_pintbl dell_vostro_3500_pin_configs[] = {
2014 { 0x0a, 0x02a11020 },
2015 { 0x0b, 0x0221101f },
2016 { 0x0c, 0x400000f0 },
2017 { 0x0d, 0x90170110 },
2018 { 0x0e, 0x400000f1 },
2019 { 0x0f, 0x400000f2 },
2020 { 0x10, 0x400000f3 },
2021 { 0x11, 0x90a60160 },
2022 { 0x1f, 0x400000f4 },
2023 { 0x20, 0x400000f5 },
2027 static const struct hda_pintbl hp_dv7_4000_pin_configs[] = {
2028 { 0x0a, 0x03a12050 },
2029 { 0x0b, 0x0321201f },
2030 { 0x0c, 0x40f000f0 },
2031 { 0x0d, 0x90170110 },
2032 { 0x0e, 0x40f000f0 },
2033 { 0x0f, 0x40f000f0 },
2034 { 0x10, 0x90170110 },
2035 { 0x11, 0xd5a30140 },
2036 { 0x1f, 0x40f000f0 },
2037 { 0x20, 0x40f000f0 },
2041 static const struct hda_pintbl hp_zephyr_pin_configs[] = {
2042 { 0x0a, 0x01813050 },
2043 { 0x0b, 0x0421201f },
2044 { 0x0c, 0x04a1205e },
2045 { 0x0d, 0x96130310 },
2046 { 0x0e, 0x96130310 },
2047 { 0x0f, 0x0101401f },
2048 { 0x10, 0x1111611f },
2049 { 0x11, 0xd5a30130 },
2053 static const struct hda_pintbl hp_cNB11_intquad_pin_configs[] = {
2054 { 0x0a, 0x40f000f0 },
2055 { 0x0b, 0x0221101f },
2056 { 0x0c, 0x02a11020 },
2057 { 0x0d, 0x92170110 },
2058 { 0x0e, 0x40f000f0 },
2059 { 0x0f, 0x92170110 },
2060 { 0x10, 0x40f000f0 },
2061 { 0x11, 0xd5a30130 },
2062 { 0x1f, 0x40f000f0 },
2063 { 0x20, 0x40f000f0 },
2067 static void stac92hd83xxx_fixup_hp(struct hda_codec *codec,
2068 const struct hda_fixup *fix, int action)
2070 struct sigmatel_spec *spec = codec->spec;
2072 if (action != HDA_FIXUP_ACT_PRE_PROBE)
2075 if (hp_bnb2011_with_dock(codec)) {
2076 snd_hda_codec_set_pincfg(codec, 0xa, 0x2101201f);
2077 snd_hda_codec_set_pincfg(codec, 0xf, 0x2181205e);
2080 if (find_mute_led_cfg(codec, spec->default_polarity))
2081 snd_printd("mute LED gpio %d polarity %d\n",
2083 spec->gpio_led_polarity);
2086 static void stac92hd83xxx_fixup_hp_zephyr(struct hda_codec *codec,
2087 const struct hda_fixup *fix, int action)
2089 if (action != HDA_FIXUP_ACT_PRE_PROBE)
2092 snd_hda_apply_pincfgs(codec, hp_zephyr_pin_configs);
2093 snd_hda_add_verbs(codec, stac92hd83xxx_hp_zephyr_init);
2096 static void stac92hd83xxx_fixup_hp_led(struct hda_codec *codec,
2097 const struct hda_fixup *fix, int action)
2099 struct sigmatel_spec *spec = codec->spec;
2101 if (action == HDA_FIXUP_ACT_PRE_PROBE)
2102 spec->default_polarity = 0;
2105 static void stac92hd83xxx_fixup_hp_inv_led(struct hda_codec *codec,
2106 const struct hda_fixup *fix, int action)
2108 struct sigmatel_spec *spec = codec->spec;
2110 if (action == HDA_FIXUP_ACT_PRE_PROBE)
2111 spec->default_polarity = 1;
2114 static void stac92hd83xxx_fixup_hp_mic_led(struct hda_codec *codec,
2115 const struct hda_fixup *fix, int action)
2117 struct sigmatel_spec *spec = codec->spec;
2119 if (action == HDA_FIXUP_ACT_PRE_PROBE)
2120 spec->mic_mute_led_gpio = 0x08; /* GPIO3 */
2123 static void stac92hd83xxx_fixup_hp_led_gpio10(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) {
2129 spec->gpio_led = 0x10; /* GPIO4 */
2130 spec->default_polarity = 0;
2134 static void stac92hd83xxx_fixup_headset_jack(struct hda_codec *codec,
2135 const struct hda_fixup *fix, int action)
2137 struct sigmatel_spec *spec = codec->spec;
2139 if (action == HDA_FIXUP_ACT_PRE_PROBE)
2140 spec->headset_jack = 1;
2143 static const struct hda_fixup stac92hd83xxx_fixups[] = {
2144 [STAC_92HD83XXX_REF] = {
2145 .type = HDA_FIXUP_PINS,
2146 .v.pins = ref92hd83xxx_pin_configs,
2148 [STAC_92HD83XXX_PWR_REF] = {
2149 .type = HDA_FIXUP_PINS,
2150 .v.pins = ref92hd83xxx_pin_configs,
2153 .type = HDA_FIXUP_PINS,
2154 .v.pins = dell_s14_pin_configs,
2156 [STAC_DELL_VOSTRO_3500] = {
2157 .type = HDA_FIXUP_PINS,
2158 .v.pins = dell_vostro_3500_pin_configs,
2160 [STAC_92HD83XXX_HP_cNB11_INTQUAD] = {
2161 .type = HDA_FIXUP_PINS,
2162 .v.pins = hp_cNB11_intquad_pin_configs,
2164 .chain_id = STAC_92HD83XXX_HP,
2166 [STAC_92HD83XXX_HP] = {
2167 .type = HDA_FIXUP_FUNC,
2168 .v.func = stac92hd83xxx_fixup_hp,
2170 [STAC_HP_DV7_4000] = {
2171 .type = HDA_FIXUP_PINS,
2172 .v.pins = hp_dv7_4000_pin_configs,
2174 .chain_id = STAC_92HD83XXX_HP,
2176 [STAC_HP_ZEPHYR] = {
2177 .type = HDA_FIXUP_FUNC,
2178 .v.func = stac92hd83xxx_fixup_hp_zephyr,
2180 .chain_id = STAC_92HD83XXX_HP,
2182 [STAC_92HD83XXX_HP_LED] = {
2183 .type = HDA_FIXUP_FUNC,
2184 .v.func = stac92hd83xxx_fixup_hp_led,
2186 .chain_id = STAC_92HD83XXX_HP,
2188 [STAC_92HD83XXX_HP_INV_LED] = {
2189 .type = HDA_FIXUP_FUNC,
2190 .v.func = stac92hd83xxx_fixup_hp_inv_led,
2192 .chain_id = STAC_92HD83XXX_HP,
2194 [STAC_92HD83XXX_HP_MIC_LED] = {
2195 .type = HDA_FIXUP_FUNC,
2196 .v.func = stac92hd83xxx_fixup_hp_mic_led,
2198 .chain_id = STAC_92HD83XXX_HP,
2200 [STAC_HP_LED_GPIO10] = {
2201 .type = HDA_FIXUP_FUNC,
2202 .v.func = stac92hd83xxx_fixup_hp_led_gpio10,
2204 .chain_id = STAC_92HD83XXX_HP,
2206 [STAC_92HD83XXX_HEADSET_JACK] = {
2207 .type = HDA_FIXUP_FUNC,
2208 .v.func = stac92hd83xxx_fixup_headset_jack,
2210 [STAC_HP_ENVY_BASS] = {
2211 .type = HDA_FIXUP_PINS,
2212 .v.pins = (const struct hda_pintbl[]) {
2213 { 0x0f, 0x90170111 },
2219 static const struct hda_model_fixup stac92hd83xxx_models[] = {
2220 { .id = STAC_92HD83XXX_REF, .name = "ref" },
2221 { .id = STAC_92HD83XXX_PWR_REF, .name = "mic-ref" },
2222 { .id = STAC_DELL_S14, .name = "dell-s14" },
2223 { .id = STAC_DELL_VOSTRO_3500, .name = "dell-vostro-3500" },
2224 { .id = STAC_92HD83XXX_HP_cNB11_INTQUAD, .name = "hp_cNB11_intquad" },
2225 { .id = STAC_HP_DV7_4000, .name = "hp-dv7-4000" },
2226 { .id = STAC_HP_ZEPHYR, .name = "hp-zephyr" },
2227 { .id = STAC_92HD83XXX_HP_LED, .name = "hp-led" },
2228 { .id = STAC_92HD83XXX_HP_INV_LED, .name = "hp-inv-led" },
2229 { .id = STAC_92HD83XXX_HP_MIC_LED, .name = "hp-mic-led" },
2230 { .id = STAC_92HD83XXX_HEADSET_JACK, .name = "headset-jack" },
2231 { .id = STAC_HP_ENVY_BASS, .name = "hp-envy-bass" },
2235 static const struct snd_pci_quirk stac92hd83xxx_fixup_tbl[] = {
2236 /* SigmaTel reference board */
2237 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2668,
2238 "DFI LanParty", STAC_92HD83XXX_REF),
2239 SND_PCI_QUIRK(PCI_VENDOR_ID_DFI, 0x3101,
2240 "DFI LanParty", STAC_92HD83XXX_REF),
2241 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x02ba,
2242 "unknown Dell", STAC_DELL_S14),
2243 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0532,
2244 "Dell Latitude E6230", STAC_92HD83XXX_HEADSET_JACK),
2245 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0533,
2246 "Dell Latitude E6330", STAC_92HD83XXX_HEADSET_JACK),
2247 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0534,
2248 "Dell Latitude E6430", STAC_92HD83XXX_HEADSET_JACK),
2249 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0535,
2250 "Dell Latitude E6530", STAC_92HD83XXX_HEADSET_JACK),
2251 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x053c,
2252 "Dell Latitude E5430", STAC_92HD83XXX_HEADSET_JACK),
2253 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x053d,
2254 "Dell Latitude E5530", STAC_92HD83XXX_HEADSET_JACK),
2255 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0549,
2256 "Dell Latitude E5430", STAC_92HD83XXX_HEADSET_JACK),
2257 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x057d,
2258 "Dell Latitude E6430s", STAC_92HD83XXX_HEADSET_JACK),
2259 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0584,
2260 "Dell Latitude E6430U", STAC_92HD83XXX_HEADSET_JACK),
2261 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x1028,
2262 "Dell Vostro 3500", STAC_DELL_VOSTRO_3500),
2263 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x1656,
2264 "HP", STAC_92HD83XXX_HP_cNB11_INTQUAD),
2265 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x1657,
2266 "HP", STAC_92HD83XXX_HP_cNB11_INTQUAD),
2267 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x1658,
2268 "HP", STAC_92HD83XXX_HP_cNB11_INTQUAD),
2269 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x1659,
2270 "HP Pavilion dv7", STAC_HP_DV7_4000),
2271 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x165A,
2272 "HP", STAC_92HD83XXX_HP_cNB11_INTQUAD),
2273 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x165B,
2274 "HP", STAC_92HD83XXX_HP_cNB11_INTQUAD),
2275 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x1888,
2276 "HP Envy Spectre", STAC_HP_ENVY_BASS),
2277 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x1899,
2278 "HP Folio 13", STAC_HP_LED_GPIO10),
2279 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x18df,
2280 "HP Folio", STAC_92HD83XXX_HP_MIC_LED),
2281 SND_PCI_QUIRK_MASK(PCI_VENDOR_ID_HP, 0xff00, 0x1900,
2282 "HP", STAC_92HD83XXX_HP_MIC_LED),
2283 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x3388,
2284 "HP", STAC_92HD83XXX_HP_cNB11_INTQUAD),
2285 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x3389,
2286 "HP", STAC_92HD83XXX_HP_cNB11_INTQUAD),
2287 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x355B,
2288 "HP", STAC_92HD83XXX_HP_cNB11_INTQUAD),
2289 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x355C,
2290 "HP", STAC_92HD83XXX_HP_cNB11_INTQUAD),
2291 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x355D,
2292 "HP", STAC_92HD83XXX_HP_cNB11_INTQUAD),
2293 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x355E,
2294 "HP", STAC_92HD83XXX_HP_cNB11_INTQUAD),
2295 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x355F,
2296 "HP", STAC_92HD83XXX_HP_cNB11_INTQUAD),
2297 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x3560,
2298 "HP", STAC_92HD83XXX_HP_cNB11_INTQUAD),
2299 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x358B,
2300 "HP", STAC_92HD83XXX_HP_cNB11_INTQUAD),
2301 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x358C,
2302 "HP", STAC_92HD83XXX_HP_cNB11_INTQUAD),
2303 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x358D,
2304 "HP", STAC_92HD83XXX_HP_cNB11_INTQUAD),
2305 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x3591,
2306 "HP", STAC_92HD83XXX_HP_cNB11_INTQUAD),
2307 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x3592,
2308 "HP", STAC_92HD83XXX_HP_cNB11_INTQUAD),
2309 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x3593,
2310 "HP", STAC_92HD83XXX_HP_cNB11_INTQUAD),
2311 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x3561,
2312 "HP", STAC_HP_ZEPHYR),
2313 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x3660,
2314 "HP Mini", STAC_92HD83XXX_HP_LED),
2315 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x144E,
2316 "HP Pavilion dv5", STAC_92HD83XXX_HP_INV_LED),
2317 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x148a,
2318 "HP Mini", STAC_92HD83XXX_HP_LED),
2319 SND_PCI_QUIRK_VENDOR(PCI_VENDOR_ID_HP, "HP", STAC_92HD83XXX_HP),
2323 /* HP dv7 bass switch - GPIO5 */
2324 #define stac_hp_bass_gpio_info snd_ctl_boolean_mono_info
2325 static int stac_hp_bass_gpio_get(struct snd_kcontrol *kcontrol,
2326 struct snd_ctl_elem_value *ucontrol)
2328 struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
2329 struct sigmatel_spec *spec = codec->spec;
2330 ucontrol->value.integer.value[0] = !!(spec->gpio_data & 0x20);
2334 static int stac_hp_bass_gpio_put(struct snd_kcontrol *kcontrol,
2335 struct snd_ctl_elem_value *ucontrol)
2337 struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
2338 struct sigmatel_spec *spec = codec->spec;
2339 unsigned int gpio_data;
2341 gpio_data = (spec->gpio_data & ~0x20) |
2342 (ucontrol->value.integer.value[0] ? 0x20 : 0);
2343 if (gpio_data == spec->gpio_data)
2345 spec->gpio_data = gpio_data;
2346 stac_gpio_set(codec, spec->gpio_mask, spec->gpio_dir, spec->gpio_data);
2350 static const struct snd_kcontrol_new stac_hp_bass_sw_ctrl = {
2351 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
2352 .info = stac_hp_bass_gpio_info,
2353 .get = stac_hp_bass_gpio_get,
2354 .put = stac_hp_bass_gpio_put,
2357 static int stac_add_hp_bass_switch(struct hda_codec *codec)
2359 struct sigmatel_spec *spec = codec->spec;
2361 if (!snd_hda_gen_add_kctl(&spec->gen, "Bass Speaker Playback Switch",
2362 &stac_hp_bass_sw_ctrl))
2365 spec->gpio_mask |= 0x20;
2366 spec->gpio_dir |= 0x20;
2367 spec->gpio_data |= 0x20;
2371 static const struct hda_pintbl ref92hd71bxx_pin_configs[] = {
2372 { 0x0a, 0x02214030 },
2373 { 0x0b, 0x02a19040 },
2374 { 0x0c, 0x01a19020 },
2375 { 0x0d, 0x01014010 },
2376 { 0x0e, 0x0181302e },
2377 { 0x0f, 0x01014010 },
2378 { 0x14, 0x01019020 },
2379 { 0x18, 0x90a000f0 },
2380 { 0x19, 0x90a000f0 },
2381 { 0x1e, 0x01452050 },
2382 { 0x1f, 0x01452050 },
2386 static const struct hda_pintbl dell_m4_1_pin_configs[] = {
2387 { 0x0a, 0x0421101f },
2388 { 0x0b, 0x04a11221 },
2389 { 0x0c, 0x40f000f0 },
2390 { 0x0d, 0x90170110 },
2391 { 0x0e, 0x23a1902e },
2392 { 0x0f, 0x23014250 },
2393 { 0x14, 0x40f000f0 },
2394 { 0x18, 0x90a000f0 },
2395 { 0x19, 0x40f000f0 },
2396 { 0x1e, 0x4f0000f0 },
2397 { 0x1f, 0x4f0000f0 },
2401 static const struct hda_pintbl dell_m4_2_pin_configs[] = {
2402 { 0x0a, 0x0421101f },
2403 { 0x0b, 0x04a11221 },
2404 { 0x0c, 0x90a70330 },
2405 { 0x0d, 0x90170110 },
2406 { 0x0e, 0x23a1902e },
2407 { 0x0f, 0x23014250 },
2408 { 0x14, 0x40f000f0 },
2409 { 0x18, 0x40f000f0 },
2410 { 0x19, 0x40f000f0 },
2411 { 0x1e, 0x044413b0 },
2412 { 0x1f, 0x044413b0 },
2416 static const struct hda_pintbl dell_m4_3_pin_configs[] = {
2417 { 0x0a, 0x0421101f },
2418 { 0x0b, 0x04a11221 },
2419 { 0x0c, 0x90a70330 },
2420 { 0x0d, 0x90170110 },
2421 { 0x0e, 0x40f000f0 },
2422 { 0x0f, 0x40f000f0 },
2423 { 0x14, 0x40f000f0 },
2424 { 0x18, 0x90a000f0 },
2425 { 0x19, 0x40f000f0 },
2426 { 0x1e, 0x044413b0 },
2427 { 0x1f, 0x044413b0 },
2431 static void stac92hd71bxx_fixup_ref(struct hda_codec *codec,
2432 const struct hda_fixup *fix, int action)
2434 struct sigmatel_spec *spec = codec->spec;
2436 if (action != HDA_FIXUP_ACT_PRE_PROBE)
2439 snd_hda_apply_pincfgs(codec, ref92hd71bxx_pin_configs);
2440 spec->gpio_mask = spec->gpio_dir = spec->gpio_data = 0;
2443 static void stac92hd71bxx_fixup_hp_m4(struct hda_codec *codec,
2444 const struct hda_fixup *fix, int action)
2446 struct sigmatel_spec *spec = codec->spec;
2447 struct hda_jack_tbl *jack;
2449 if (action != HDA_FIXUP_ACT_PRE_PROBE)
2452 /* Enable VREF power saving on GPIO1 detect */
2453 snd_hda_codec_write_cache(codec, codec->afg, 0,
2454 AC_VERB_SET_GPIO_UNSOLICITED_RSP_MASK, 0x02);
2455 snd_hda_jack_detect_enable_callback(codec, codec->afg,
2458 jack = snd_hda_jack_tbl_get(codec, codec->afg);
2460 jack->private_data = 0x02;
2462 spec->gpio_mask |= 0x02;
2464 /* enable internal microphone */
2465 snd_hda_codec_set_pincfg(codec, 0x0e, 0x01813040);
2468 static void stac92hd71bxx_fixup_hp_dv4(struct hda_codec *codec,
2469 const struct hda_fixup *fix, int action)
2471 struct sigmatel_spec *spec = codec->spec;
2473 if (action != HDA_FIXUP_ACT_PRE_PROBE)
2475 spec->gpio_led = 0x01;
2478 static void stac92hd71bxx_fixup_hp_dv5(struct hda_codec *codec,
2479 const struct hda_fixup *fix, int action)
2484 case HDA_FIXUP_ACT_PRE_PROBE:
2485 snd_hda_codec_set_pincfg(codec, 0x0d, 0x90170010);
2488 case HDA_FIXUP_ACT_PROBE:
2489 /* enable bass on HP dv7 */
2490 cap = snd_hda_param_read(codec, 0x1, AC_PAR_GPIO_CAP);
2491 cap &= AC_GPIO_IO_COUNT;
2493 stac_add_hp_bass_switch(codec);
2498 static void stac92hd71bxx_fixup_hp_hdx(struct hda_codec *codec,
2499 const struct hda_fixup *fix, int action)
2501 struct sigmatel_spec *spec = codec->spec;
2503 if (action != HDA_FIXUP_ACT_PRE_PROBE)
2505 spec->gpio_led = 0x08;
2509 static void stac92hd71bxx_fixup_hp(struct hda_codec *codec,
2510 const struct hda_fixup *fix, int action)
2512 struct sigmatel_spec *spec = codec->spec;
2514 if (action != HDA_FIXUP_ACT_PRE_PROBE)
2517 if (hp_blike_system(codec->subsystem_id)) {
2518 unsigned int pin_cfg = snd_hda_codec_get_pincfg(codec, 0x0f);
2519 if (get_defcfg_device(pin_cfg) == AC_JACK_LINE_OUT ||
2520 get_defcfg_device(pin_cfg) == AC_JACK_SPEAKER ||
2521 get_defcfg_device(pin_cfg) == AC_JACK_HP_OUT) {
2522 /* It was changed in the BIOS to just satisfy MS DTM.
2523 * Lets turn it back into slaved HP
2525 pin_cfg = (pin_cfg & (~AC_DEFCFG_DEVICE))
2526 | (AC_JACK_HP_OUT <<
2527 AC_DEFCFG_DEVICE_SHIFT);
2528 pin_cfg = (pin_cfg & (~(AC_DEFCFG_DEF_ASSOC
2529 | AC_DEFCFG_SEQUENCE)))
2531 snd_hda_codec_set_pincfg(codec, 0x0f, pin_cfg);
2535 if (find_mute_led_cfg(codec, 1))
2536 snd_printd("mute LED gpio %d polarity %d\n",
2538 spec->gpio_led_polarity);
2542 static const struct hda_fixup stac92hd71bxx_fixups[] = {
2543 [STAC_92HD71BXX_REF] = {
2544 .type = HDA_FIXUP_FUNC,
2545 .v.func = stac92hd71bxx_fixup_ref,
2547 [STAC_DELL_M4_1] = {
2548 .type = HDA_FIXUP_PINS,
2549 .v.pins = dell_m4_1_pin_configs,
2551 [STAC_DELL_M4_2] = {
2552 .type = HDA_FIXUP_PINS,
2553 .v.pins = dell_m4_2_pin_configs,
2555 [STAC_DELL_M4_3] = {
2556 .type = HDA_FIXUP_PINS,
2557 .v.pins = dell_m4_3_pin_configs,
2560 .type = HDA_FIXUP_FUNC,
2561 .v.func = stac92hd71bxx_fixup_hp_m4,
2563 .chain_id = STAC_92HD71BXX_HP,
2566 .type = HDA_FIXUP_FUNC,
2567 .v.func = stac92hd71bxx_fixup_hp_dv4,
2569 .chain_id = STAC_HP_DV5,
2572 .type = HDA_FIXUP_FUNC,
2573 .v.func = stac92hd71bxx_fixup_hp_dv5,
2575 .chain_id = STAC_92HD71BXX_HP,
2578 .type = HDA_FIXUP_FUNC,
2579 .v.func = stac92hd71bxx_fixup_hp_hdx,
2581 .chain_id = STAC_92HD71BXX_HP,
2583 [STAC_92HD71BXX_HP] = {
2584 .type = HDA_FIXUP_FUNC,
2585 .v.func = stac92hd71bxx_fixup_hp,
2589 static const struct hda_model_fixup stac92hd71bxx_models[] = {
2590 { .id = STAC_92HD71BXX_REF, .name = "ref" },
2591 { .id = STAC_DELL_M4_1, .name = "dell-m4-1" },
2592 { .id = STAC_DELL_M4_2, .name = "dell-m4-2" },
2593 { .id = STAC_DELL_M4_3, .name = "dell-m4-3" },
2594 { .id = STAC_HP_M4, .name = "hp-m4" },
2595 { .id = STAC_HP_DV4, .name = "hp-dv4" },
2596 { .id = STAC_HP_DV5, .name = "hp-dv5" },
2597 { .id = STAC_HP_HDX, .name = "hp-hdx" },
2598 { .id = STAC_HP_DV4, .name = "hp-dv4-1222nr" },
2602 static const struct snd_pci_quirk stac92hd71bxx_fixup_tbl[] = {
2603 /* SigmaTel reference board */
2604 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2668,
2605 "DFI LanParty", STAC_92HD71BXX_REF),
2606 SND_PCI_QUIRK(PCI_VENDOR_ID_DFI, 0x3101,
2607 "DFI LanParty", STAC_92HD71BXX_REF),
2608 SND_PCI_QUIRK_MASK(PCI_VENDOR_ID_HP, 0xfff0, 0x1720,
2610 SND_PCI_QUIRK_MASK(PCI_VENDOR_ID_HP, 0xfff0, 0x3080,
2612 SND_PCI_QUIRK_MASK(PCI_VENDOR_ID_HP, 0xfff0, 0x30f0,
2613 "HP dv4-7", STAC_HP_DV4),
2614 SND_PCI_QUIRK_MASK(PCI_VENDOR_ID_HP, 0xfff0, 0x3600,
2615 "HP dv4-7", STAC_HP_DV5),
2616 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x3610,
2617 "HP HDX", STAC_HP_HDX), /* HDX18 */
2618 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x361a,
2619 "HP mini 1000", STAC_HP_M4),
2620 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x361b,
2621 "HP HDX", STAC_HP_HDX), /* HDX16 */
2622 SND_PCI_QUIRK_MASK(PCI_VENDOR_ID_HP, 0xfff0, 0x3620,
2623 "HP dv6", STAC_HP_DV5),
2624 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x3061,
2625 "HP dv6", STAC_HP_DV5), /* HP dv6-1110ax */
2626 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x363e,
2627 "HP DV6", STAC_HP_DV5),
2628 SND_PCI_QUIRK_MASK(PCI_VENDOR_ID_HP, 0xfff0, 0x7010,
2630 SND_PCI_QUIRK_VENDOR(PCI_VENDOR_ID_HP, "HP", STAC_92HD71BXX_HP),
2631 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0233,
2632 "unknown Dell", STAC_DELL_M4_1),
2633 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0234,
2634 "unknown Dell", STAC_DELL_M4_1),
2635 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0250,
2636 "unknown Dell", STAC_DELL_M4_1),
2637 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x024f,
2638 "unknown Dell", STAC_DELL_M4_1),
2639 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x024d,
2640 "unknown Dell", STAC_DELL_M4_1),
2641 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0251,
2642 "unknown Dell", STAC_DELL_M4_1),
2643 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0277,
2644 "unknown Dell", STAC_DELL_M4_1),
2645 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0263,
2646 "unknown Dell", STAC_DELL_M4_2),
2647 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0265,
2648 "unknown Dell", STAC_DELL_M4_2),
2649 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0262,
2650 "unknown Dell", STAC_DELL_M4_2),
2651 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0264,
2652 "unknown Dell", STAC_DELL_M4_2),
2653 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x02aa,
2654 "unknown Dell", STAC_DELL_M4_3),
2658 static const struct hda_pintbl ref922x_pin_configs[] = {
2659 { 0x0a, 0x01014010 },
2660 { 0x0b, 0x01016011 },
2661 { 0x0c, 0x01012012 },
2662 { 0x0d, 0x0221401f },
2663 { 0x0e, 0x01813122 },
2664 { 0x0f, 0x01011014 },
2665 { 0x10, 0x01441030 },
2666 { 0x11, 0x01c41030 },
2667 { 0x15, 0x40000100 },
2668 { 0x1b, 0x40000100 },
2673 STAC 922X pin configs for
2680 static const struct hda_pintbl dell_922x_d81_pin_configs[] = {
2681 { 0x0a, 0x02214030 },
2682 { 0x0b, 0x01a19021 },
2683 { 0x0c, 0x01111012 },
2684 { 0x0d, 0x01114010 },
2685 { 0x0e, 0x02a19020 },
2686 { 0x0f, 0x01117011 },
2687 { 0x10, 0x400001f0 },
2688 { 0x11, 0x400001f1 },
2689 { 0x15, 0x01813122 },
2690 { 0x1b, 0x400001f2 },
2695 STAC 922X pin configs for
2699 static const struct hda_pintbl dell_922x_d82_pin_configs[] = {
2700 { 0x0a, 0x02214030 },
2701 { 0x0b, 0x01a19021 },
2702 { 0x0c, 0x01111012 },
2703 { 0x0d, 0x01114010 },
2704 { 0x0e, 0x02a19020 },
2705 { 0x0f, 0x01117011 },
2706 { 0x10, 0x01451140 },
2707 { 0x11, 0x400001f0 },
2708 { 0x15, 0x01813122 },
2709 { 0x1b, 0x400001f1 },
2714 STAC 922X pin configs for
2717 static const struct hda_pintbl dell_922x_m81_pin_configs[] = {
2718 { 0x0a, 0x0321101f },
2719 { 0x0b, 0x01112024 },
2720 { 0x0c, 0x01111222 },
2721 { 0x0d, 0x91174220 },
2722 { 0x0e, 0x03a11050 },
2723 { 0x0f, 0x01116221 },
2724 { 0x10, 0x90a70330 },
2725 { 0x11, 0x01452340 },
2726 { 0x15, 0x40C003f1 },
2727 { 0x1b, 0x405003f0 },
2732 STAC 9221 A1 pin configs for
2733 102801D7 (Dell XPS M1210)
2735 static const struct hda_pintbl dell_922x_m82_pin_configs[] = {
2736 { 0x0a, 0x02211211 },
2737 { 0x0b, 0x408103ff },
2738 { 0x0c, 0x02a1123e },
2739 { 0x0d, 0x90100310 },
2740 { 0x0e, 0x408003f1 },
2741 { 0x0f, 0x0221121f },
2742 { 0x10, 0x03451340 },
2743 { 0x11, 0x40c003f2 },
2744 { 0x15, 0x508003f3 },
2745 { 0x1b, 0x405003f4 },
2749 static const struct hda_pintbl d945gtp3_pin_configs[] = {
2750 { 0x0a, 0x0221401f },
2751 { 0x0b, 0x01a19022 },
2752 { 0x0c, 0x01813021 },
2753 { 0x0d, 0x01014010 },
2754 { 0x0e, 0x40000100 },
2755 { 0x0f, 0x40000100 },
2756 { 0x10, 0x40000100 },
2757 { 0x11, 0x40000100 },
2758 { 0x15, 0x02a19120 },
2759 { 0x1b, 0x40000100 },
2763 static const struct hda_pintbl d945gtp5_pin_configs[] = {
2764 { 0x0a, 0x0221401f },
2765 { 0x0b, 0x01011012 },
2766 { 0x0c, 0x01813024 },
2767 { 0x0d, 0x01014010 },
2768 { 0x0e, 0x01a19021 },
2769 { 0x0f, 0x01016011 },
2770 { 0x10, 0x01452130 },
2771 { 0x11, 0x40000100 },
2772 { 0x15, 0x02a19320 },
2773 { 0x1b, 0x40000100 },
2777 static const struct hda_pintbl intel_mac_v1_pin_configs[] = {
2778 { 0x0a, 0x0121e21f },
2779 { 0x0b, 0x400000ff },
2780 { 0x0c, 0x9017e110 },
2781 { 0x0d, 0x400000fd },
2782 { 0x0e, 0x400000fe },
2783 { 0x0f, 0x0181e020 },
2784 { 0x10, 0x1145e030 },
2785 { 0x11, 0x11c5e240 },
2786 { 0x15, 0x400000fc },
2787 { 0x1b, 0x400000fb },
2791 static const struct hda_pintbl intel_mac_v2_pin_configs[] = {
2792 { 0x0a, 0x0121e21f },
2793 { 0x0b, 0x90a7012e },
2794 { 0x0c, 0x9017e110 },
2795 { 0x0d, 0x400000fd },
2796 { 0x0e, 0x400000fe },
2797 { 0x0f, 0x0181e020 },
2798 { 0x10, 0x1145e230 },
2799 { 0x11, 0x500000fa },
2800 { 0x15, 0x400000fc },
2801 { 0x1b, 0x400000fb },
2805 static const struct hda_pintbl intel_mac_v3_pin_configs[] = {
2806 { 0x0a, 0x0121e21f },
2807 { 0x0b, 0x90a7012e },
2808 { 0x0c, 0x9017e110 },
2809 { 0x0d, 0x400000fd },
2810 { 0x0e, 0x400000fe },
2811 { 0x0f, 0x0181e020 },
2812 { 0x10, 0x1145e230 },
2813 { 0x11, 0x11c5e240 },
2814 { 0x15, 0x400000fc },
2815 { 0x1b, 0x400000fb },
2819 static const struct hda_pintbl intel_mac_v4_pin_configs[] = {
2820 { 0x0a, 0x0321e21f },
2821 { 0x0b, 0x03a1e02e },
2822 { 0x0c, 0x9017e110 },
2823 { 0x0d, 0x9017e11f },
2824 { 0x0e, 0x400000fe },
2825 { 0x0f, 0x0381e020 },
2826 { 0x10, 0x1345e230 },
2827 { 0x11, 0x13c5e240 },
2828 { 0x15, 0x400000fc },
2829 { 0x1b, 0x400000fb },
2833 static const struct hda_pintbl intel_mac_v5_pin_configs[] = {
2834 { 0x0a, 0x0321e21f },
2835 { 0x0b, 0x03a1e02e },
2836 { 0x0c, 0x9017e110 },
2837 { 0x0d, 0x9017e11f },
2838 { 0x0e, 0x400000fe },
2839 { 0x0f, 0x0381e020 },
2840 { 0x10, 0x1345e230 },
2841 { 0x11, 0x13c5e240 },
2842 { 0x15, 0x400000fc },
2843 { 0x1b, 0x400000fb },
2847 static const struct hda_pintbl ecs202_pin_configs[] = {
2848 { 0x0a, 0x0221401f },
2849 { 0x0b, 0x02a19020 },
2850 { 0x0c, 0x01a19020 },
2851 { 0x0d, 0x01114010 },
2852 { 0x0e, 0x408000f0 },
2853 { 0x0f, 0x01813022 },
2854 { 0x10, 0x074510a0 },
2855 { 0x11, 0x40c400f1 },
2856 { 0x15, 0x9037012e },
2857 { 0x1b, 0x40e000f2 },
2861 /* codec SSIDs for Intel Mac sharing the same PCI SSID 8384:7680 */
2862 static const struct snd_pci_quirk stac922x_intel_mac_fixup_tbl[] = {
2863 SND_PCI_QUIRK(0x0000, 0x0100, "Mac Mini", STAC_INTEL_MAC_V3),
2864 SND_PCI_QUIRK(0x106b, 0x0800, "Mac", STAC_INTEL_MAC_V1),
2865 SND_PCI_QUIRK(0x106b, 0x0600, "Mac", STAC_INTEL_MAC_V2),
2866 SND_PCI_QUIRK(0x106b, 0x0700, "Mac", STAC_INTEL_MAC_V2),
2867 SND_PCI_QUIRK(0x106b, 0x0e00, "Mac", STAC_INTEL_MAC_V3),
2868 SND_PCI_QUIRK(0x106b, 0x0f00, "Mac", STAC_INTEL_MAC_V3),
2869 SND_PCI_QUIRK(0x106b, 0x1600, "Mac", STAC_INTEL_MAC_V3),
2870 SND_PCI_QUIRK(0x106b, 0x1700, "Mac", STAC_INTEL_MAC_V3),
2871 SND_PCI_QUIRK(0x106b, 0x0200, "Mac", STAC_INTEL_MAC_V3),
2872 SND_PCI_QUIRK(0x106b, 0x1e00, "Mac", STAC_INTEL_MAC_V3),
2873 SND_PCI_QUIRK(0x106b, 0x1a00, "Mac", STAC_INTEL_MAC_V4),
2874 SND_PCI_QUIRK(0x106b, 0x0a00, "Mac", STAC_INTEL_MAC_V5),
2875 SND_PCI_QUIRK(0x106b, 0x2200, "Mac", STAC_INTEL_MAC_V5),
2879 static const struct hda_fixup stac922x_fixups[];
2881 /* remap the fixup from codec SSID and apply it */
2882 static void stac922x_fixup_intel_mac_auto(struct hda_codec *codec,
2883 const struct hda_fixup *fix,
2886 if (action != HDA_FIXUP_ACT_PRE_PROBE)
2888 snd_hda_pick_fixup(codec, NULL, stac922x_intel_mac_fixup_tbl,
2890 if (codec->fixup_id != STAC_INTEL_MAC_AUTO)
2891 snd_hda_apply_fixup(codec, action);
2894 static void stac922x_fixup_intel_mac_gpio(struct hda_codec *codec,
2895 const struct hda_fixup *fix,
2898 struct sigmatel_spec *spec = codec->spec;
2900 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
2901 spec->gpio_mask = spec->gpio_dir = 0x03;
2902 spec->gpio_data = 0x03;
2906 static const struct hda_fixup stac922x_fixups[] = {
2908 .type = HDA_FIXUP_PINS,
2909 .v.pins = ref922x_pin_configs,
2912 .type = HDA_FIXUP_PINS,
2913 .v.pins = d945gtp3_pin_configs,
2916 .type = HDA_FIXUP_PINS,
2917 .v.pins = d945gtp5_pin_configs,
2919 [STAC_INTEL_MAC_AUTO] = {
2920 .type = HDA_FIXUP_FUNC,
2921 .v.func = stac922x_fixup_intel_mac_auto,
2923 [STAC_INTEL_MAC_V1] = {
2924 .type = HDA_FIXUP_PINS,
2925 .v.pins = intel_mac_v1_pin_configs,
2927 .chain_id = STAC_922X_INTEL_MAC_GPIO,
2929 [STAC_INTEL_MAC_V2] = {
2930 .type = HDA_FIXUP_PINS,
2931 .v.pins = intel_mac_v2_pin_configs,
2933 .chain_id = STAC_922X_INTEL_MAC_GPIO,
2935 [STAC_INTEL_MAC_V3] = {
2936 .type = HDA_FIXUP_PINS,
2937 .v.pins = intel_mac_v3_pin_configs,
2939 .chain_id = STAC_922X_INTEL_MAC_GPIO,
2941 [STAC_INTEL_MAC_V4] = {
2942 .type = HDA_FIXUP_PINS,
2943 .v.pins = intel_mac_v4_pin_configs,
2945 .chain_id = STAC_922X_INTEL_MAC_GPIO,
2947 [STAC_INTEL_MAC_V5] = {
2948 .type = HDA_FIXUP_PINS,
2949 .v.pins = intel_mac_v5_pin_configs,
2951 .chain_id = STAC_922X_INTEL_MAC_GPIO,
2953 [STAC_922X_INTEL_MAC_GPIO] = {
2954 .type = HDA_FIXUP_FUNC,
2955 .v.func = stac922x_fixup_intel_mac_gpio,
2958 .type = HDA_FIXUP_PINS,
2959 .v.pins = ecs202_pin_configs,
2961 [STAC_922X_DELL_D81] = {
2962 .type = HDA_FIXUP_PINS,
2963 .v.pins = dell_922x_d81_pin_configs,
2965 [STAC_922X_DELL_D82] = {
2966 .type = HDA_FIXUP_PINS,
2967 .v.pins = dell_922x_d82_pin_configs,
2969 [STAC_922X_DELL_M81] = {
2970 .type = HDA_FIXUP_PINS,
2971 .v.pins = dell_922x_m81_pin_configs,
2973 [STAC_922X_DELL_M82] = {
2974 .type = HDA_FIXUP_PINS,
2975 .v.pins = dell_922x_m82_pin_configs,
2979 static const struct hda_model_fixup stac922x_models[] = {
2980 { .id = STAC_D945_REF, .name = "ref" },
2981 { .id = STAC_D945GTP5, .name = "5stack" },
2982 { .id = STAC_D945GTP3, .name = "3stack" },
2983 { .id = STAC_INTEL_MAC_V1, .name = "intel-mac-v1" },
2984 { .id = STAC_INTEL_MAC_V2, .name = "intel-mac-v2" },
2985 { .id = STAC_INTEL_MAC_V3, .name = "intel-mac-v3" },
2986 { .id = STAC_INTEL_MAC_V4, .name = "intel-mac-v4" },
2987 { .id = STAC_INTEL_MAC_V5, .name = "intel-mac-v5" },
2988 { .id = STAC_INTEL_MAC_AUTO, .name = "intel-mac-auto" },
2989 { .id = STAC_ECS_202, .name = "ecs202" },
2990 { .id = STAC_922X_DELL_D81, .name = "dell-d81" },
2991 { .id = STAC_922X_DELL_D82, .name = "dell-d82" },
2992 { .id = STAC_922X_DELL_M81, .name = "dell-m81" },
2993 { .id = STAC_922X_DELL_M82, .name = "dell-m82" },
2994 /* for backward compatibility */
2995 { .id = STAC_INTEL_MAC_V3, .name = "macmini" },
2996 { .id = STAC_INTEL_MAC_V5, .name = "macbook" },
2997 { .id = STAC_INTEL_MAC_V3, .name = "macbook-pro-v1" },
2998 { .id = STAC_INTEL_MAC_V3, .name = "macbook-pro" },
2999 { .id = STAC_INTEL_MAC_V2, .name = "imac-intel" },
3000 { .id = STAC_INTEL_MAC_V3, .name = "imac-intel-20" },
3004 static const struct snd_pci_quirk stac922x_fixup_tbl[] = {
3005 /* SigmaTel reference board */
3006 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2668,
3007 "DFI LanParty", STAC_D945_REF),
3008 SND_PCI_QUIRK(PCI_VENDOR_ID_DFI, 0x3101,
3009 "DFI LanParty", STAC_D945_REF),
3010 /* Intel 945G based systems */
3011 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x0101,
3012 "Intel D945G", STAC_D945GTP3),
3013 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x0202,
3014 "Intel D945G", STAC_D945GTP3),
3015 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x0606,
3016 "Intel D945G", STAC_D945GTP3),
3017 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x0601,
3018 "Intel D945G", STAC_D945GTP3),
3019 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x0111,
3020 "Intel D945G", STAC_D945GTP3),
3021 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x1115,
3022 "Intel D945G", STAC_D945GTP3),
3023 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x1116,
3024 "Intel D945G", STAC_D945GTP3),
3025 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x1117,
3026 "Intel D945G", STAC_D945GTP3),
3027 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x1118,
3028 "Intel D945G", STAC_D945GTP3),
3029 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x1119,
3030 "Intel D945G", STAC_D945GTP3),
3031 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x8826,
3032 "Intel D945G", STAC_D945GTP3),
3033 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x5049,
3034 "Intel D945G", STAC_D945GTP3),
3035 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x5055,
3036 "Intel D945G", STAC_D945GTP3),
3037 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x5048,
3038 "Intel D945G", STAC_D945GTP3),
3039 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x0110,
3040 "Intel D945G", STAC_D945GTP3),
3041 /* Intel D945G 5-stack systems */
3042 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x0404,
3043 "Intel D945G", STAC_D945GTP5),
3044 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x0303,
3045 "Intel D945G", STAC_D945GTP5),
3046 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x0013,
3047 "Intel D945G", STAC_D945GTP5),
3048 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x0417,
3049 "Intel D945G", STAC_D945GTP5),
3050 /* Intel 945P based systems */
3051 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x0b0b,
3052 "Intel D945P", STAC_D945GTP3),
3053 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x0112,
3054 "Intel D945P", STAC_D945GTP3),
3055 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x0d0d,
3056 "Intel D945P", STAC_D945GTP3),
3057 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x0909,
3058 "Intel D945P", STAC_D945GTP3),
3059 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x0505,
3060 "Intel D945P", STAC_D945GTP3),
3061 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x0707,
3062 "Intel D945P", STAC_D945GTP5),
3064 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x0204,
3065 "Intel D945", STAC_D945_REF),
3068 /* Apple Intel Mac (Mac Mini, MacBook, MacBook Pro...) */
3069 SND_PCI_QUIRK(0x8384, 0x7680, "Mac", STAC_INTEL_MAC_AUTO),
3072 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01a7,
3073 "unknown Dell", STAC_922X_DELL_D81),
3074 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01a9,
3075 "unknown Dell", STAC_922X_DELL_D81),
3076 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01ab,
3077 "unknown Dell", STAC_922X_DELL_D81),
3078 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01ac,
3079 "unknown Dell", STAC_922X_DELL_D82),
3080 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01bf,
3081 "unknown Dell", STAC_922X_DELL_M81),
3082 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01d0,
3083 "unknown Dell", STAC_922X_DELL_D82),
3084 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01d1,
3085 "unknown Dell", STAC_922X_DELL_D81),
3086 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01d2,
3087 "unknown Dell", STAC_922X_DELL_D81),
3088 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01d7,
3089 "Dell XPS M1210", STAC_922X_DELL_M82),
3090 /* ECS/PC Chips boards */
3091 SND_PCI_QUIRK_MASK(0x1019, 0xf000, 0x2000,
3092 "ECS/PC chips", STAC_ECS_202),
3096 static const struct hda_pintbl ref927x_pin_configs[] = {
3097 { 0x0a, 0x02214020 },
3098 { 0x0b, 0x02a19080 },
3099 { 0x0c, 0x0181304e },
3100 { 0x0d, 0x01014010 },
3101 { 0x0e, 0x01a19040 },
3102 { 0x0f, 0x01011012 },
3103 { 0x10, 0x01016011 },
3104 { 0x11, 0x0101201f },
3105 { 0x12, 0x183301f0 },
3106 { 0x13, 0x18a001f0 },
3107 { 0x14, 0x18a001f0 },
3108 { 0x21, 0x01442070 },
3109 { 0x22, 0x01c42190 },
3110 { 0x23, 0x40000100 },
3114 static const struct hda_pintbl d965_3st_pin_configs[] = {
3115 { 0x0a, 0x0221401f },
3116 { 0x0b, 0x02a19120 },
3117 { 0x0c, 0x40000100 },
3118 { 0x0d, 0x01014011 },
3119 { 0x0e, 0x01a19021 },
3120 { 0x0f, 0x01813024 },
3121 { 0x10, 0x40000100 },
3122 { 0x11, 0x40000100 },
3123 { 0x12, 0x40000100 },
3124 { 0x13, 0x40000100 },
3125 { 0x14, 0x40000100 },
3126 { 0x21, 0x40000100 },
3127 { 0x22, 0x40000100 },
3128 { 0x23, 0x40000100 },
3132 static const struct hda_pintbl d965_5st_pin_configs[] = {
3133 { 0x0a, 0x02214020 },
3134 { 0x0b, 0x02a19080 },
3135 { 0x0c, 0x0181304e },
3136 { 0x0d, 0x01014010 },
3137 { 0x0e, 0x01a19040 },
3138 { 0x0f, 0x01011012 },
3139 { 0x10, 0x01016011 },
3140 { 0x11, 0x40000100 },
3141 { 0x12, 0x40000100 },
3142 { 0x13, 0x40000100 },
3143 { 0x14, 0x40000100 },
3144 { 0x21, 0x01442070 },
3145 { 0x22, 0x40000100 },
3146 { 0x23, 0x40000100 },
3150 static const struct hda_pintbl d965_5st_no_fp_pin_configs[] = {
3151 { 0x0a, 0x40000100 },
3152 { 0x0b, 0x40000100 },
3153 { 0x0c, 0x0181304e },
3154 { 0x0d, 0x01014010 },
3155 { 0x0e, 0x01a19040 },
3156 { 0x0f, 0x01011012 },
3157 { 0x10, 0x01016011 },
3158 { 0x11, 0x40000100 },
3159 { 0x12, 0x40000100 },
3160 { 0x13, 0x40000100 },
3161 { 0x14, 0x40000100 },
3162 { 0x21, 0x01442070 },
3163 { 0x22, 0x40000100 },
3164 { 0x23, 0x40000100 },
3168 static const struct hda_pintbl dell_3st_pin_configs[] = {
3169 { 0x0a, 0x02211230 },
3170 { 0x0b, 0x02a11220 },
3171 { 0x0c, 0x01a19040 },
3172 { 0x0d, 0x01114210 },
3173 { 0x0e, 0x01111212 },
3174 { 0x0f, 0x01116211 },
3175 { 0x10, 0x01813050 },
3176 { 0x11, 0x01112214 },
3177 { 0x12, 0x403003fa },
3178 { 0x13, 0x90a60040 },
3179 { 0x14, 0x90a60040 },
3180 { 0x21, 0x404003fb },
3181 { 0x22, 0x40c003fc },
3182 { 0x23, 0x40000100 },
3186 static void stac927x_fixup_ref_no_jd(struct hda_codec *codec,
3187 const struct hda_fixup *fix, int action)
3189 /* no jack detecion for ref-no-jd model */
3190 if (action == HDA_FIXUP_ACT_PRE_PROBE)
3191 codec->no_jack_detect = 1;
3194 static void stac927x_fixup_ref(struct hda_codec *codec,
3195 const struct hda_fixup *fix, int action)
3197 struct sigmatel_spec *spec = codec->spec;
3199 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
3200 snd_hda_apply_pincfgs(codec, ref927x_pin_configs);
3201 spec->eapd_mask = spec->gpio_mask = 0;
3202 spec->gpio_dir = spec->gpio_data = 0;
3206 static void stac927x_fixup_dell_dmic(struct hda_codec *codec,
3207 const struct hda_fixup *fix, int action)
3209 struct sigmatel_spec *spec = codec->spec;
3211 if (action != HDA_FIXUP_ACT_PRE_PROBE)
3214 if (codec->subsystem_id != 0x1028022f) {
3215 /* GPIO2 High = Enable EAPD */
3216 spec->eapd_mask = spec->gpio_mask = 0x04;
3217 spec->gpio_dir = spec->gpio_data = 0x04;
3220 snd_hda_add_verbs(codec, dell_3st_core_init);
3221 spec->volknob_init = 1;
3224 static void stac927x_fixup_volknob(struct hda_codec *codec,
3225 const struct hda_fixup *fix, int action)
3227 struct sigmatel_spec *spec = codec->spec;
3229 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
3230 snd_hda_add_verbs(codec, stac927x_volknob_core_init);
3231 spec->volknob_init = 1;
3235 static const struct hda_fixup stac927x_fixups[] = {
3236 [STAC_D965_REF_NO_JD] = {
3237 .type = HDA_FIXUP_FUNC,
3238 .v.func = stac927x_fixup_ref_no_jd,
3240 .chain_id = STAC_D965_REF,
3243 .type = HDA_FIXUP_FUNC,
3244 .v.func = stac927x_fixup_ref,
3247 .type = HDA_FIXUP_PINS,
3248 .v.pins = d965_3st_pin_configs,
3250 .chain_id = STAC_D965_VERBS,
3253 .type = HDA_FIXUP_PINS,
3254 .v.pins = d965_5st_pin_configs,
3256 .chain_id = STAC_D965_VERBS,
3258 [STAC_D965_VERBS] = {
3259 .type = HDA_FIXUP_VERBS,
3260 .v.verbs = d965_core_init,
3262 [STAC_D965_5ST_NO_FP] = {
3263 .type = HDA_FIXUP_PINS,
3264 .v.pins = d965_5st_no_fp_pin_configs,
3267 .type = HDA_FIXUP_PINS,
3268 .v.pins = dell_3st_pin_configs,
3270 .chain_id = STAC_927X_DELL_DMIC,
3272 [STAC_DELL_BIOS] = {
3273 .type = HDA_FIXUP_PINS,
3274 .v.pins = (const struct hda_pintbl[]) {
3275 /* configure the analog microphone on some laptops */
3276 { 0x0c, 0x90a79130 },
3277 /* correct the front output jack as a hp out */
3278 { 0x0f, 0x0221101f },
3279 /* correct the front input jack as a mic */
3280 { 0x0e, 0x02a79130 },
3284 .chain_id = STAC_927X_DELL_DMIC,
3286 [STAC_DELL_BIOS_SPDIF] = {
3287 .type = HDA_FIXUP_PINS,
3288 .v.pins = (const struct hda_pintbl[]) {
3289 /* correct the device field to SPDIF out */
3290 { 0x21, 0x01442070 },
3294 .chain_id = STAC_DELL_BIOS,
3296 [STAC_927X_DELL_DMIC] = {
3297 .type = HDA_FIXUP_FUNC,
3298 .v.func = stac927x_fixup_dell_dmic,
3300 [STAC_927X_VOLKNOB] = {
3301 .type = HDA_FIXUP_FUNC,
3302 .v.func = stac927x_fixup_volknob,
3306 static const struct hda_model_fixup stac927x_models[] = {
3307 { .id = STAC_D965_REF_NO_JD, .name = "ref-no-jd" },
3308 { .id = STAC_D965_REF, .name = "ref" },
3309 { .id = STAC_D965_3ST, .name = "3stack" },
3310 { .id = STAC_D965_5ST, .name = "5stack" },
3311 { .id = STAC_D965_5ST_NO_FP, .name = "5stack-no-fp" },
3312 { .id = STAC_DELL_3ST, .name = "dell-3stack" },
3313 { .id = STAC_DELL_BIOS, .name = "dell-bios" },
3314 { .id = STAC_927X_VOLKNOB, .name = "volknob" },
3318 static const struct snd_pci_quirk stac927x_fixup_tbl[] = {
3319 /* SigmaTel reference board */
3320 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2668,
3321 "DFI LanParty", STAC_D965_REF),
3322 SND_PCI_QUIRK(PCI_VENDOR_ID_DFI, 0x3101,
3323 "DFI LanParty", STAC_D965_REF),
3324 /* Intel 946 based systems */
3325 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x3d01, "Intel D946", STAC_D965_3ST),
3326 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0xa301, "Intel D946", STAC_D965_3ST),
3327 /* 965 based 3 stack systems */
3328 SND_PCI_QUIRK_MASK(PCI_VENDOR_ID_INTEL, 0xff00, 0x2100,
3329 "Intel D965", STAC_D965_3ST),
3330 SND_PCI_QUIRK_MASK(PCI_VENDOR_ID_INTEL, 0xff00, 0x2000,
3331 "Intel D965", STAC_D965_3ST),
3332 /* Dell 3 stack systems */
3333 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01dd, "Dell Dimension E520", STAC_DELL_3ST),
3334 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01ed, "Dell ", STAC_DELL_3ST),
3335 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01f4, "Dell ", STAC_DELL_3ST),
3336 /* Dell 3 stack systems with verb table in BIOS */
3337 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01f3, "Dell Inspiron 1420", STAC_DELL_BIOS),
3338 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01f7, "Dell XPS M1730", STAC_DELL_BIOS),
3339 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0227, "Dell Vostro 1400 ", STAC_DELL_BIOS),
3340 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x022e, "Dell ", STAC_DELL_BIOS_SPDIF),
3341 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x022f, "Dell Inspiron 1525", STAC_DELL_BIOS),
3342 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0242, "Dell ", STAC_DELL_BIOS),
3343 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0243, "Dell ", STAC_DELL_BIOS),
3344 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x02ff, "Dell ", STAC_DELL_BIOS),
3345 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0209, "Dell XPS 1330", STAC_DELL_BIOS_SPDIF),
3346 /* 965 based 5 stack systems */
3347 SND_PCI_QUIRK_MASK(PCI_VENDOR_ID_INTEL, 0xff00, 0x2300,
3348 "Intel D965", STAC_D965_5ST),
3349 SND_PCI_QUIRK_MASK(PCI_VENDOR_ID_INTEL, 0xff00, 0x2500,
3350 "Intel D965", STAC_D965_5ST),
3351 /* volume-knob fixes */
3352 SND_PCI_QUIRK_VENDOR(0x10cf, "FSC", STAC_927X_VOLKNOB),
3356 static const struct hda_pintbl ref9205_pin_configs[] = {
3357 { 0x0a, 0x40000100 },
3358 { 0x0b, 0x40000100 },
3359 { 0x0c, 0x01016011 },
3360 { 0x0d, 0x01014010 },
3361 { 0x0e, 0x01813122 },
3362 { 0x0f, 0x01a19021 },
3363 { 0x14, 0x01019020 },
3364 { 0x16, 0x40000100 },
3365 { 0x17, 0x90a000f0 },
3366 { 0x18, 0x90a000f0 },
3367 { 0x21, 0x01441030 },
3368 { 0x22, 0x01c41030 },
3373 STAC 9205 pin configs for
3380 10280228 (Dell Vostro 1500)
3381 10280229 (Dell Vostro 1700)
3383 static const struct hda_pintbl dell_9205_m42_pin_configs[] = {
3384 { 0x0a, 0x0321101F },
3385 { 0x0b, 0x03A11020 },
3386 { 0x0c, 0x400003FA },
3387 { 0x0d, 0x90170310 },
3388 { 0x0e, 0x400003FB },
3389 { 0x0f, 0x400003FC },
3390 { 0x14, 0x400003FD },
3391 { 0x16, 0x40F000F9 },
3392 { 0x17, 0x90A60330 },
3393 { 0x18, 0x400003FF },
3394 { 0x21, 0x0144131F },
3395 { 0x22, 0x40C003FE },
3400 STAC 9205 pin configs for
3404 102801FF (Dell Precision M4300)
3409 static const struct hda_pintbl dell_9205_m43_pin_configs[] = {
3410 { 0x0a, 0x0321101f },
3411 { 0x0b, 0x03a11020 },
3412 { 0x0c, 0x90a70330 },
3413 { 0x0d, 0x90170310 },
3414 { 0x0e, 0x400000fe },
3415 { 0x0f, 0x400000ff },
3416 { 0x14, 0x400000fd },
3417 { 0x16, 0x40f000f9 },
3418 { 0x17, 0x400000fa },
3419 { 0x18, 0x400000fc },
3420 { 0x21, 0x0144131f },
3421 { 0x22, 0x40c003f8 },
3422 /* Enable SPDIF in/out */
3423 { 0x1f, 0x01441030 },
3424 { 0x20, 0x1c410030 },
3428 static const struct hda_pintbl dell_9205_m44_pin_configs[] = {
3429 { 0x0a, 0x0421101f },
3430 { 0x0b, 0x04a11020 },
3431 { 0x0c, 0x400003fa },
3432 { 0x0d, 0x90170310 },
3433 { 0x0e, 0x400003fb },
3434 { 0x0f, 0x400003fc },
3435 { 0x14, 0x400003fd },
3436 { 0x16, 0x400003f9 },
3437 { 0x17, 0x90a60330 },
3438 { 0x18, 0x400003ff },
3439 { 0x21, 0x01441340 },
3440 { 0x22, 0x40c003fe },
3444 static void stac9205_fixup_ref(struct hda_codec *codec,
3445 const struct hda_fixup *fix, int action)
3447 struct sigmatel_spec *spec = codec->spec;
3449 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
3450 snd_hda_apply_pincfgs(codec, ref9205_pin_configs);
3451 /* SPDIF-In enabled */
3452 spec->eapd_mask = spec->gpio_mask = spec->gpio_dir = 0;
3456 static void stac9205_fixup_dell_m43(struct hda_codec *codec,
3457 const struct hda_fixup *fix, int action)
3459 struct sigmatel_spec *spec = codec->spec;
3460 struct hda_jack_tbl *jack;
3462 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
3463 snd_hda_apply_pincfgs(codec, dell_9205_m43_pin_configs);
3465 /* Enable unsol response for GPIO4/Dock HP connection */
3466 snd_hda_codec_write_cache(codec, codec->afg, 0,
3467 AC_VERB_SET_GPIO_UNSOLICITED_RSP_MASK, 0x10);
3468 snd_hda_jack_detect_enable_callback(codec, codec->afg,
3471 jack = snd_hda_jack_tbl_get(codec, codec->afg);
3473 jack->private_data = 0x01;
3475 spec->gpio_dir = 0x0b;
3476 spec->eapd_mask = 0x01;
3477 spec->gpio_mask = 0x1b;
3478 spec->gpio_mute = 0x10;
3479 /* GPIO0 High = EAPD, GPIO1 Low = Headphone Mute,
3482 spec->gpio_data = 0x01;
3486 static void stac9205_fixup_eapd(struct hda_codec *codec,
3487 const struct hda_fixup *fix, int action)
3489 struct sigmatel_spec *spec = codec->spec;
3491 if (action == HDA_FIXUP_ACT_PRE_PROBE)
3492 spec->eapd_switch = 0;
3495 static const struct hda_fixup stac9205_fixups[] = {
3497 .type = HDA_FIXUP_FUNC,
3498 .v.func = stac9205_fixup_ref,
3500 [STAC_9205_DELL_M42] = {
3501 .type = HDA_FIXUP_PINS,
3502 .v.pins = dell_9205_m42_pin_configs,
3504 [STAC_9205_DELL_M43] = {
3505 .type = HDA_FIXUP_FUNC,
3506 .v.func = stac9205_fixup_dell_m43,
3508 [STAC_9205_DELL_M44] = {
3509 .type = HDA_FIXUP_PINS,
3510 .v.pins = dell_9205_m44_pin_configs,
3512 [STAC_9205_EAPD] = {
3513 .type = HDA_FIXUP_FUNC,
3514 .v.func = stac9205_fixup_eapd,
3519 static const struct hda_model_fixup stac9205_models[] = {
3520 { .id = STAC_9205_REF, .name = "ref" },
3521 { .id = STAC_9205_DELL_M42, .name = "dell-m42" },
3522 { .id = STAC_9205_DELL_M43, .name = "dell-m43" },
3523 { .id = STAC_9205_DELL_M44, .name = "dell-m44" },
3524 { .id = STAC_9205_EAPD, .name = "eapd" },
3528 static const struct snd_pci_quirk stac9205_fixup_tbl[] = {
3529 /* SigmaTel reference board */
3530 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2668,
3531 "DFI LanParty", STAC_9205_REF),
3532 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0xfb30,
3533 "SigmaTel", STAC_9205_REF),
3534 SND_PCI_QUIRK(PCI_VENDOR_ID_DFI, 0x3101,
3535 "DFI LanParty", STAC_9205_REF),
3537 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01f1,
3538 "unknown Dell", STAC_9205_DELL_M42),
3539 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01f2,
3540 "unknown Dell", STAC_9205_DELL_M42),
3541 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01f8,
3542 "Dell Precision", STAC_9205_DELL_M43),
3543 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01f9,
3544 "Dell Precision", STAC_9205_DELL_M43),
3545 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01fa,
3546 "Dell Precision", STAC_9205_DELL_M43),
3547 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01fc,
3548 "unknown Dell", STAC_9205_DELL_M42),
3549 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01fd,
3550 "unknown Dell", STAC_9205_DELL_M42),
3551 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01fe,
3552 "Dell Precision", STAC_9205_DELL_M43),
3553 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01ff,
3554 "Dell Precision M4300", STAC_9205_DELL_M43),
3555 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0204,
3556 "unknown Dell", STAC_9205_DELL_M42),
3557 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0206,
3558 "Dell Precision", STAC_9205_DELL_M43),
3559 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x021b,
3560 "Dell Precision", STAC_9205_DELL_M43),
3561 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x021c,
3562 "Dell Precision", STAC_9205_DELL_M43),
3563 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x021f,
3564 "Dell Inspiron", STAC_9205_DELL_M44),
3565 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0228,
3566 "Dell Vostro 1500", STAC_9205_DELL_M42),
3567 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0229,
3568 "Dell Vostro 1700", STAC_9205_DELL_M42),
3570 SND_PCI_QUIRK(0x107b, 0x0560, "Gateway T6834c", STAC_9205_EAPD),
3571 SND_PCI_QUIRK(0x107b, 0x0565, "Gateway T1616", STAC_9205_EAPD),
3575 static int stac_parse_auto_config(struct hda_codec *codec)
3577 struct sigmatel_spec *spec = codec->spec;
3581 if (spec->headset_jack)
3582 flags |= HDA_PINCFG_HEADSET_MIC;
3584 err = snd_hda_parse_pin_defcfg(codec, &spec->gen.autocfg, NULL, flags);
3589 spec->gen.pcm_playback_hook = stac_playback_pcm_hook;
3590 spec->gen.pcm_capture_hook = stac_capture_pcm_hook;
3592 spec->gen.automute_hook = stac_update_outputs;
3593 spec->gen.hp_automute_hook = stac_hp_automute;
3594 spec->gen.line_automute_hook = stac_line_automute;
3595 spec->gen.mic_autoswitch_hook = stac_mic_autoswitch;
3597 err = snd_hda_gen_parse_auto_config(codec, &spec->gen.autocfg);
3601 /* minimum value is actually mute */
3602 spec->gen.vmaster_tlv[3] |= TLV_DB_SCALE_MUTE;
3604 /* setup analog beep controls */
3605 if (spec->anabeep_nid > 0) {
3606 err = stac_auto_create_beep_ctls(codec,
3612 /* setup digital beep controls and input device */
3613 #ifdef CONFIG_SND_HDA_INPUT_BEEP
3614 if (spec->gen.beep_nid) {
3615 hda_nid_t nid = spec->gen.beep_nid;
3618 err = stac_auto_create_beep_ctls(codec, nid);
3622 /* IDT/STAC codecs have linear beep tone parameter */
3623 codec->beep->linear_tone = spec->linear_tone_beep;
3624 /* if no beep switch is available, make its own one */
3625 caps = query_amp_caps(codec, nid, HDA_OUTPUT);
3626 if (!(caps & AC_AMPCAP_MUTE)) {
3627 err = stac_beep_switch_ctl(codec);
3636 spec->gen.vmaster_mute.hook = stac_vmaster_hook;
3638 if (spec->aloopback_ctl &&
3639 snd_hda_get_bool_hint(codec, "loopback") == 1) {
3640 if (!snd_hda_gen_add_kctl(&spec->gen, NULL, spec->aloopback_ctl))
3644 if (spec->have_spdif_mux) {
3645 err = stac_create_spdif_mux_ctls(codec);
3653 static int stac_build_controls(struct hda_codec *codec)
3655 int err = snd_hda_gen_build_controls(codec);
3659 stac_init_power_map(codec);
3663 static int stac_init(struct hda_codec *codec)
3665 struct sigmatel_spec *spec = codec->spec;
3668 /* override some hints */
3669 stac_store_hints(codec);
3672 /* turn on EAPD statically when spec->eapd_switch isn't set.
3673 * otherwise, unsol event will turn it on/off dynamically
3675 if (!spec->eapd_switch)
3676 spec->gpio_data |= spec->eapd_mask;
3677 stac_gpio_set(codec, spec->gpio_mask, spec->gpio_dir, spec->gpio_data);
3679 snd_hda_gen_init(codec);
3681 /* sync the power-map */
3683 snd_hda_codec_write(codec, codec->afg, 0,
3684 AC_VERB_IDT_SET_POWER_MAP,
3685 spec->power_map_bits);
3687 /* power down inactive ADCs */
3688 if (spec->powerdown_adcs) {
3689 for (i = 0; i < spec->gen.num_all_adcs; i++) {
3690 if (spec->active_adcs & (1 << i))
3692 snd_hda_codec_write(codec, spec->gen.all_adcs[i], 0,
3693 AC_VERB_SET_POWER_STATE,
3701 static void stac_shutup(struct hda_codec *codec)
3703 struct sigmatel_spec *spec = codec->spec;
3705 snd_hda_shutup_pins(codec);
3707 if (spec->eapd_mask)
3708 stac_gpio_set(codec, spec->gpio_mask,
3709 spec->gpio_dir, spec->gpio_data &
3713 #define stac_free snd_hda_gen_free
3715 #ifdef CONFIG_PROC_FS
3716 static void stac92hd_proc_hook(struct snd_info_buffer *buffer,
3717 struct hda_codec *codec, hda_nid_t nid)
3719 if (nid == codec->afg)
3720 snd_iprintf(buffer, "Power-Map: 0x%02x\n",
3721 snd_hda_codec_read(codec, nid, 0,
3722 AC_VERB_IDT_GET_POWER_MAP, 0));
3725 static void analog_loop_proc_hook(struct snd_info_buffer *buffer,
3726 struct hda_codec *codec,
3729 snd_iprintf(buffer, "Analog Loopback: 0x%02x\n",
3730 snd_hda_codec_read(codec, codec->afg, 0, verb, 0));
3733 /* stac92hd71bxx, stac92hd73xx */
3734 static void stac92hd7x_proc_hook(struct snd_info_buffer *buffer,
3735 struct hda_codec *codec, hda_nid_t nid)
3737 stac92hd_proc_hook(buffer, codec, nid);
3738 if (nid == codec->afg)
3739 analog_loop_proc_hook(buffer, codec, 0xfa0);
3742 static void stac9205_proc_hook(struct snd_info_buffer *buffer,
3743 struct hda_codec *codec, hda_nid_t nid)
3745 if (nid == codec->afg)
3746 analog_loop_proc_hook(buffer, codec, 0xfe0);
3749 static void stac927x_proc_hook(struct snd_info_buffer *buffer,
3750 struct hda_codec *codec, hda_nid_t nid)
3752 if (nid == codec->afg)
3753 analog_loop_proc_hook(buffer, codec, 0xfeb);
3756 #define stac92hd_proc_hook NULL
3757 #define stac92hd7x_proc_hook NULL
3758 #define stac9205_proc_hook NULL
3759 #define stac927x_proc_hook NULL
3763 static int stac_resume(struct hda_codec *codec)
3765 codec->patch_ops.init(codec);
3766 snd_hda_codec_resume_amp(codec);
3767 snd_hda_codec_resume_cache(codec);
3771 static int stac_suspend(struct hda_codec *codec)
3777 static void stac_set_power_state(struct hda_codec *codec, hda_nid_t fg,
3778 unsigned int power_state)
3780 unsigned int afg_power_state = power_state;
3781 struct sigmatel_spec *spec = codec->spec;
3783 if (power_state == AC_PWRST_D3) {
3784 if (spec->vref_mute_led_nid) {
3785 /* with vref-out pin used for mute led control
3786 * codec AFG is prevented from D3 state
3788 afg_power_state = AC_PWRST_D1;
3790 /* this delay seems necessary to avoid click noise at power-down */
3793 snd_hda_codec_read(codec, fg, 0, AC_VERB_SET_POWER_STATE,
3795 snd_hda_codec_set_power_to_all(codec, fg, power_state);
3798 #define stac_suspend NULL
3799 #define stac_resume NULL
3800 #define stac_set_power_state NULL
3801 #endif /* CONFIG_PM */
3803 static const struct hda_codec_ops stac_patch_ops = {
3804 .build_controls = stac_build_controls,
3805 .build_pcms = snd_hda_gen_build_pcms,
3808 .unsol_event = snd_hda_jack_unsol_event,
3810 .suspend = stac_suspend,
3811 .resume = stac_resume,
3813 .reboot_notify = stac_shutup,
3816 static int alloc_stac_spec(struct hda_codec *codec)
3818 struct sigmatel_spec *spec;
3820 spec = kzalloc(sizeof(*spec), GFP_KERNEL);
3823 snd_hda_gen_spec_init(&spec->gen);
3825 codec->no_trigger_sense = 1; /* seems common with STAC/IDT codecs */
3829 static int patch_stac9200(struct hda_codec *codec)
3831 struct sigmatel_spec *spec;
3834 err = alloc_stac_spec(codec);
3839 spec->linear_tone_beep = 1;
3840 spec->gen.own_eapd_ctl = 1;
3842 codec->patch_ops = stac_patch_ops;
3843 codec->power_filter = snd_hda_codec_eapd_power_filter;
3845 snd_hda_add_verbs(codec, stac9200_eapd_init);
3847 snd_hda_pick_fixup(codec, stac9200_models, stac9200_fixup_tbl,
3849 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
3851 err = stac_parse_auto_config(codec);
3857 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
3862 static int patch_stac925x(struct hda_codec *codec)
3864 struct sigmatel_spec *spec;
3867 err = alloc_stac_spec(codec);
3872 spec->linear_tone_beep = 1;
3873 spec->gen.own_eapd_ctl = 1;
3875 codec->patch_ops = stac_patch_ops;
3877 snd_hda_add_verbs(codec, stac925x_core_init);
3879 snd_hda_pick_fixup(codec, stac925x_models, stac925x_fixup_tbl,
3881 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
3883 err = stac_parse_auto_config(codec);
3889 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
3894 static int patch_stac92hd73xx(struct hda_codec *codec)
3896 struct sigmatel_spec *spec;
3900 err = alloc_stac_spec(codec);
3905 spec->linear_tone_beep = 0;
3906 spec->gen.mixer_nid = 0x1d;
3907 spec->have_spdif_mux = 1;
3909 num_dacs = snd_hda_get_num_conns(codec, 0x0a) - 1;
3910 if (num_dacs < 3 || num_dacs > 5) {
3911 printk(KERN_WARNING "hda_codec: Could not determine "
3912 "number of channels defaulting to DAC count\n");
3917 case 0x3: /* 6 Channel */
3918 spec->aloopback_ctl = &stac92hd73xx_6ch_loopback;
3920 case 0x4: /* 8 Channel */
3921 spec->aloopback_ctl = &stac92hd73xx_8ch_loopback;
3923 case 0x5: /* 10 Channel */
3924 spec->aloopback_ctl = &stac92hd73xx_10ch_loopback;
3928 spec->aloopback_mask = 0x01;
3929 spec->aloopback_shift = 8;
3931 spec->gen.beep_nid = 0x1c; /* digital beep */
3933 /* GPIO0 High = Enable EAPD */
3934 spec->eapd_mask = spec->gpio_mask = spec->gpio_dir = 0x1;
3935 spec->gpio_data = 0x01;
3937 spec->eapd_switch = 1;
3939 spec->num_pwrs = ARRAY_SIZE(stac92hd73xx_pwr_nids);
3940 spec->pwr_nids = stac92hd73xx_pwr_nids;
3942 spec->gen.own_eapd_ctl = 1;
3943 spec->gen.power_down_unused = 1;
3945 codec->patch_ops = stac_patch_ops;
3947 snd_hda_pick_fixup(codec, stac92hd73xx_models, stac92hd73xx_fixup_tbl,
3948 stac92hd73xx_fixups);
3949 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
3951 if (!spec->volknob_init)
3952 snd_hda_add_verbs(codec, stac92hd73xx_core_init);
3954 err = stac_parse_auto_config(codec);
3960 /* Don't GPIO-mute speakers if there are no internal speakers, because
3961 * the GPIO might be necessary for Headphone
3963 if (spec->eapd_switch && !has_builtin_speaker(codec))
3964 spec->eapd_switch = 0;
3966 codec->proc_widget_hook = stac92hd7x_proc_hook;
3968 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
3973 static void stac_setup_gpio(struct hda_codec *codec)
3975 struct sigmatel_spec *spec = codec->spec;
3977 spec->gpio_mask |= spec->eapd_mask;
3978 if (spec->gpio_led) {
3979 if (!spec->vref_mute_led_nid) {
3980 spec->gpio_mask |= spec->gpio_led;
3981 spec->gpio_dir |= spec->gpio_led;
3982 spec->gpio_data |= spec->gpio_led;
3984 codec->patch_ops.set_power_state =
3985 stac_set_power_state;
3989 if (spec->mic_mute_led_gpio) {
3990 spec->gpio_mask |= spec->mic_mute_led_gpio;
3991 spec->gpio_dir |= spec->mic_mute_led_gpio;
3992 spec->mic_mute_led_on = true;
3993 spec->gpio_data |= spec->mic_mute_led_gpio;
3995 spec->gen.cap_sync_hook = stac_capture_led_hook;
3999 static int patch_stac92hd83xxx(struct hda_codec *codec)
4001 struct sigmatel_spec *spec;
4004 err = alloc_stac_spec(codec);
4008 codec->epss = 0; /* longer delay needed for D3 */
4011 spec->linear_tone_beep = 0;
4012 spec->gen.own_eapd_ctl = 1;
4013 spec->gen.power_down_unused = 1;
4014 spec->gen.mixer_nid = 0x1b;
4016 spec->gen.beep_nid = 0x21; /* digital beep */
4017 spec->pwr_nids = stac92hd83xxx_pwr_nids;
4018 spec->num_pwrs = ARRAY_SIZE(stac92hd83xxx_pwr_nids);
4019 spec->default_polarity = -1; /* no default cfg */
4021 codec->patch_ops = stac_patch_ops;
4023 snd_hda_add_verbs(codec, stac92hd83xxx_core_init);
4025 snd_hda_pick_fixup(codec, stac92hd83xxx_models, stac92hd83xxx_fixup_tbl,
4026 stac92hd83xxx_fixups);
4027 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
4029 stac_setup_gpio(codec);
4031 err = stac_parse_auto_config(codec);
4037 codec->proc_widget_hook = stac92hd_proc_hook;
4039 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
4044 static const hda_nid_t stac92hd95_pwr_nids[] = {
4045 0x0a, 0x0b, 0x0c, 0x0d
4048 static int patch_stac92hd95(struct hda_codec *codec)
4050 struct sigmatel_spec *spec;
4053 err = alloc_stac_spec(codec);
4057 codec->epss = 0; /* longer delay needed for D3 */
4060 spec->linear_tone_beep = 0;
4061 spec->gen.own_eapd_ctl = 1;
4062 spec->gen.power_down_unused = 1;
4064 spec->gen.beep_nid = 0x19; /* digital beep */
4065 spec->pwr_nids = stac92hd95_pwr_nids;
4066 spec->num_pwrs = ARRAY_SIZE(stac92hd95_pwr_nids);
4067 spec->default_polarity = -1; /* no default cfg */
4069 codec->patch_ops = stac_patch_ops;
4071 err = stac_parse_auto_config(codec);
4077 codec->proc_widget_hook = stac92hd_proc_hook;
4082 static int patch_stac92hd71bxx(struct hda_codec *codec)
4084 struct sigmatel_spec *spec;
4085 const struct hda_verb *unmute_init = stac92hd71bxx_unmute_core_init;
4088 err = alloc_stac_spec(codec);
4093 spec->linear_tone_beep = 0;
4094 spec->gen.own_eapd_ctl = 1;
4095 spec->gen.power_down_unused = 1;
4096 spec->gen.mixer_nid = 0x17;
4097 spec->have_spdif_mux = 1;
4099 codec->patch_ops = stac_patch_ops;
4102 spec->gpio_mask = 0x01;
4103 spec->gpio_dir = 0x01;
4104 spec->gpio_data = 0x01;
4106 switch (codec->vendor_id) {
4107 case 0x111d76b6: /* 4 Port without Analog Mixer */
4111 case 0x111d7608: /* 5 Port with Analog Mixer */
4112 if ((codec->revision_id & 0xf) == 0 ||
4113 (codec->revision_id & 0xf) == 1)
4114 spec->stream_delay = 40; /* 40 milliseconds */
4118 snd_hda_codec_set_pincfg(codec, 0x0f, 0x40f000f0);
4119 snd_hda_codec_set_pincfg(codec, 0x19, 0x40f000f3);
4121 case 0x111d7603: /* 6 Port with Analog Mixer */
4122 if ((codec->revision_id & 0xf) == 1)
4123 spec->stream_delay = 40; /* 40 milliseconds */
4128 if (get_wcaps_type(get_wcaps(codec, 0x28)) == AC_WID_VOL_KNB)
4129 snd_hda_add_verbs(codec, stac92hd71bxx_core_init);
4131 if (get_wcaps(codec, 0xa) & AC_WCAP_IN_AMP)
4132 snd_hda_sequence_write_cache(codec, unmute_init);
4134 spec->aloopback_ctl = &stac92hd71bxx_loopback;
4135 spec->aloopback_mask = 0x50;
4136 spec->aloopback_shift = 0;
4138 spec->powerdown_adcs = 1;
4139 spec->gen.beep_nid = 0x26; /* digital beep */
4140 spec->num_pwrs = ARRAY_SIZE(stac92hd71bxx_pwr_nids);
4141 spec->pwr_nids = stac92hd71bxx_pwr_nids;
4143 snd_hda_pick_fixup(codec, stac92hd71bxx_models, stac92hd71bxx_fixup_tbl,
4144 stac92hd71bxx_fixups);
4145 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
4147 stac_setup_gpio(codec);
4149 err = stac_parse_auto_config(codec);
4155 codec->proc_widget_hook = stac92hd7x_proc_hook;
4157 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
4162 static int patch_stac922x(struct hda_codec *codec)
4164 struct sigmatel_spec *spec;
4167 err = alloc_stac_spec(codec);
4172 spec->linear_tone_beep = 1;
4173 spec->gen.own_eapd_ctl = 1;
4175 codec->patch_ops = stac_patch_ops;
4177 snd_hda_add_verbs(codec, stac922x_core_init);
4179 /* Fix Mux capture level; max to 2 */
4180 snd_hda_override_amp_caps(codec, 0x12, HDA_OUTPUT,
4181 (0 << AC_AMPCAP_OFFSET_SHIFT) |
4182 (2 << AC_AMPCAP_NUM_STEPS_SHIFT) |
4183 (0x27 << AC_AMPCAP_STEP_SIZE_SHIFT) |
4184 (0 << AC_AMPCAP_MUTE_SHIFT));
4186 snd_hda_pick_fixup(codec, stac922x_models, stac922x_fixup_tbl,
4188 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
4190 err = stac_parse_auto_config(codec);
4196 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
4201 static const char * const stac927x_spdif_labels[] = {
4202 "Digital Playback", "ADAT", "Analog Mux 1",
4203 "Analog Mux 2", "Analog Mux 3", NULL
4206 static int patch_stac927x(struct hda_codec *codec)
4208 struct sigmatel_spec *spec;
4211 err = alloc_stac_spec(codec);
4216 spec->linear_tone_beep = 1;
4217 spec->gen.own_eapd_ctl = 1;
4218 spec->have_spdif_mux = 1;
4219 spec->spdif_labels = stac927x_spdif_labels;
4221 spec->gen.beep_nid = 0x23; /* digital beep */
4223 /* GPIO0 High = Enable EAPD */
4224 spec->eapd_mask = spec->gpio_mask = 0x01;
4225 spec->gpio_dir = spec->gpio_data = 0x01;
4227 spec->aloopback_ctl = &stac927x_loopback;
4228 spec->aloopback_mask = 0x40;
4229 spec->aloopback_shift = 0;
4230 spec->eapd_switch = 1;
4232 codec->patch_ops = stac_patch_ops;
4234 snd_hda_pick_fixup(codec, stac927x_models, stac927x_fixup_tbl,
4236 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
4238 if (!spec->volknob_init)
4239 snd_hda_add_verbs(codec, stac927x_core_init);
4241 err = stac_parse_auto_config(codec);
4247 codec->proc_widget_hook = stac927x_proc_hook;
4251 * The STAC927x seem to require fairly long delays for certain
4252 * command sequences. With too short delays (even if the answer
4253 * is set to RIRB properly), it results in the silence output
4254 * on some hardwares like Dell.
4256 * The below flag enables the longer delay (see get_response
4259 codec->bus->needs_damn_long_delay = 1;
4261 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
4266 static int patch_stac9205(struct hda_codec *codec)
4268 struct sigmatel_spec *spec;
4271 err = alloc_stac_spec(codec);
4276 spec->linear_tone_beep = 1;
4277 spec->gen.own_eapd_ctl = 1;
4278 spec->have_spdif_mux = 1;
4280 spec->gen.beep_nid = 0x23; /* digital beep */
4282 snd_hda_add_verbs(codec, stac9205_core_init);
4283 spec->aloopback_ctl = &stac9205_loopback;
4285 spec->aloopback_mask = 0x40;
4286 spec->aloopback_shift = 0;
4288 /* GPIO0 High = EAPD */
4289 spec->eapd_mask = spec->gpio_mask = spec->gpio_dir = 0x1;
4290 spec->gpio_data = 0x01;
4292 /* Turn on/off EAPD per HP plugging */
4293 spec->eapd_switch = 1;
4295 codec->patch_ops = stac_patch_ops;
4297 snd_hda_pick_fixup(codec, stac9205_models, stac9205_fixup_tbl,
4299 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
4301 err = stac_parse_auto_config(codec);
4307 codec->proc_widget_hook = stac9205_proc_hook;
4309 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
4318 static const struct hda_verb stac9872_core_init[] = {
4319 {0x15, AC_VERB_SET_CONNECT_SEL, 0x1}, /* mic-sel: 0a,0d,14,02 */
4320 {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, /* Mic-in -> 0x9 */
4324 static const struct hda_pintbl stac9872_vaio_pin_configs[] = {
4325 { 0x0a, 0x03211020 },
4326 { 0x0b, 0x411111f0 },
4327 { 0x0c, 0x411111f0 },
4328 { 0x0d, 0x03a15030 },
4329 { 0x0e, 0x411111f0 },
4330 { 0x0f, 0x90170110 },
4331 { 0x11, 0x411111f0 },
4332 { 0x13, 0x411111f0 },
4333 { 0x14, 0x90a7013e },
4337 static const struct hda_model_fixup stac9872_models[] = {
4338 { .id = STAC_9872_VAIO, .name = "vaio" },
4342 static const struct hda_fixup stac9872_fixups[] = {
4343 [STAC_9872_VAIO] = {
4344 .type = HDA_FIXUP_PINS,
4345 .v.pins = stac9872_vaio_pin_configs,
4349 static const struct snd_pci_quirk stac9872_fixup_tbl[] = {
4350 SND_PCI_QUIRK_MASK(0x104d, 0xfff0, 0x81e0,
4351 "Sony VAIO F/S", STAC_9872_VAIO),
4355 static int patch_stac9872(struct hda_codec *codec)
4357 struct sigmatel_spec *spec;
4360 err = alloc_stac_spec(codec);
4365 spec->linear_tone_beep = 1;
4366 spec->gen.own_eapd_ctl = 1;
4368 codec->patch_ops = stac_patch_ops;
4370 snd_hda_add_verbs(codec, stac9872_core_init);
4372 snd_hda_pick_fixup(codec, stac9872_models, stac9872_fixup_tbl,
4374 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
4376 err = stac_parse_auto_config(codec);
4382 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
4391 static const struct hda_codec_preset snd_hda_preset_sigmatel[] = {
4392 { .id = 0x83847690, .name = "STAC9200", .patch = patch_stac9200 },
4393 { .id = 0x83847882, .name = "STAC9220 A1", .patch = patch_stac922x },
4394 { .id = 0x83847680, .name = "STAC9221 A1", .patch = patch_stac922x },
4395 { .id = 0x83847880, .name = "STAC9220 A2", .patch = patch_stac922x },
4396 { .id = 0x83847681, .name = "STAC9220D/9223D A2", .patch = patch_stac922x },
4397 { .id = 0x83847682, .name = "STAC9221 A2", .patch = patch_stac922x },
4398 { .id = 0x83847683, .name = "STAC9221D A2", .patch = patch_stac922x },
4399 { .id = 0x83847618, .name = "STAC9227", .patch = patch_stac927x },
4400 { .id = 0x83847619, .name = "STAC9227", .patch = patch_stac927x },
4401 { .id = 0x83847616, .name = "STAC9228", .patch = patch_stac927x },
4402 { .id = 0x83847617, .name = "STAC9228", .patch = patch_stac927x },
4403 { .id = 0x83847614, .name = "STAC9229", .patch = patch_stac927x },
4404 { .id = 0x83847615, .name = "STAC9229", .patch = patch_stac927x },
4405 { .id = 0x83847620, .name = "STAC9274", .patch = patch_stac927x },
4406 { .id = 0x83847621, .name = "STAC9274D", .patch = patch_stac927x },
4407 { .id = 0x83847622, .name = "STAC9273X", .patch = patch_stac927x },
4408 { .id = 0x83847623, .name = "STAC9273D", .patch = patch_stac927x },
4409 { .id = 0x83847624, .name = "STAC9272X", .patch = patch_stac927x },
4410 { .id = 0x83847625, .name = "STAC9272D", .patch = patch_stac927x },
4411 { .id = 0x83847626, .name = "STAC9271X", .patch = patch_stac927x },
4412 { .id = 0x83847627, .name = "STAC9271D", .patch = patch_stac927x },
4413 { .id = 0x83847628, .name = "STAC9274X5NH", .patch = patch_stac927x },
4414 { .id = 0x83847629, .name = "STAC9274D5NH", .patch = patch_stac927x },
4415 { .id = 0x83847632, .name = "STAC9202", .patch = patch_stac925x },
4416 { .id = 0x83847633, .name = "STAC9202D", .patch = patch_stac925x },
4417 { .id = 0x83847634, .name = "STAC9250", .patch = patch_stac925x },
4418 { .id = 0x83847635, .name = "STAC9250D", .patch = patch_stac925x },
4419 { .id = 0x83847636, .name = "STAC9251", .patch = patch_stac925x },
4420 { .id = 0x83847637, .name = "STAC9250D", .patch = patch_stac925x },
4421 { .id = 0x83847645, .name = "92HD206X", .patch = patch_stac927x },
4422 { .id = 0x83847646, .name = "92HD206D", .patch = patch_stac927x },
4423 /* The following does not take into account .id=0x83847661 when subsys =
4424 * 104D0C00 which is STAC9225s. Because of this, some SZ Notebooks are
4425 * currently not fully supported.
4427 { .id = 0x83847661, .name = "CXD9872RD/K", .patch = patch_stac9872 },
4428 { .id = 0x83847662, .name = "STAC9872AK", .patch = patch_stac9872 },
4429 { .id = 0x83847664, .name = "CXD9872AKD", .patch = patch_stac9872 },
4430 { .id = 0x83847698, .name = "STAC9205", .patch = patch_stac9205 },
4431 { .id = 0x838476a0, .name = "STAC9205", .patch = patch_stac9205 },
4432 { .id = 0x838476a1, .name = "STAC9205D", .patch = patch_stac9205 },
4433 { .id = 0x838476a2, .name = "STAC9204", .patch = patch_stac9205 },
4434 { .id = 0x838476a3, .name = "STAC9204D", .patch = patch_stac9205 },
4435 { .id = 0x838476a4, .name = "STAC9255", .patch = patch_stac9205 },
4436 { .id = 0x838476a5, .name = "STAC9255D", .patch = patch_stac9205 },
4437 { .id = 0x838476a6, .name = "STAC9254", .patch = patch_stac9205 },
4438 { .id = 0x838476a7, .name = "STAC9254D", .patch = patch_stac9205 },
4439 { .id = 0x111d7603, .name = "92HD75B3X5", .patch = patch_stac92hd71bxx},
4440 { .id = 0x111d7604, .name = "92HD83C1X5", .patch = patch_stac92hd83xxx},
4441 { .id = 0x111d76d4, .name = "92HD83C1C5", .patch = patch_stac92hd83xxx},
4442 { .id = 0x111d7605, .name = "92HD81B1X5", .patch = patch_stac92hd83xxx},
4443 { .id = 0x111d76d5, .name = "92HD81B1C5", .patch = patch_stac92hd83xxx},
4444 { .id = 0x111d76d1, .name = "92HD87B1/3", .patch = patch_stac92hd83xxx},
4445 { .id = 0x111d76d9, .name = "92HD87B2/4", .patch = patch_stac92hd83xxx},
4446 { .id = 0x111d7666, .name = "92HD88B3", .patch = patch_stac92hd83xxx},
4447 { .id = 0x111d7667, .name = "92HD88B1", .patch = patch_stac92hd83xxx},
4448 { .id = 0x111d7668, .name = "92HD88B2", .patch = patch_stac92hd83xxx},
4449 { .id = 0x111d7669, .name = "92HD88B4", .patch = patch_stac92hd83xxx},
4450 { .id = 0x111d7608, .name = "92HD75B2X5", .patch = patch_stac92hd71bxx},
4451 { .id = 0x111d7674, .name = "92HD73D1X5", .patch = patch_stac92hd73xx },
4452 { .id = 0x111d7675, .name = "92HD73C1X5", .patch = patch_stac92hd73xx },
4453 { .id = 0x111d7676, .name = "92HD73E1X5", .patch = patch_stac92hd73xx },
4454 { .id = 0x111d7695, .name = "92HD95", .patch = patch_stac92hd95 },
4455 { .id = 0x111d76b0, .name = "92HD71B8X", .patch = patch_stac92hd71bxx },
4456 { .id = 0x111d76b1, .name = "92HD71B8X", .patch = patch_stac92hd71bxx },
4457 { .id = 0x111d76b2, .name = "92HD71B7X", .patch = patch_stac92hd71bxx },
4458 { .id = 0x111d76b3, .name = "92HD71B7X", .patch = patch_stac92hd71bxx },
4459 { .id = 0x111d76b4, .name = "92HD71B6X", .patch = patch_stac92hd71bxx },
4460 { .id = 0x111d76b5, .name = "92HD71B6X", .patch = patch_stac92hd71bxx },
4461 { .id = 0x111d76b6, .name = "92HD71B5X", .patch = patch_stac92hd71bxx },
4462 { .id = 0x111d76b7, .name = "92HD71B5X", .patch = patch_stac92hd71bxx },
4463 { .id = 0x111d76c0, .name = "92HD89C3", .patch = patch_stac92hd73xx },
4464 { .id = 0x111d76c1, .name = "92HD89C2", .patch = patch_stac92hd73xx },
4465 { .id = 0x111d76c2, .name = "92HD89C1", .patch = patch_stac92hd73xx },
4466 { .id = 0x111d76c3, .name = "92HD89B3", .patch = patch_stac92hd73xx },
4467 { .id = 0x111d76c4, .name = "92HD89B2", .patch = patch_stac92hd73xx },
4468 { .id = 0x111d76c5, .name = "92HD89B1", .patch = patch_stac92hd73xx },
4469 { .id = 0x111d76c6, .name = "92HD89E3", .patch = patch_stac92hd73xx },
4470 { .id = 0x111d76c7, .name = "92HD89E2", .patch = patch_stac92hd73xx },
4471 { .id = 0x111d76c8, .name = "92HD89E1", .patch = patch_stac92hd73xx },
4472 { .id = 0x111d76c9, .name = "92HD89D3", .patch = patch_stac92hd73xx },
4473 { .id = 0x111d76ca, .name = "92HD89D2", .patch = patch_stac92hd73xx },
4474 { .id = 0x111d76cb, .name = "92HD89D1", .patch = patch_stac92hd73xx },
4475 { .id = 0x111d76cc, .name = "92HD89F3", .patch = patch_stac92hd73xx },
4476 { .id = 0x111d76cd, .name = "92HD89F2", .patch = patch_stac92hd73xx },
4477 { .id = 0x111d76ce, .name = "92HD89F1", .patch = patch_stac92hd73xx },
4478 { .id = 0x111d76df, .name = "92HD93BXX", .patch = patch_stac92hd83xxx},
4479 { .id = 0x111d76e0, .name = "92HD91BXX", .patch = patch_stac92hd83xxx},
4480 { .id = 0x111d76e3, .name = "92HD98BXX", .patch = patch_stac92hd83xxx},
4481 { .id = 0x111d76e5, .name = "92HD99BXX", .patch = patch_stac92hd83xxx},
4482 { .id = 0x111d76e7, .name = "92HD90BXX", .patch = patch_stac92hd83xxx},
4483 { .id = 0x111d76e8, .name = "92HD66B1X5", .patch = patch_stac92hd83xxx},
4484 { .id = 0x111d76e9, .name = "92HD66B2X5", .patch = patch_stac92hd83xxx},
4485 { .id = 0x111d76ea, .name = "92HD66B3X5", .patch = patch_stac92hd83xxx},
4486 { .id = 0x111d76eb, .name = "92HD66C1X5", .patch = patch_stac92hd83xxx},
4487 { .id = 0x111d76ec, .name = "92HD66C2X5", .patch = patch_stac92hd83xxx},
4488 { .id = 0x111d76ed, .name = "92HD66C3X5", .patch = patch_stac92hd83xxx},
4489 { .id = 0x111d76ee, .name = "92HD66B1X3", .patch = patch_stac92hd83xxx},
4490 { .id = 0x111d76ef, .name = "92HD66B2X3", .patch = patch_stac92hd83xxx},
4491 { .id = 0x111d76f0, .name = "92HD66B3X3", .patch = patch_stac92hd83xxx},
4492 { .id = 0x111d76f1, .name = "92HD66C1X3", .patch = patch_stac92hd83xxx},
4493 { .id = 0x111d76f2, .name = "92HD66C2X3", .patch = patch_stac92hd83xxx},
4494 { .id = 0x111d76f3, .name = "92HD66C3/65", .patch = patch_stac92hd83xxx},
4498 MODULE_ALIAS("snd-hda-codec-id:8384*");
4499 MODULE_ALIAS("snd-hda-codec-id:111d*");
4501 MODULE_LICENSE("GPL");
4502 MODULE_DESCRIPTION("IDT/Sigmatel HD-audio codec");
4504 static struct hda_codec_preset_list sigmatel_list = {
4505 .preset = snd_hda_preset_sigmatel,
4506 .owner = THIS_MODULE,
4509 static int __init patch_sigmatel_init(void)
4511 return snd_hda_add_codec_preset(&sigmatel_list);
4514 static void __exit patch_sigmatel_exit(void)
4516 snd_hda_delete_codec_preset(&sigmatel_list);
4519 module_init(patch_sigmatel_init)
4520 module_exit(patch_sigmatel_exit)