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 */
91 STAC_92HD83XXX_PWR_REF
,
93 STAC_DELL_VOSTRO_3500
,
94 STAC_92HD83XXX_HP_cNB11_INTQUAD
,
97 STAC_92HD83XXX_HP_LED
,
98 STAC_92HD83XXX_HP_INV_LED
,
99 STAC_92HD83XXX_HP_MIC_LED
,
100 STAC_92HD83XXX_HEADSET_JACK
,
103 STAC_92HD83XXX_MODELS
116 STAC_92HD71BXX_NO_DMIC
,
117 STAC_92HD71BXX_NO_SMUX
,
118 STAC_92HD71BXX_MODELS
148 STAC_922X_INTEL_MAC_GPIO
,
153 STAC_D965_REF_NO_JD
, /* no jack-detection */
161 STAC_DELL_BIOS_SPDIF
,
172 struct sigmatel_spec
{
173 struct hda_gen_spec gen
;
175 unsigned int eapd_switch
: 1;
176 unsigned int linear_tone_beep
:1;
177 unsigned int headset_jack
:1; /* 4-pin headset jack (hp + mono mic) */
178 unsigned int volknob_init
:1; /* special volume-knob initialization */
179 unsigned int powerdown_adcs
:1;
180 unsigned int have_spdif_mux
:1;
183 unsigned int eapd_mask
;
184 unsigned int gpio_mask
;
185 unsigned int gpio_dir
;
186 unsigned int gpio_data
;
187 unsigned int gpio_mute
;
188 unsigned int gpio_led
;
189 unsigned int gpio_led_polarity
;
190 unsigned int vref_mute_led_nid
; /* pin NID for mute-LED vref control */
191 unsigned int vref_led
;
192 int default_polarity
;
194 unsigned int mic_mute_led_gpio
; /* capture mute LED GPIO */
195 bool mic_mute_led_on
; /* current mic mute state */
198 unsigned int stream_delay
;
200 /* analog loopback */
201 const struct snd_kcontrol_new
*aloopback_ctl
;
202 unsigned int aloopback
;
203 unsigned char aloopback_mask
;
204 unsigned char aloopback_shift
;
206 /* power management */
207 unsigned int power_map_bits
;
208 unsigned int num_pwrs
;
209 const hda_nid_t
*pwr_nids
;
210 unsigned int active_adcs
;
213 hda_nid_t anabeep_nid
;
214 hda_nid_t digbeep_nid
;
217 const char * const *spdif_labels
;
218 struct hda_input_mux spdif_mux
;
219 unsigned int cur_smux
[2];
222 #define AC_VERB_IDT_SET_POWER_MAP 0x7ec
223 #define AC_VERB_IDT_GET_POWER_MAP 0xfec
225 static const hda_nid_t stac92hd73xx_pwr_nids
[8] = {
226 0x0a, 0x0b, 0x0c, 0xd, 0x0e,
230 static const hda_nid_t stac92hd83xxx_pwr_nids
[7] = {
231 0x0a, 0x0b, 0x0c, 0xd, 0x0e,
235 static const hda_nid_t stac92hd71bxx_pwr_nids
[3] = {
243 static void stac_playback_pcm_hook(struct hda_pcm_stream
*hinfo
,
244 struct hda_codec
*codec
,
245 struct snd_pcm_substream
*substream
,
248 struct sigmatel_spec
*spec
= codec
->spec
;
249 if (action
== HDA_GEN_PCM_ACT_OPEN
&& spec
->stream_delay
)
250 msleep(spec
->stream_delay
);
253 static void stac_capture_pcm_hook(struct hda_pcm_stream
*hinfo
,
254 struct hda_codec
*codec
,
255 struct snd_pcm_substream
*substream
,
258 struct sigmatel_spec
*spec
= codec
->spec
;
261 if (!spec
->powerdown_adcs
)
264 for (i
= 0; i
< spec
->gen
.num_all_adcs
; i
++) {
265 if (spec
->gen
.all_adcs
[i
] == hinfo
->nid
) {
272 case HDA_GEN_PCM_ACT_OPEN
:
274 snd_hda_codec_write(codec
, hinfo
->nid
, 0,
275 AC_VERB_SET_POWER_STATE
, AC_PWRST_D0
);
276 spec
->active_adcs
|= (1 << idx
);
278 case HDA_GEN_PCM_ACT_CLOSE
:
279 snd_hda_codec_write(codec
, hinfo
->nid
, 0,
280 AC_VERB_SET_POWER_STATE
, AC_PWRST_D3
);
281 spec
->active_adcs
&= ~(1 << idx
);
287 * Early 2006 Intel Macintoshes with STAC9220X5 codecs seem to have a
288 * funky external mute control using GPIO pins.
291 static void stac_gpio_set(struct hda_codec
*codec
, unsigned int mask
,
292 unsigned int dir_mask
, unsigned int data
)
294 unsigned int gpiostate
, gpiomask
, gpiodir
;
296 snd_printdd("%s msk %x dir %x gpio %x\n", __func__
, mask
, dir_mask
, data
);
298 gpiostate
= snd_hda_codec_read(codec
, codec
->afg
, 0,
299 AC_VERB_GET_GPIO_DATA
, 0);
300 gpiostate
= (gpiostate
& ~dir_mask
) | (data
& dir_mask
);
302 gpiomask
= snd_hda_codec_read(codec
, codec
->afg
, 0,
303 AC_VERB_GET_GPIO_MASK
, 0);
306 gpiodir
= snd_hda_codec_read(codec
, codec
->afg
, 0,
307 AC_VERB_GET_GPIO_DIRECTION
, 0);
310 /* Configure GPIOx as CMOS */
311 snd_hda_codec_write(codec
, codec
->afg
, 0, 0x7e7, 0);
313 snd_hda_codec_write(codec
, codec
->afg
, 0,
314 AC_VERB_SET_GPIO_MASK
, gpiomask
);
315 snd_hda_codec_read(codec
, codec
->afg
, 0,
316 AC_VERB_SET_GPIO_DIRECTION
, gpiodir
); /* sync */
320 snd_hda_codec_read(codec
, codec
->afg
, 0,
321 AC_VERB_SET_GPIO_DATA
, gpiostate
); /* sync */
324 /* hook for controlling mic-mute LED GPIO */
325 static void stac_capture_led_hook(struct hda_codec
*codec
,
326 struct snd_ctl_elem_value
*ucontrol
)
328 struct sigmatel_spec
*spec
= codec
->spec
;
334 mute
= !(ucontrol
->value
.integer
.value
[0] ||
335 ucontrol
->value
.integer
.value
[1]);
336 if (spec
->mic_mute_led_on
!= mute
) {
337 spec
->mic_mute_led_on
= mute
;
339 spec
->gpio_data
|= spec
->mic_mute_led_gpio
;
341 spec
->gpio_data
&= ~spec
->mic_mute_led_gpio
;
342 stac_gpio_set(codec
, spec
->gpio_mask
,
343 spec
->gpio_dir
, spec
->gpio_data
);
347 static int stac_vrefout_set(struct hda_codec
*codec
,
348 hda_nid_t nid
, unsigned int new_vref
)
352 snd_printdd("%s, nid %x ctl %x\n", __func__
, nid
, new_vref
);
353 pinctl
= snd_hda_codec_read(codec
, nid
, 0,
354 AC_VERB_GET_PIN_WIDGET_CONTROL
, 0);
360 pinctl
&= ~AC_PINCTL_VREFEN
;
361 pinctl
|= (new_vref
& AC_PINCTL_VREFEN
);
363 error
= snd_hda_set_pin_ctl_cache(codec
, nid
, pinctl
);
370 /* update mute-LED accoring to the master switch */
371 static void stac_update_led_status(struct hda_codec
*codec
, int enabled
)
373 struct sigmatel_spec
*spec
= codec
->spec
;
374 int muted
= !enabled
;
379 /* LED state is inverted on these systems */
380 if (spec
->gpio_led_polarity
)
383 if (!spec
->vref_mute_led_nid
) {
385 spec
->gpio_data
|= spec
->gpio_led
;
387 spec
->gpio_data
&= ~spec
->gpio_led
;
388 stac_gpio_set(codec
, spec
->gpio_mask
,
389 spec
->gpio_dir
, spec
->gpio_data
);
391 spec
->vref_led
= muted
? AC_PINCTL_VREF_50
: AC_PINCTL_VREF_GRD
;
392 stac_vrefout_set(codec
, spec
->vref_mute_led_nid
,
397 /* vmaster hook to update mute LED */
398 static void stac_vmaster_hook(void *private_data
, int val
)
400 stac_update_led_status(private_data
, val
);
403 /* automute hook to handle GPIO mute and EAPD updates */
404 static void stac_update_outputs(struct hda_codec
*codec
)
406 struct sigmatel_spec
*spec
= codec
->spec
;
409 spec
->gen
.master_mute
=
410 !(snd_hda_codec_read(codec
, codec
->afg
, 0,
411 AC_VERB_GET_GPIO_DATA
, 0) & spec
->gpio_mute
);
413 snd_hda_gen_update_outputs(codec
);
415 if (spec
->eapd_mask
&& spec
->eapd_switch
) {
416 unsigned int val
= spec
->gpio_data
;
417 if (spec
->gen
.speaker_muted
)
418 val
&= ~spec
->eapd_mask
;
420 val
|= spec
->eapd_mask
;
421 if (spec
->gpio_data
!= val
)
422 stac_gpio_set(codec
, spec
->gpio_mask
, spec
->gpio_dir
,
427 static void stac_toggle_power_map(struct hda_codec
*codec
, hda_nid_t nid
,
428 bool enable
, bool do_write
)
430 struct sigmatel_spec
*spec
= codec
->spec
;
431 unsigned int idx
, val
;
433 for (idx
= 0; idx
< spec
->num_pwrs
; idx
++) {
434 if (spec
->pwr_nids
[idx
] == nid
)
437 if (idx
>= spec
->num_pwrs
)
442 val
= spec
->power_map_bits
;
448 /* power down unused output ports */
449 if (val
!= spec
->power_map_bits
) {
450 spec
->power_map_bits
= val
;
452 snd_hda_codec_write(codec
, codec
->afg
, 0,
453 AC_VERB_IDT_SET_POWER_MAP
, val
);
457 /* update power bit per jack plug/unplug */
458 static void jack_update_power(struct hda_codec
*codec
,
459 struct hda_jack_tbl
*jack
)
461 struct sigmatel_spec
*spec
= codec
->spec
;
467 if (jack
&& jack
->nid
) {
468 stac_toggle_power_map(codec
, jack
->nid
,
469 snd_hda_jack_detect(codec
, jack
->nid
),
474 /* update all jacks */
475 for (i
= 0; i
< spec
->num_pwrs
; i
++) {
476 hda_nid_t nid
= spec
->pwr_nids
[i
];
477 jack
= snd_hda_jack_tbl_get(codec
, nid
);
478 if (!jack
|| !jack
->action
)
480 if (jack
->action
== STAC_PWR_EVENT
||
481 jack
->action
<= HDA_GEN_LAST_EVENT
)
482 stac_toggle_power_map(codec
, nid
,
483 snd_hda_jack_detect(codec
, nid
),
487 snd_hda_codec_write(codec
, codec
->afg
, 0, AC_VERB_IDT_SET_POWER_MAP
,
488 spec
->power_map_bits
);
491 static void stac_hp_automute(struct hda_codec
*codec
,
492 struct hda_jack_tbl
*jack
)
494 snd_hda_gen_hp_automute(codec
, jack
);
495 jack_update_power(codec
, jack
);
498 static void stac_line_automute(struct hda_codec
*codec
,
499 struct hda_jack_tbl
*jack
)
501 snd_hda_gen_line_automute(codec
, jack
);
502 jack_update_power(codec
, jack
);
505 static void stac_mic_autoswitch(struct hda_codec
*codec
,
506 struct hda_jack_tbl
*jack
)
508 snd_hda_gen_mic_autoswitch(codec
, jack
);
509 jack_update_power(codec
, jack
);
512 static void stac_vref_event(struct hda_codec
*codec
, struct hda_jack_tbl
*event
)
516 data
= snd_hda_codec_read(codec
, codec
->afg
, 0,
517 AC_VERB_GET_GPIO_DATA
, 0);
518 /* toggle VREF state based on GPIOx status */
519 snd_hda_codec_write(codec
, codec
->afg
, 0, 0x7e0,
520 !!(data
& (1 << event
->private_data
)));
523 /* initialize the power map and enable the power event to jacks that
524 * haven't been assigned to automute
526 static void stac_init_power_map(struct hda_codec
*codec
)
528 struct sigmatel_spec
*spec
= codec
->spec
;
531 for (i
= 0; i
< spec
->num_pwrs
; i
++) {
532 hda_nid_t nid
= spec
->pwr_nids
[i
];
533 unsigned int def_conf
= snd_hda_codec_get_pincfg(codec
, nid
);
534 def_conf
= get_defcfg_connect(def_conf
);
535 if (snd_hda_jack_tbl_get(codec
, nid
))
537 if (def_conf
== AC_JACK_PORT_COMPLEX
&&
538 !(spec
->vref_mute_led_nid
== nid
||
539 is_jack_detectable(codec
, nid
))) {
540 snd_hda_jack_detect_enable_callback(codec
, nid
,
544 if (def_conf
== AC_JACK_PORT_NONE
)
545 stac_toggle_power_map(codec
, nid
, false, false);
547 stac_toggle_power_map(codec
, nid
, true, false);
555 static inline bool get_int_hint(struct hda_codec
*codec
, const char *key
,
558 return !snd_hda_get_int_hint(codec
, key
, valp
);
561 /* override some hints from the hwdep entry */
562 static void stac_store_hints(struct hda_codec
*codec
)
564 struct sigmatel_spec
*spec
= codec
->spec
;
567 if (get_int_hint(codec
, "gpio_mask", &spec
->gpio_mask
)) {
568 spec
->eapd_mask
= spec
->gpio_dir
= spec
->gpio_data
=
571 if (get_int_hint(codec
, "gpio_dir", &spec
->gpio_dir
))
572 spec
->gpio_mask
&= spec
->gpio_mask
;
573 if (get_int_hint(codec
, "gpio_data", &spec
->gpio_data
))
574 spec
->gpio_dir
&= spec
->gpio_mask
;
575 if (get_int_hint(codec
, "eapd_mask", &spec
->eapd_mask
))
576 spec
->eapd_mask
&= spec
->gpio_mask
;
577 if (get_int_hint(codec
, "gpio_mute", &spec
->gpio_mute
))
578 spec
->gpio_mute
&= spec
->gpio_mask
;
579 val
= snd_hda_get_bool_hint(codec
, "eapd_switch");
581 spec
->eapd_switch
= val
;
588 #define stac_aloopback_info snd_ctl_boolean_mono_info
590 static int stac_aloopback_get(struct snd_kcontrol
*kcontrol
,
591 struct snd_ctl_elem_value
*ucontrol
)
593 struct hda_codec
*codec
= snd_kcontrol_chip(kcontrol
);
594 unsigned int idx
= snd_ctl_get_ioffidx(kcontrol
, &ucontrol
->id
);
595 struct sigmatel_spec
*spec
= codec
->spec
;
597 ucontrol
->value
.integer
.value
[0] = !!(spec
->aloopback
&
598 (spec
->aloopback_mask
<< idx
));
602 static int stac_aloopback_put(struct snd_kcontrol
*kcontrol
,
603 struct snd_ctl_elem_value
*ucontrol
)
605 struct hda_codec
*codec
= snd_kcontrol_chip(kcontrol
);
606 struct sigmatel_spec
*spec
= codec
->spec
;
607 unsigned int idx
= snd_ctl_get_ioffidx(kcontrol
, &ucontrol
->id
);
608 unsigned int dac_mode
;
609 unsigned int val
, idx_val
;
611 idx_val
= spec
->aloopback_mask
<< idx
;
612 if (ucontrol
->value
.integer
.value
[0])
613 val
= spec
->aloopback
| idx_val
;
615 val
= spec
->aloopback
& ~idx_val
;
616 if (spec
->aloopback
== val
)
619 spec
->aloopback
= val
;
621 /* Only return the bits defined by the shift value of the
622 * first two bytes of the mask
624 dac_mode
= snd_hda_codec_read(codec
, codec
->afg
, 0,
625 kcontrol
->private_value
& 0xFFFF, 0x0);
626 dac_mode
>>= spec
->aloopback_shift
;
628 if (spec
->aloopback
& idx_val
) {
629 snd_hda_power_up(codec
);
632 snd_hda_power_down(codec
);
633 dac_mode
&= ~idx_val
;
636 snd_hda_codec_write_cache(codec
, codec
->afg
, 0,
637 kcontrol
->private_value
>> 16, dac_mode
);
642 #define STAC_ANALOG_LOOPBACK(verb_read, verb_write, cnt) \
644 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \
645 .name = "Analog Loopback", \
647 .info = stac_aloopback_info, \
648 .get = stac_aloopback_get, \
649 .put = stac_aloopback_put, \
650 .private_value = verb_read | (verb_write << 16), \
654 * Mute LED handling on HP laptops
657 /* check whether it's a HP laptop with a docking port */
658 static bool hp_bnb2011_with_dock(struct hda_codec
*codec
)
660 if (codec
->vendor_id
!= 0x111d7605 &&
661 codec
->vendor_id
!= 0x111d76d1)
664 switch (codec
->subsystem_id
) {
698 static bool hp_blike_system(u32 subsystem_id
)
700 switch (subsystem_id
) {
727 static void set_hp_led_gpio(struct hda_codec
*codec
)
729 struct sigmatel_spec
*spec
= codec
->spec
;
735 gpio
= snd_hda_param_read(codec
, codec
->afg
, AC_PAR_GPIO_CAP
);
736 gpio
&= AC_GPIO_IO_COUNT
;
738 spec
->gpio_led
= 0x08; /* GPIO 3 */
740 spec
->gpio_led
= 0x01; /* GPIO 0 */
744 * This method searches for the mute LED GPIO configuration
745 * provided as OEM string in SMBIOS. The format of that string
746 * is HP_Mute_LED_P_G or HP_Mute_LED_P
747 * where P can be 0 or 1 and defines mute LED GPIO control state (low/high)
748 * that corresponds to the NOT muted state of the master volume
749 * and G is the index of the GPIO to use as the mute LED control (0..9)
750 * If _G portion is missing it is assigned based on the codec ID
752 * So, HP B-series like systems may have HP_Mute_LED_0 (current models)
753 * or HP_Mute_LED_0_3 (future models) OEM SMBIOS strings
756 * The dv-series laptops don't seem to have the HP_Mute_LED* strings in
757 * SMBIOS - at least the ones I have seen do not have them - which include
758 * my own system (HP Pavilion dv6-1110ax) and my cousin's
759 * HP Pavilion dv9500t CTO.
760 * Need more information on whether it is true across the entire series.
763 static int find_mute_led_cfg(struct hda_codec
*codec
, int default_polarity
)
765 struct sigmatel_spec
*spec
= codec
->spec
;
766 const struct dmi_device
*dev
= NULL
;
768 if (get_int_hint(codec
, "gpio_led", &spec
->gpio_led
)) {
769 get_int_hint(codec
, "gpio_led_polarity",
770 &spec
->gpio_led_polarity
);
774 while ((dev
= dmi_find_device(DMI_DEV_TYPE_OEM_STRING
, NULL
, dev
))) {
775 if (sscanf(dev
->name
, "HP_Mute_LED_%d_%x",
776 &spec
->gpio_led_polarity
,
777 &spec
->gpio_led
) == 2) {
778 unsigned int max_gpio
;
779 max_gpio
= snd_hda_param_read(codec
, codec
->afg
,
781 max_gpio
&= AC_GPIO_IO_COUNT
;
782 if (spec
->gpio_led
< max_gpio
)
783 spec
->gpio_led
= 1 << spec
->gpio_led
;
785 spec
->vref_mute_led_nid
= spec
->gpio_led
;
788 if (sscanf(dev
->name
, "HP_Mute_LED_%d",
789 &spec
->gpio_led_polarity
) == 1) {
790 set_hp_led_gpio(codec
);
793 /* BIOS bug: unfilled OEM string */
794 if (strstr(dev
->name
, "HP_Mute_LED_P_G")) {
795 set_hp_led_gpio(codec
);
796 if (default_polarity
>= 0)
797 spec
->gpio_led_polarity
= default_polarity
;
799 spec
->gpio_led_polarity
= 1;
805 * Fallback case - if we don't find the DMI strings,
806 * we statically set the GPIO - if not a B-series system
807 * and default polarity is provided
809 if (!hp_blike_system(codec
->subsystem_id
) &&
810 (default_polarity
== 0 || default_polarity
== 1)) {
811 set_hp_led_gpio(codec
);
812 spec
->gpio_led_polarity
= default_polarity
;
822 /* create PC beep volume controls */
823 static int stac_auto_create_beep_ctls(struct hda_codec
*codec
,
826 struct sigmatel_spec
*spec
= codec
->spec
;
827 u32 caps
= query_amp_caps(codec
, nid
, HDA_OUTPUT
);
828 struct snd_kcontrol_new
*knew
;
829 static struct snd_kcontrol_new abeep_mute_ctl
=
830 HDA_CODEC_MUTE(NULL
, 0, 0, 0);
831 static struct snd_kcontrol_new dbeep_mute_ctl
=
832 HDA_CODEC_MUTE_BEEP(NULL
, 0, 0, 0);
833 static struct snd_kcontrol_new beep_vol_ctl
=
834 HDA_CODEC_VOLUME(NULL
, 0, 0, 0);
836 /* check for mute support for the the amp */
837 if ((caps
& AC_AMPCAP_MUTE
) >> AC_AMPCAP_MUTE_SHIFT
) {
838 const struct snd_kcontrol_new
*temp
;
839 if (spec
->anabeep_nid
== nid
)
840 temp
= &abeep_mute_ctl
;
842 temp
= &dbeep_mute_ctl
;
843 knew
= snd_hda_gen_add_kctl(&spec
->gen
,
844 "Beep Playback Switch", temp
);
847 knew
->private_value
=
848 HDA_COMPOSE_AMP_VAL(nid
, 1, 0, HDA_OUTPUT
);
851 /* check to see if there is volume support for the amp */
852 if ((caps
& AC_AMPCAP_NUM_STEPS
) >> AC_AMPCAP_NUM_STEPS_SHIFT
) {
853 knew
= snd_hda_gen_add_kctl(&spec
->gen
,
854 "Beep Playback Volume",
858 knew
->private_value
=
859 HDA_COMPOSE_AMP_VAL(nid
, 1, 0, HDA_OUTPUT
);
864 #ifdef CONFIG_SND_HDA_INPUT_BEEP
865 #define stac_dig_beep_switch_info snd_ctl_boolean_mono_info
867 static int stac_dig_beep_switch_get(struct snd_kcontrol
*kcontrol
,
868 struct snd_ctl_elem_value
*ucontrol
)
870 struct hda_codec
*codec
= snd_kcontrol_chip(kcontrol
);
871 ucontrol
->value
.integer
.value
[0] = codec
->beep
->enabled
;
875 static int stac_dig_beep_switch_put(struct snd_kcontrol
*kcontrol
,
876 struct snd_ctl_elem_value
*ucontrol
)
878 struct hda_codec
*codec
= snd_kcontrol_chip(kcontrol
);
879 return snd_hda_enable_beep_device(codec
, ucontrol
->value
.integer
.value
[0]);
882 static const struct snd_kcontrol_new stac_dig_beep_ctrl
= {
883 .iface
= SNDRV_CTL_ELEM_IFACE_MIXER
,
884 .name
= "Beep Playback Switch",
885 .info
= stac_dig_beep_switch_info
,
886 .get
= stac_dig_beep_switch_get
,
887 .put
= stac_dig_beep_switch_put
,
890 static int stac_beep_switch_ctl(struct hda_codec
*codec
)
892 struct sigmatel_spec
*spec
= codec
->spec
;
894 if (!snd_hda_gen_add_kctl(&spec
->gen
, NULL
, &stac_dig_beep_ctrl
))
901 * SPDIF-out mux controls
904 static int stac_smux_enum_info(struct snd_kcontrol
*kcontrol
,
905 struct snd_ctl_elem_info
*uinfo
)
907 struct hda_codec
*codec
= snd_kcontrol_chip(kcontrol
);
908 struct sigmatel_spec
*spec
= codec
->spec
;
909 return snd_hda_input_mux_info(&spec
->spdif_mux
, uinfo
);
912 static int stac_smux_enum_get(struct snd_kcontrol
*kcontrol
,
913 struct snd_ctl_elem_value
*ucontrol
)
915 struct hda_codec
*codec
= snd_kcontrol_chip(kcontrol
);
916 struct sigmatel_spec
*spec
= codec
->spec
;
917 unsigned int smux_idx
= snd_ctl_get_ioffidx(kcontrol
, &ucontrol
->id
);
919 ucontrol
->value
.enumerated
.item
[0] = spec
->cur_smux
[smux_idx
];
923 static int stac_smux_enum_put(struct snd_kcontrol
*kcontrol
,
924 struct snd_ctl_elem_value
*ucontrol
)
926 struct hda_codec
*codec
= snd_kcontrol_chip(kcontrol
);
927 struct sigmatel_spec
*spec
= codec
->spec
;
928 unsigned int smux_idx
= snd_ctl_get_ioffidx(kcontrol
, &ucontrol
->id
);
930 return snd_hda_input_mux_put(codec
, &spec
->spdif_mux
, ucontrol
,
931 spec
->gen
.autocfg
.dig_out_pins
[smux_idx
],
932 &spec
->cur_smux
[smux_idx
]);
935 static struct snd_kcontrol_new stac_smux_mixer
= {
936 .iface
= SNDRV_CTL_ELEM_IFACE_MIXER
,
937 .name
= "IEC958 Playback Source",
938 /* count set later */
939 .info
= stac_smux_enum_info
,
940 .get
= stac_smux_enum_get
,
941 .put
= stac_smux_enum_put
,
944 static const char * const stac_spdif_labels
[] = {
945 "Digital Playback", "Analog Mux 1", "Analog Mux 2", NULL
948 static int stac_create_spdif_mux_ctls(struct hda_codec
*codec
)
950 struct sigmatel_spec
*spec
= codec
->spec
;
951 struct auto_pin_cfg
*cfg
= &spec
->gen
.autocfg
;
952 const char * const *labels
= spec
->spdif_labels
;
953 struct snd_kcontrol_new
*kctl
;
956 if (cfg
->dig_outs
< 1)
959 num_cons
= snd_hda_get_num_conns(codec
, cfg
->dig_out_pins
[0]);
964 labels
= stac_spdif_labels
;
965 for (i
= 0; i
< num_cons
; i
++) {
966 if (snd_BUG_ON(!labels
[i
]))
968 snd_hda_add_imux_item(&spec
->spdif_mux
, labels
[i
], i
, NULL
);
971 kctl
= snd_hda_gen_add_kctl(&spec
->gen
, NULL
, &stac_smux_mixer
);
974 kctl
->count
= cfg
->dig_outs
;
982 static const struct hda_verb stac9200_core_init
[] = {
983 /* set dac0mux for dac converter */
984 { 0x07, AC_VERB_SET_CONNECT_SEL
, 0x00},
988 static const struct hda_verb stac9200_eapd_init
[] = {
989 /* set dac0mux for dac converter */
990 {0x07, AC_VERB_SET_CONNECT_SEL
, 0x00},
991 {0x08, AC_VERB_SET_EAPD_BTLENABLE
, 0x02},
995 static const struct hda_verb dell_eq_core_init
[] = {
996 /* set master volume to max value without distortion
997 * and direct control */
998 { 0x1f, AC_VERB_SET_VOLUME_KNOB_CONTROL
, 0xec},
1002 static const struct hda_verb stac92hd73xx_core_init
[] = {
1003 /* set master volume and direct control */
1004 { 0x1f, AC_VERB_SET_VOLUME_KNOB_CONTROL
, 0xff},
1008 static const struct hda_verb stac92hd83xxx_core_init
[] = {
1009 /* power state controls amps */
1010 { 0x01, AC_VERB_SET_EAPD
, 1 << 2},
1014 static const struct hda_verb stac92hd83xxx_hp_zephyr_init
[] = {
1015 { 0x22, 0x785, 0x43 },
1016 { 0x22, 0x782, 0xe0 },
1017 { 0x22, 0x795, 0x00 },
1021 static const struct hda_verb stac92hd71bxx_core_init
[] = {
1022 /* set master volume and direct control */
1023 { 0x28, AC_VERB_SET_VOLUME_KNOB_CONTROL
, 0xff},
1027 static const struct hda_verb stac92hd71bxx_unmute_core_init
[] = {
1028 /* unmute right and left channels for nodes 0x0f, 0xa, 0x0d */
1029 { 0x0f, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
1030 { 0x0a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
1031 { 0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
1035 static const struct hda_verb stac925x_core_init
[] = {
1036 /* set dac0mux for dac converter */
1037 { 0x06, AC_VERB_SET_CONNECT_SEL
, 0x00},
1038 /* mute the master volume */
1039 { 0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
1043 static const struct hda_verb stac922x_core_init
[] = {
1044 /* set master volume and direct control */
1045 { 0x16, AC_VERB_SET_VOLUME_KNOB_CONTROL
, 0xff},
1049 static const struct hda_verb d965_core_init
[] = {
1050 /* unmute node 0x1b */
1051 { 0x1b, AC_VERB_SET_AMP_GAIN_MUTE
, 0xb000},
1052 /* select node 0x03 as DAC */
1053 { 0x0b, AC_VERB_SET_CONNECT_SEL
, 0x01},
1057 static const struct hda_verb dell_3st_core_init
[] = {
1058 /* don't set delta bit */
1059 {0x24, AC_VERB_SET_VOLUME_KNOB_CONTROL
, 0x7f},
1060 /* unmute node 0x1b */
1061 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE
, 0xb000},
1062 /* select node 0x03 as DAC */
1063 {0x0b, AC_VERB_SET_CONNECT_SEL
, 0x01},
1067 static const struct hda_verb stac927x_core_init
[] = {
1068 /* set master volume and direct control */
1069 { 0x24, AC_VERB_SET_VOLUME_KNOB_CONTROL
, 0xff},
1070 /* enable analog pc beep path */
1071 { 0x01, AC_VERB_SET_DIGI_CONVERT_2
, 1 << 5},
1075 static const struct hda_verb stac927x_volknob_core_init
[] = {
1076 /* don't set delta bit */
1077 {0x24, AC_VERB_SET_VOLUME_KNOB_CONTROL
, 0x7f},
1078 /* enable analog pc beep path */
1079 {0x01, AC_VERB_SET_DIGI_CONVERT_2
, 1 << 5},
1083 static const struct hda_verb stac9205_core_init
[] = {
1084 /* set master volume and direct control */
1085 { 0x24, AC_VERB_SET_VOLUME_KNOB_CONTROL
, 0xff},
1086 /* enable analog pc beep path */
1087 { 0x01, AC_VERB_SET_DIGI_CONVERT_2
, 1 << 5},
1091 static const struct snd_kcontrol_new stac92hd73xx_6ch_loopback
=
1092 STAC_ANALOG_LOOPBACK(0xFA0, 0x7A1, 3);
1094 static const struct snd_kcontrol_new stac92hd73xx_8ch_loopback
=
1095 STAC_ANALOG_LOOPBACK(0xFA0, 0x7A1, 4);
1097 static const struct snd_kcontrol_new stac92hd73xx_10ch_loopback
=
1098 STAC_ANALOG_LOOPBACK(0xFA0, 0x7A1, 5);
1100 static const struct snd_kcontrol_new stac92hd71bxx_loopback
=
1101 STAC_ANALOG_LOOPBACK(0xFA0, 0x7A0, 2);
1103 static const struct snd_kcontrol_new stac9205_loopback
=
1104 STAC_ANALOG_LOOPBACK(0xFE0, 0x7E0, 1);
1106 static const struct snd_kcontrol_new stac927x_loopback
=
1107 STAC_ANALOG_LOOPBACK(0xFEB, 0x7EB, 1);
1109 static const struct hda_pintbl ref9200_pin_configs
[] = {
1110 { 0x08, 0x01c47010 },
1111 { 0x09, 0x01447010 },
1112 { 0x0d, 0x0221401f },
1113 { 0x0e, 0x01114010 },
1114 { 0x0f, 0x02a19020 },
1115 { 0x10, 0x01a19021 },
1116 { 0x11, 0x90100140 },
1117 { 0x12, 0x01813122 },
1121 static const struct hda_pintbl gateway9200_m4_pin_configs
[] = {
1122 { 0x08, 0x400000fe },
1123 { 0x09, 0x404500f4 },
1124 { 0x0d, 0x400100f0 },
1125 { 0x0e, 0x90110010 },
1126 { 0x0f, 0x400100f1 },
1127 { 0x10, 0x02a1902e },
1128 { 0x11, 0x500000f2 },
1129 { 0x12, 0x500000f3 },
1133 static const struct hda_pintbl gateway9200_m4_2_pin_configs
[] = {
1134 { 0x08, 0x400000fe },
1135 { 0x09, 0x404500f4 },
1136 { 0x0d, 0x400100f0 },
1137 { 0x0e, 0x90110010 },
1138 { 0x0f, 0x400100f1 },
1139 { 0x10, 0x02a1902e },
1140 { 0x11, 0x500000f2 },
1141 { 0x12, 0x500000f3 },
1146 STAC 9200 pin configs for
1151 static const struct hda_pintbl dell9200_d21_pin_configs
[] = {
1152 { 0x08, 0x400001f0 },
1153 { 0x09, 0x400001f1 },
1154 { 0x0d, 0x02214030 },
1155 { 0x0e, 0x01014010 },
1156 { 0x0f, 0x02a19020 },
1157 { 0x10, 0x01a19021 },
1158 { 0x11, 0x90100140 },
1159 { 0x12, 0x01813122 },
1164 STAC 9200 pin configs for
1168 static const struct hda_pintbl dell9200_d22_pin_configs
[] = {
1169 { 0x08, 0x400001f0 },
1170 { 0x09, 0x400001f1 },
1171 { 0x0d, 0x0221401f },
1172 { 0x0e, 0x01014010 },
1173 { 0x0f, 0x01813020 },
1174 { 0x10, 0x02a19021 },
1175 { 0x11, 0x90100140 },
1176 { 0x12, 0x400001f2 },
1181 STAC 9200 pin configs for
1182 102801C4 (Dell Dimension E310)
1189 static const struct hda_pintbl dell9200_d23_pin_configs
[] = {
1190 { 0x08, 0x400001f0 },
1191 { 0x09, 0x400001f1 },
1192 { 0x0d, 0x0221401f },
1193 { 0x0e, 0x01014010 },
1194 { 0x0f, 0x01813020 },
1195 { 0x10, 0x01a19021 },
1196 { 0x11, 0x90100140 },
1197 { 0x12, 0x400001f2 },
1203 STAC 9200-32 pin configs for
1204 102801B5 (Dell Inspiron 630m)
1205 102801D8 (Dell Inspiron 640m)
1207 static const struct hda_pintbl dell9200_m21_pin_configs
[] = {
1208 { 0x08, 0x40c003fa },
1209 { 0x09, 0x03441340 },
1210 { 0x0d, 0x0321121f },
1211 { 0x0e, 0x90170310 },
1212 { 0x0f, 0x408003fb },
1213 { 0x10, 0x03a11020 },
1214 { 0x11, 0x401003fc },
1215 { 0x12, 0x403003fd },
1220 STAC 9200-32 pin configs for
1221 102801C2 (Dell Latitude D620)
1223 102801CC (Dell Latitude D820)
1227 static const struct hda_pintbl dell9200_m22_pin_configs
[] = {
1228 { 0x08, 0x40c003fa },
1229 { 0x09, 0x0144131f },
1230 { 0x0d, 0x0321121f },
1231 { 0x0e, 0x90170310 },
1232 { 0x0f, 0x90a70321 },
1233 { 0x10, 0x03a11020 },
1234 { 0x11, 0x401003fb },
1235 { 0x12, 0x40f000fc },
1240 STAC 9200-32 pin configs for
1241 102801CE (Dell XPS M1710)
1242 102801CF (Dell Precision M90)
1244 static const struct hda_pintbl dell9200_m23_pin_configs
[] = {
1245 { 0x08, 0x40c003fa },
1246 { 0x09, 0x01441340 },
1247 { 0x0d, 0x0421421f },
1248 { 0x0e, 0x90170310 },
1249 { 0x0f, 0x408003fb },
1250 { 0x10, 0x04a1102e },
1251 { 0x11, 0x90170311 },
1252 { 0x12, 0x403003fc },
1257 STAC 9200-32 pin configs for
1260 102801CB (Dell Latitude 120L)
1263 static const struct hda_pintbl dell9200_m24_pin_configs
[] = {
1264 { 0x08, 0x40c003fa },
1265 { 0x09, 0x404003fb },
1266 { 0x0d, 0x0321121f },
1267 { 0x0e, 0x90170310 },
1268 { 0x0f, 0x408003fc },
1269 { 0x10, 0x03a11020 },
1270 { 0x11, 0x401003fd },
1271 { 0x12, 0x403003fe },
1276 STAC 9200-32 pin configs for
1277 102801BD (Dell Inspiron E1505n)
1281 static const struct hda_pintbl dell9200_m25_pin_configs
[] = {
1282 { 0x08, 0x40c003fa },
1283 { 0x09, 0x01441340 },
1284 { 0x0d, 0x0421121f },
1285 { 0x0e, 0x90170310 },
1286 { 0x0f, 0x408003fb },
1287 { 0x10, 0x04a11020 },
1288 { 0x11, 0x401003fc },
1289 { 0x12, 0x403003fd },
1294 STAC 9200-32 pin configs for
1295 102801F5 (Dell Inspiron 1501)
1298 static const struct hda_pintbl dell9200_m26_pin_configs
[] = {
1299 { 0x08, 0x40c003fa },
1300 { 0x09, 0x404003fb },
1301 { 0x0d, 0x0421121f },
1302 { 0x0e, 0x90170310 },
1303 { 0x0f, 0x408003fc },
1304 { 0x10, 0x04a11020 },
1305 { 0x11, 0x401003fd },
1306 { 0x12, 0x403003fe },
1312 102801CD (Dell Inspiron E1705/9400)
1314 static const struct hda_pintbl dell9200_m27_pin_configs
[] = {
1315 { 0x08, 0x40c003fa },
1316 { 0x09, 0x01441340 },
1317 { 0x0d, 0x0421121f },
1318 { 0x0e, 0x90170310 },
1319 { 0x0f, 0x90170310 },
1320 { 0x10, 0x04a11020 },
1321 { 0x11, 0x90170310 },
1322 { 0x12, 0x40f003fc },
1326 static const struct hda_pintbl oqo9200_pin_configs
[] = {
1327 { 0x08, 0x40c000f0 },
1328 { 0x09, 0x404000f1 },
1329 { 0x0d, 0x0221121f },
1330 { 0x0e, 0x02211210 },
1331 { 0x0f, 0x90170111 },
1332 { 0x10, 0x90a70120 },
1333 { 0x11, 0x400000f2 },
1334 { 0x12, 0x400000f3 },
1339 static void stac9200_fixup_panasonic(struct hda_codec
*codec
,
1340 const struct hda_fixup
*fix
, int action
)
1342 struct sigmatel_spec
*spec
= codec
->spec
;
1344 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
1345 spec
->gpio_mask
= spec
->gpio_dir
= 0x09;
1346 spec
->gpio_data
= 0x00;
1347 /* CF-74 has no headphone detection, and the driver should *NOT*
1348 * do detection and HP/speaker toggle because the hardware does it.
1350 spec
->gen
.suppress_auto_mute
= 1;
1355 static const struct hda_fixup stac9200_fixups
[] = {
1357 .type
= HDA_FIXUP_PINS
,
1358 .v
.pins
= ref9200_pin_configs
,
1361 .type
= HDA_FIXUP_PINS
,
1362 .v
.pins
= oqo9200_pin_configs
,
1364 .chain_id
= STAC_9200_EAPD_INIT
,
1366 [STAC_9200_DELL_D21
] = {
1367 .type
= HDA_FIXUP_PINS
,
1368 .v
.pins
= dell9200_d21_pin_configs
,
1370 [STAC_9200_DELL_D22
] = {
1371 .type
= HDA_FIXUP_PINS
,
1372 .v
.pins
= dell9200_d22_pin_configs
,
1374 [STAC_9200_DELL_D23
] = {
1375 .type
= HDA_FIXUP_PINS
,
1376 .v
.pins
= dell9200_d23_pin_configs
,
1378 [STAC_9200_DELL_M21
] = {
1379 .type
= HDA_FIXUP_PINS
,
1380 .v
.pins
= dell9200_m21_pin_configs
,
1382 [STAC_9200_DELL_M22
] = {
1383 .type
= HDA_FIXUP_PINS
,
1384 .v
.pins
= dell9200_m22_pin_configs
,
1386 [STAC_9200_DELL_M23
] = {
1387 .type
= HDA_FIXUP_PINS
,
1388 .v
.pins
= dell9200_m23_pin_configs
,
1390 [STAC_9200_DELL_M24
] = {
1391 .type
= HDA_FIXUP_PINS
,
1392 .v
.pins
= dell9200_m24_pin_configs
,
1394 [STAC_9200_DELL_M25
] = {
1395 .type
= HDA_FIXUP_PINS
,
1396 .v
.pins
= dell9200_m25_pin_configs
,
1398 [STAC_9200_DELL_M26
] = {
1399 .type
= HDA_FIXUP_PINS
,
1400 .v
.pins
= dell9200_m26_pin_configs
,
1402 [STAC_9200_DELL_M27
] = {
1403 .type
= HDA_FIXUP_PINS
,
1404 .v
.pins
= dell9200_m27_pin_configs
,
1407 .type
= HDA_FIXUP_PINS
,
1408 .v
.pins
= gateway9200_m4_pin_configs
,
1410 .chain_id
= STAC_9200_EAPD_INIT
,
1412 [STAC_9200_M4_2
] = {
1413 .type
= HDA_FIXUP_PINS
,
1414 .v
.pins
= gateway9200_m4_2_pin_configs
,
1416 .chain_id
= STAC_9200_EAPD_INIT
,
1418 [STAC_9200_PANASONIC
] = {
1419 .type
= HDA_FIXUP_FUNC
,
1420 .v
.func
= stac9200_fixup_panasonic
,
1422 [STAC_9200_EAPD_INIT
] = {
1423 .type
= HDA_FIXUP_VERBS
,
1424 .v
.verbs
= (const struct hda_verb
[]) {
1425 {0x08, AC_VERB_SET_EAPD_BTLENABLE
, 0x02},
1431 static const struct hda_model_fixup stac9200_models
[] = {
1432 { .id
= STAC_REF
, .name
= "ref" },
1433 { .id
= STAC_9200_OQO
, .name
= "oqo" },
1434 { .id
= STAC_9200_DELL_D21
, .name
= "dell-d21" },
1435 { .id
= STAC_9200_DELL_D22
, .name
= "dell-d22" },
1436 { .id
= STAC_9200_DELL_D23
, .name
= "dell-d23" },
1437 { .id
= STAC_9200_DELL_M21
, .name
= "dell-m21" },
1438 { .id
= STAC_9200_DELL_M22
, .name
= "dell-m22" },
1439 { .id
= STAC_9200_DELL_M23
, .name
= "dell-m23" },
1440 { .id
= STAC_9200_DELL_M24
, .name
= "dell-m24" },
1441 { .id
= STAC_9200_DELL_M25
, .name
= "dell-m25" },
1442 { .id
= STAC_9200_DELL_M26
, .name
= "dell-m26" },
1443 { .id
= STAC_9200_DELL_M27
, .name
= "dell-m27" },
1444 { .id
= STAC_9200_M4
, .name
= "gateway-m4" },
1445 { .id
= STAC_9200_M4_2
, .name
= "gateway-m4-2" },
1446 { .id
= STAC_9200_PANASONIC
, .name
= "panasonic" },
1450 static const struct snd_pci_quirk stac9200_fixup_tbl
[] = {
1451 /* SigmaTel reference board */
1452 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL
, 0x2668,
1453 "DFI LanParty", STAC_REF
),
1454 SND_PCI_QUIRK(PCI_VENDOR_ID_DFI
, 0x3101,
1455 "DFI LanParty", STAC_REF
),
1456 /* Dell laptops have BIOS problem */
1457 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL
, 0x01a8,
1458 "unknown Dell", STAC_9200_DELL_D21
),
1459 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL
, 0x01b5,
1460 "Dell Inspiron 630m", STAC_9200_DELL_M21
),
1461 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL
, 0x01bd,
1462 "Dell Inspiron E1505n", STAC_9200_DELL_M25
),
1463 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL
, 0x01c0,
1464 "unknown Dell", STAC_9200_DELL_D22
),
1465 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL
, 0x01c1,
1466 "unknown Dell", STAC_9200_DELL_D22
),
1467 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL
, 0x01c2,
1468 "Dell Latitude D620", STAC_9200_DELL_M22
),
1469 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL
, 0x01c5,
1470 "unknown Dell", STAC_9200_DELL_D23
),
1471 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL
, 0x01c7,
1472 "unknown Dell", STAC_9200_DELL_D23
),
1473 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL
, 0x01c8,
1474 "unknown Dell", STAC_9200_DELL_M22
),
1475 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL
, 0x01c9,
1476 "unknown Dell", STAC_9200_DELL_M24
),
1477 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL
, 0x01ca,
1478 "unknown Dell", STAC_9200_DELL_M24
),
1479 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL
, 0x01cb,
1480 "Dell Latitude 120L", STAC_9200_DELL_M24
),
1481 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL
, 0x01cc,
1482 "Dell Latitude D820", STAC_9200_DELL_M22
),
1483 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL
, 0x01cd,
1484 "Dell Inspiron E1705/9400", STAC_9200_DELL_M27
),
1485 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL
, 0x01ce,
1486 "Dell XPS M1710", STAC_9200_DELL_M23
),
1487 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL
, 0x01cf,
1488 "Dell Precision M90", STAC_9200_DELL_M23
),
1489 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL
, 0x01d3,
1490 "unknown Dell", STAC_9200_DELL_M22
),
1491 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL
, 0x01d4,
1492 "unknown Dell", STAC_9200_DELL_M22
),
1493 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL
, 0x01d6,
1494 "unknown Dell", STAC_9200_DELL_M22
),
1495 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL
, 0x01d8,
1496 "Dell Inspiron 640m", STAC_9200_DELL_M21
),
1497 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL
, 0x01d9,
1498 "unknown Dell", STAC_9200_DELL_D23
),
1499 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL
, 0x01da,
1500 "unknown Dell", STAC_9200_DELL_D23
),
1501 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL
, 0x01de,
1502 "unknown Dell", STAC_9200_DELL_D21
),
1503 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL
, 0x01e3,
1504 "unknown Dell", STAC_9200_DELL_D23
),
1505 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL
, 0x01e8,
1506 "unknown Dell", STAC_9200_DELL_D21
),
1507 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL
, 0x01ee,
1508 "unknown Dell", STAC_9200_DELL_M25
),
1509 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL
, 0x01ef,
1510 "unknown Dell", STAC_9200_DELL_M25
),
1511 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL
, 0x01f5,
1512 "Dell Inspiron 1501", STAC_9200_DELL_M26
),
1513 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL
, 0x01f6,
1514 "unknown Dell", STAC_9200_DELL_M26
),
1516 SND_PCI_QUIRK(0x10f7, 0x8338, "Panasonic CF-74", STAC_9200_PANASONIC
),
1517 /* Gateway machines needs EAPD to be set on resume */
1518 SND_PCI_QUIRK(0x107b, 0x0205, "Gateway S-7110M", STAC_9200_M4
),
1519 SND_PCI_QUIRK(0x107b, 0x0317, "Gateway MT3423, MX341*", STAC_9200_M4_2
),
1520 SND_PCI_QUIRK(0x107b, 0x0318, "Gateway ML3019, MT3707", STAC_9200_M4_2
),
1522 SND_PCI_QUIRK(0x1106, 0x3288, "OQO Model 2", STAC_9200_OQO
),
1526 static const struct hda_pintbl ref925x_pin_configs
[] = {
1527 { 0x07, 0x40c003f0 },
1528 { 0x08, 0x424503f2 },
1529 { 0x0a, 0x01813022 },
1530 { 0x0b, 0x02a19021 },
1531 { 0x0c, 0x90a70320 },
1532 { 0x0d, 0x02214210 },
1533 { 0x10, 0x01019020 },
1534 { 0x11, 0x9033032e },
1538 static const struct hda_pintbl stac925xM1_pin_configs
[] = {
1539 { 0x07, 0x40c003f4 },
1540 { 0x08, 0x424503f2 },
1541 { 0x0a, 0x400000f3 },
1542 { 0x0b, 0x02a19020 },
1543 { 0x0c, 0x40a000f0 },
1544 { 0x0d, 0x90100210 },
1545 { 0x10, 0x400003f1 },
1546 { 0x11, 0x9033032e },
1550 static const struct hda_pintbl stac925xM1_2_pin_configs
[] = {
1551 { 0x07, 0x40c003f4 },
1552 { 0x08, 0x424503f2 },
1553 { 0x0a, 0x400000f3 },
1554 { 0x0b, 0x02a19020 },
1555 { 0x0c, 0x40a000f0 },
1556 { 0x0d, 0x90100210 },
1557 { 0x10, 0x400003f1 },
1558 { 0x11, 0x9033032e },
1562 static const struct hda_pintbl stac925xM2_pin_configs
[] = {
1563 { 0x07, 0x40c003f4 },
1564 { 0x08, 0x424503f2 },
1565 { 0x0a, 0x400000f3 },
1566 { 0x0b, 0x02a19020 },
1567 { 0x0c, 0x40a000f0 },
1568 { 0x0d, 0x90100210 },
1569 { 0x10, 0x400003f1 },
1570 { 0x11, 0x9033032e },
1574 static const struct hda_pintbl stac925xM2_2_pin_configs
[] = {
1575 { 0x07, 0x40c003f4 },
1576 { 0x08, 0x424503f2 },
1577 { 0x0a, 0x400000f3 },
1578 { 0x0b, 0x02a19020 },
1579 { 0x0c, 0x40a000f0 },
1580 { 0x0d, 0x90100210 },
1581 { 0x10, 0x400003f1 },
1582 { 0x11, 0x9033032e },
1586 static const struct hda_pintbl stac925xM3_pin_configs
[] = {
1587 { 0x07, 0x40c003f4 },
1588 { 0x08, 0x424503f2 },
1589 { 0x0a, 0x400000f3 },
1590 { 0x0b, 0x02a19020 },
1591 { 0x0c, 0x40a000f0 },
1592 { 0x0d, 0x90100210 },
1593 { 0x10, 0x400003f1 },
1594 { 0x11, 0x503303f3 },
1598 static const struct hda_pintbl stac925xM5_pin_configs
[] = {
1599 { 0x07, 0x40c003f4 },
1600 { 0x08, 0x424503f2 },
1601 { 0x0a, 0x400000f3 },
1602 { 0x0b, 0x02a19020 },
1603 { 0x0c, 0x40a000f0 },
1604 { 0x0d, 0x90100210 },
1605 { 0x10, 0x400003f1 },
1606 { 0x11, 0x9033032e },
1610 static const struct hda_pintbl stac925xM6_pin_configs
[] = {
1611 { 0x07, 0x40c003f4 },
1612 { 0x08, 0x424503f2 },
1613 { 0x0a, 0x400000f3 },
1614 { 0x0b, 0x02a19020 },
1615 { 0x0c, 0x40a000f0 },
1616 { 0x0d, 0x90100210 },
1617 { 0x10, 0x400003f1 },
1618 { 0x11, 0x90330320 },
1622 static const struct hda_fixup stac925x_fixups
[] = {
1624 .type
= HDA_FIXUP_PINS
,
1625 .v
.pins
= ref925x_pin_configs
,
1628 .type
= HDA_FIXUP_PINS
,
1629 .v
.pins
= stac925xM1_pin_configs
,
1632 .type
= HDA_FIXUP_PINS
,
1633 .v
.pins
= stac925xM1_2_pin_configs
,
1636 .type
= HDA_FIXUP_PINS
,
1637 .v
.pins
= stac925xM2_pin_configs
,
1640 .type
= HDA_FIXUP_PINS
,
1641 .v
.pins
= stac925xM2_2_pin_configs
,
1644 .type
= HDA_FIXUP_PINS
,
1645 .v
.pins
= stac925xM3_pin_configs
,
1648 .type
= HDA_FIXUP_PINS
,
1649 .v
.pins
= stac925xM5_pin_configs
,
1652 .type
= HDA_FIXUP_PINS
,
1653 .v
.pins
= stac925xM6_pin_configs
,
1657 static const struct hda_model_fixup stac925x_models
[] = {
1658 { .id
= STAC_REF
, .name
= "ref" },
1659 { .id
= STAC_M1
, .name
= "m1" },
1660 { .id
= STAC_M1_2
, .name
= "m1-2" },
1661 { .id
= STAC_M2
, .name
= "m2" },
1662 { .id
= STAC_M2_2
, .name
= "m2-2" },
1663 { .id
= STAC_M3
, .name
= "m3" },
1664 { .id
= STAC_M5
, .name
= "m5" },
1665 { .id
= STAC_M6
, .name
= "m6" },
1669 static const struct snd_pci_quirk stac925x_fixup_tbl
[] = {
1670 /* SigmaTel reference board */
1671 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL
, 0x2668, "DFI LanParty", STAC_REF
),
1672 SND_PCI_QUIRK(PCI_VENDOR_ID_DFI
, 0x3101, "DFI LanParty", STAC_REF
),
1673 SND_PCI_QUIRK(0x8384, 0x7632, "Stac9202 Reference Board", STAC_REF
),
1675 /* Default table for unknown ID */
1676 SND_PCI_QUIRK(0x1002, 0x437b, "Gateway mobile", STAC_M2_2
),
1678 /* gateway machines are checked via codec ssid */
1679 SND_PCI_QUIRK(0x107b, 0x0316, "Gateway M255", STAC_M2
),
1680 SND_PCI_QUIRK(0x107b, 0x0366, "Gateway MP6954", STAC_M5
),
1681 SND_PCI_QUIRK(0x107b, 0x0461, "Gateway NX560XL", STAC_M1
),
1682 SND_PCI_QUIRK(0x107b, 0x0681, "Gateway NX860", STAC_M2
),
1683 SND_PCI_QUIRK(0x107b, 0x0367, "Gateway MX6453", STAC_M1_2
),
1684 /* Not sure about the brand name for those */
1685 SND_PCI_QUIRK(0x107b, 0x0281, "Gateway mobile", STAC_M1
),
1686 SND_PCI_QUIRK(0x107b, 0x0507, "Gateway mobile", STAC_M3
),
1687 SND_PCI_QUIRK(0x107b, 0x0281, "Gateway mobile", STAC_M6
),
1688 SND_PCI_QUIRK(0x107b, 0x0685, "Gateway mobile", STAC_M2_2
),
1692 static const struct hda_pintbl ref92hd73xx_pin_configs
[] = {
1693 { 0x0a, 0x02214030 },
1694 { 0x0b, 0x02a19040 },
1695 { 0x0c, 0x01a19020 },
1696 { 0x0d, 0x02214030 },
1697 { 0x0e, 0x0181302e },
1698 { 0x0f, 0x01014010 },
1699 { 0x10, 0x01014020 },
1700 { 0x11, 0x01014030 },
1701 { 0x12, 0x02319040 },
1702 { 0x13, 0x90a000f0 },
1703 { 0x14, 0x90a000f0 },
1704 { 0x22, 0x01452050 },
1705 { 0x23, 0x01452050 },
1709 static const struct hda_pintbl dell_m6_pin_configs
[] = {
1710 { 0x0a, 0x0321101f },
1711 { 0x0b, 0x4f00000f },
1712 { 0x0c, 0x4f0000f0 },
1713 { 0x0d, 0x90170110 },
1714 { 0x0e, 0x03a11020 },
1715 { 0x0f, 0x0321101f },
1716 { 0x10, 0x4f0000f0 },
1717 { 0x11, 0x4f0000f0 },
1718 { 0x12, 0x4f0000f0 },
1719 { 0x13, 0x90a60160 },
1720 { 0x14, 0x4f0000f0 },
1721 { 0x22, 0x4f0000f0 },
1722 { 0x23, 0x4f0000f0 },
1726 static const struct hda_pintbl alienware_m17x_pin_configs
[] = {
1727 { 0x0a, 0x0321101f },
1728 { 0x0b, 0x0321101f },
1729 { 0x0c, 0x03a11020 },
1730 { 0x0d, 0x03014020 },
1731 { 0x0e, 0x90170110 },
1732 { 0x0f, 0x4f0000f0 },
1733 { 0x10, 0x4f0000f0 },
1734 { 0x11, 0x4f0000f0 },
1735 { 0x12, 0x4f0000f0 },
1736 { 0x13, 0x90a60160 },
1737 { 0x14, 0x4f0000f0 },
1738 { 0x22, 0x4f0000f0 },
1739 { 0x23, 0x904601b0 },
1743 static const struct hda_pintbl intel_dg45id_pin_configs
[] = {
1744 { 0x0a, 0x02214230 },
1745 { 0x0b, 0x02A19240 },
1746 { 0x0c, 0x01013214 },
1747 { 0x0d, 0x01014210 },
1748 { 0x0e, 0x01A19250 },
1749 { 0x0f, 0x01011212 },
1750 { 0x10, 0x01016211 },
1754 static void stac92hd73xx_fixup_ref(struct hda_codec
*codec
,
1755 const struct hda_fixup
*fix
, int action
)
1757 struct sigmatel_spec
*spec
= codec
->spec
;
1759 if (action
!= HDA_FIXUP_ACT_PRE_PROBE
)
1762 snd_hda_apply_pincfgs(codec
, ref92hd73xx_pin_configs
);
1763 spec
->gpio_mask
= spec
->gpio_dir
= spec
->gpio_data
= 0;
1766 static void stac92hd73xx_fixup_dell(struct hda_codec
*codec
)
1768 struct sigmatel_spec
*spec
= codec
->spec
;
1770 snd_hda_apply_pincfgs(codec
, dell_m6_pin_configs
);
1771 spec
->eapd_switch
= 0;
1774 static void stac92hd73xx_fixup_dell_eq(struct hda_codec
*codec
,
1775 const struct hda_fixup
*fix
, int action
)
1777 struct sigmatel_spec
*spec
= codec
->spec
;
1779 if (action
!= HDA_FIXUP_ACT_PRE_PROBE
)
1782 stac92hd73xx_fixup_dell(codec
);
1783 snd_hda_add_verbs(codec
, dell_eq_core_init
);
1784 spec
->volknob_init
= 1;
1788 static void stac92hd73xx_fixup_dell_m6_amic(struct hda_codec
*codec
,
1789 const struct hda_fixup
*fix
, int action
)
1791 if (action
!= HDA_FIXUP_ACT_PRE_PROBE
)
1794 stac92hd73xx_fixup_dell(codec
);
1795 snd_hda_codec_set_pincfg(codec
, 0x0b, 0x90A70170);
1799 static void stac92hd73xx_fixup_dell_m6_dmic(struct hda_codec
*codec
,
1800 const struct hda_fixup
*fix
, int action
)
1802 if (action
!= HDA_FIXUP_ACT_PRE_PROBE
)
1805 stac92hd73xx_fixup_dell(codec
);
1806 snd_hda_codec_set_pincfg(codec
, 0x13, 0x90A60160);
1810 static void stac92hd73xx_fixup_dell_m6_both(struct hda_codec
*codec
,
1811 const struct hda_fixup
*fix
, int action
)
1813 if (action
!= HDA_FIXUP_ACT_PRE_PROBE
)
1816 stac92hd73xx_fixup_dell(codec
);
1817 snd_hda_codec_set_pincfg(codec
, 0x0b, 0x90A70170);
1818 snd_hda_codec_set_pincfg(codec
, 0x13, 0x90A60160);
1821 static void stac92hd73xx_fixup_alienware_m17x(struct hda_codec
*codec
,
1822 const struct hda_fixup
*fix
, int action
)
1824 struct sigmatel_spec
*spec
= codec
->spec
;
1826 if (action
!= HDA_FIXUP_ACT_PRE_PROBE
)
1829 snd_hda_apply_pincfgs(codec
, alienware_m17x_pin_configs
);
1830 spec
->eapd_switch
= 0;
1833 static void stac92hd73xx_fixup_no_jd(struct hda_codec
*codec
,
1834 const struct hda_fixup
*fix
, int action
)
1836 if (action
== HDA_FIXUP_ACT_PRE_PROBE
)
1837 codec
->no_jack_detect
= 1;
1840 static const struct hda_fixup stac92hd73xx_fixups
[] = {
1841 [STAC_92HD73XX_REF
] = {
1842 .type
= HDA_FIXUP_FUNC
,
1843 .v
.func
= stac92hd73xx_fixup_ref
,
1845 [STAC_DELL_M6_AMIC
] = {
1846 .type
= HDA_FIXUP_FUNC
,
1847 .v
.func
= stac92hd73xx_fixup_dell_m6_amic
,
1849 [STAC_DELL_M6_DMIC
] = {
1850 .type
= HDA_FIXUP_FUNC
,
1851 .v
.func
= stac92hd73xx_fixup_dell_m6_dmic
,
1853 [STAC_DELL_M6_BOTH
] = {
1854 .type
= HDA_FIXUP_FUNC
,
1855 .v
.func
= stac92hd73xx_fixup_dell_m6_both
,
1858 .type
= HDA_FIXUP_FUNC
,
1859 .v
.func
= stac92hd73xx_fixup_dell_eq
,
1861 [STAC_ALIENWARE_M17X
] = {
1862 .type
= HDA_FIXUP_FUNC
,
1863 .v
.func
= stac92hd73xx_fixup_alienware_m17x
,
1865 [STAC_92HD73XX_INTEL
] = {
1866 .type
= HDA_FIXUP_PINS
,
1867 .v
.pins
= intel_dg45id_pin_configs
,
1869 [STAC_92HD73XX_NO_JD
] = {
1870 .type
= HDA_FIXUP_FUNC
,
1871 .v
.func
= stac92hd73xx_fixup_no_jd
,
1875 static const struct hda_model_fixup stac92hd73xx_models
[] = {
1876 { .id
= STAC_92HD73XX_NO_JD
, .name
= "no-jd" },
1877 { .id
= STAC_92HD73XX_REF
, .name
= "ref" },
1878 { .id
= STAC_92HD73XX_INTEL
, .name
= "intel" },
1879 { .id
= STAC_DELL_M6_AMIC
, .name
= "dell-m6-amic" },
1880 { .id
= STAC_DELL_M6_DMIC
, .name
= "dell-m6-dmic" },
1881 { .id
= STAC_DELL_M6_BOTH
, .name
= "dell-m6" },
1882 { .id
= STAC_DELL_EQ
, .name
= "dell-eq" },
1883 { .id
= STAC_ALIENWARE_M17X
, .name
= "alienware" },
1887 static const struct snd_pci_quirk stac92hd73xx_fixup_tbl
[] = {
1888 /* SigmaTel reference board */
1889 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL
, 0x2668,
1890 "DFI LanParty", STAC_92HD73XX_REF
),
1891 SND_PCI_QUIRK(PCI_VENDOR_ID_DFI
, 0x3101,
1892 "DFI LanParty", STAC_92HD73XX_REF
),
1893 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL
, 0x5002,
1894 "Intel DG45ID", STAC_92HD73XX_INTEL
),
1895 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL
, 0x5003,
1896 "Intel DG45FC", STAC_92HD73XX_INTEL
),
1897 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL
, 0x0254,
1898 "Dell Studio 1535", STAC_DELL_M6_DMIC
),
1899 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL
, 0x0255,
1900 "unknown Dell", STAC_DELL_M6_DMIC
),
1901 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL
, 0x0256,
1902 "unknown Dell", STAC_DELL_M6_BOTH
),
1903 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL
, 0x0257,
1904 "unknown Dell", STAC_DELL_M6_BOTH
),
1905 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL
, 0x025e,
1906 "unknown Dell", STAC_DELL_M6_AMIC
),
1907 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL
, 0x025f,
1908 "unknown Dell", STAC_DELL_M6_AMIC
),
1909 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL
, 0x0271,
1910 "unknown Dell", STAC_DELL_M6_DMIC
),
1911 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL
, 0x0272,
1912 "unknown Dell", STAC_DELL_M6_DMIC
),
1913 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL
, 0x029f,
1914 "Dell Studio 1537", STAC_DELL_M6_DMIC
),
1915 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL
, 0x02a0,
1916 "Dell Studio 17", STAC_DELL_M6_DMIC
),
1917 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL
, 0x02be,
1918 "Dell Studio 1555", STAC_DELL_M6_DMIC
),
1919 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL
, 0x02bd,
1920 "Dell Studio 1557", STAC_DELL_M6_DMIC
),
1921 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL
, 0x02fe,
1922 "Dell Studio XPS 1645", STAC_DELL_M6_DMIC
),
1923 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL
, 0x0413,
1924 "Dell Studio 1558", STAC_DELL_M6_DMIC
),
1925 /* codec SSID matching */
1926 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL
, 0x02a1,
1927 "Alienware M17x", STAC_ALIENWARE_M17X
),
1928 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL
, 0x043a,
1929 "Alienware M17x", STAC_ALIENWARE_M17X
),
1930 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL
, 0x0490,
1931 "Alienware M17x R3", STAC_DELL_EQ
),
1935 static const struct hda_pintbl ref92hd83xxx_pin_configs
[] = {
1936 { 0x0a, 0x02214030 },
1937 { 0x0b, 0x02211010 },
1938 { 0x0c, 0x02a19020 },
1939 { 0x0d, 0x02170130 },
1940 { 0x0e, 0x01014050 },
1941 { 0x0f, 0x01819040 },
1942 { 0x10, 0x01014020 },
1943 { 0x11, 0x90a3014e },
1944 { 0x1f, 0x01451160 },
1945 { 0x20, 0x98560170 },
1949 static const struct hda_pintbl dell_s14_pin_configs
[] = {
1950 { 0x0a, 0x0221403f },
1951 { 0x0b, 0x0221101f },
1952 { 0x0c, 0x02a19020 },
1953 { 0x0d, 0x90170110 },
1954 { 0x0e, 0x40f000f0 },
1955 { 0x0f, 0x40f000f0 },
1956 { 0x10, 0x40f000f0 },
1957 { 0x11, 0x90a60160 },
1958 { 0x1f, 0x40f000f0 },
1959 { 0x20, 0x40f000f0 },
1963 static const struct hda_pintbl dell_vostro_3500_pin_configs
[] = {
1964 { 0x0a, 0x02a11020 },
1965 { 0x0b, 0x0221101f },
1966 { 0x0c, 0x400000f0 },
1967 { 0x0d, 0x90170110 },
1968 { 0x0e, 0x400000f1 },
1969 { 0x0f, 0x400000f2 },
1970 { 0x10, 0x400000f3 },
1971 { 0x11, 0x90a60160 },
1972 { 0x1f, 0x400000f4 },
1973 { 0x20, 0x400000f5 },
1977 static const struct hda_pintbl hp_dv7_4000_pin_configs
[] = {
1978 { 0x0a, 0x03a12050 },
1979 { 0x0b, 0x0321201f },
1980 { 0x0c, 0x40f000f0 },
1981 { 0x0d, 0x90170110 },
1982 { 0x0e, 0x40f000f0 },
1983 { 0x0f, 0x40f000f0 },
1984 { 0x10, 0x90170110 },
1985 { 0x11, 0xd5a30140 },
1986 { 0x1f, 0x40f000f0 },
1987 { 0x20, 0x40f000f0 },
1991 static const struct hda_pintbl hp_zephyr_pin_configs
[] = {
1992 { 0x0a, 0x01813050 },
1993 { 0x0b, 0x0421201f },
1994 { 0x0c, 0x04a1205e },
1995 { 0x0d, 0x96130310 },
1996 { 0x0e, 0x96130310 },
1997 { 0x0f, 0x0101401f },
1998 { 0x10, 0x1111611f },
1999 { 0x11, 0xd5a30130 },
2003 static const struct hda_pintbl hp_cNB11_intquad_pin_configs
[] = {
2004 { 0x0a, 0x40f000f0 },
2005 { 0x0b, 0x0221101f },
2006 { 0x0c, 0x02a11020 },
2007 { 0x0d, 0x92170110 },
2008 { 0x0e, 0x40f000f0 },
2009 { 0x0f, 0x92170110 },
2010 { 0x10, 0x40f000f0 },
2011 { 0x11, 0xd5a30130 },
2012 { 0x1f, 0x40f000f0 },
2013 { 0x20, 0x40f000f0 },
2017 static void stac92hd83xxx_fixup_hp(struct hda_codec
*codec
,
2018 const struct hda_fixup
*fix
, int action
)
2020 struct sigmatel_spec
*spec
= codec
->spec
;
2022 if (action
!= HDA_FIXUP_ACT_PRE_PROBE
)
2025 if (hp_bnb2011_with_dock(codec
)) {
2026 snd_hda_codec_set_pincfg(codec
, 0xa, 0x2101201f);
2027 snd_hda_codec_set_pincfg(codec
, 0xf, 0x2181205e);
2030 if (find_mute_led_cfg(codec
, spec
->default_polarity
))
2031 snd_printd("mute LED gpio %d polarity %d\n",
2033 spec
->gpio_led_polarity
);
2036 static void stac92hd83xxx_fixup_hp_zephyr(struct hda_codec
*codec
,
2037 const struct hda_fixup
*fix
, int action
)
2039 if (action
!= HDA_FIXUP_ACT_PRE_PROBE
)
2042 snd_hda_apply_pincfgs(codec
, hp_zephyr_pin_configs
);
2043 snd_hda_add_verbs(codec
, stac92hd83xxx_hp_zephyr_init
);
2046 static void stac92hd83xxx_fixup_hp_led(struct hda_codec
*codec
,
2047 const struct hda_fixup
*fix
, int action
)
2049 struct sigmatel_spec
*spec
= codec
->spec
;
2051 if (action
== HDA_FIXUP_ACT_PRE_PROBE
)
2052 spec
->default_polarity
= 0;
2055 static void stac92hd83xxx_fixup_hp_inv_led(struct hda_codec
*codec
,
2056 const struct hda_fixup
*fix
, int action
)
2058 struct sigmatel_spec
*spec
= codec
->spec
;
2060 if (action
== HDA_FIXUP_ACT_PRE_PROBE
)
2061 spec
->default_polarity
= 1;
2064 static void stac92hd83xxx_fixup_hp_mic_led(struct hda_codec
*codec
,
2065 const struct hda_fixup
*fix
, int action
)
2067 struct sigmatel_spec
*spec
= codec
->spec
;
2069 if (action
== HDA_FIXUP_ACT_PRE_PROBE
)
2070 spec
->mic_mute_led_gpio
= 0x08; /* GPIO3 */
2073 static void stac92hd83xxx_fixup_headset_jack(struct hda_codec
*codec
,
2074 const struct hda_fixup
*fix
, int action
)
2076 struct sigmatel_spec
*spec
= codec
->spec
;
2078 if (action
== HDA_FIXUP_ACT_PRE_PROBE
)
2079 spec
->headset_jack
= 1;
2082 static const struct hda_fixup stac92hd83xxx_fixups
[] = {
2083 [STAC_92HD83XXX_REF
] = {
2084 .type
= HDA_FIXUP_PINS
,
2085 .v
.pins
= ref92hd83xxx_pin_configs
,
2087 [STAC_92HD83XXX_PWR_REF
] = {
2088 .type
= HDA_FIXUP_PINS
,
2089 .v
.pins
= ref92hd83xxx_pin_configs
,
2092 .type
= HDA_FIXUP_PINS
,
2093 .v
.pins
= dell_s14_pin_configs
,
2095 [STAC_DELL_VOSTRO_3500
] = {
2096 .type
= HDA_FIXUP_PINS
,
2097 .v
.pins
= dell_vostro_3500_pin_configs
,
2099 [STAC_92HD83XXX_HP_cNB11_INTQUAD
] = {
2100 .type
= HDA_FIXUP_PINS
,
2101 .v
.pins
= hp_cNB11_intquad_pin_configs
,
2103 .chain_id
= STAC_92HD83XXX_HP
,
2105 [STAC_92HD83XXX_HP
] = {
2106 .type
= HDA_FIXUP_FUNC
,
2107 .v
.func
= stac92hd83xxx_fixup_hp
,
2109 [STAC_HP_DV7_4000
] = {
2110 .type
= HDA_FIXUP_PINS
,
2111 .v
.pins
= hp_dv7_4000_pin_configs
,
2113 .chain_id
= STAC_92HD83XXX_HP
,
2115 [STAC_HP_ZEPHYR
] = {
2116 .type
= HDA_FIXUP_FUNC
,
2117 .v
.func
= stac92hd83xxx_fixup_hp_zephyr
,
2119 .chain_id
= STAC_92HD83XXX_HP
,
2121 [STAC_92HD83XXX_HP_LED
] = {
2122 .type
= HDA_FIXUP_FUNC
,
2123 .v
.func
= stac92hd83xxx_fixup_hp_led
,
2125 .chain_id
= STAC_92HD83XXX_HP
,
2127 [STAC_92HD83XXX_HP_INV_LED
] = {
2128 .type
= HDA_FIXUP_FUNC
,
2129 .v
.func
= stac92hd83xxx_fixup_hp_inv_led
,
2131 .chain_id
= STAC_92HD83XXX_HP
,
2133 [STAC_92HD83XXX_HP_MIC_LED
] = {
2134 .type
= HDA_FIXUP_FUNC
,
2135 .v
.func
= stac92hd83xxx_fixup_hp_mic_led
,
2137 .chain_id
= STAC_92HD83XXX_HP
,
2139 [STAC_92HD83XXX_HEADSET_JACK
] = {
2140 .type
= HDA_FIXUP_FUNC
,
2141 .v
.func
= stac92hd83xxx_fixup_headset_jack
,
2143 [STAC_HP_ENVY_BASS
] = {
2144 .type
= HDA_FIXUP_PINS
,
2145 .v
.pins
= (const struct hda_pintbl
[]) {
2146 { 0x0f, 0x90170111 },
2152 static const struct hda_model_fixup stac92hd83xxx_models
[] = {
2153 { .id
= STAC_92HD83XXX_REF
, .name
= "ref" },
2154 { .id
= STAC_92HD83XXX_PWR_REF
, .name
= "mic-ref" },
2155 { .id
= STAC_DELL_S14
, .name
= "dell-s14" },
2156 { .id
= STAC_DELL_VOSTRO_3500
, .name
= "dell-vostro-3500" },
2157 { .id
= STAC_92HD83XXX_HP_cNB11_INTQUAD
, .name
= "hp_cNB11_intquad" },
2158 { .id
= STAC_HP_DV7_4000
, .name
= "hp-dv7-4000" },
2159 { .id
= STAC_HP_ZEPHYR
, .name
= "hp-zephyr" },
2160 { .id
= STAC_92HD83XXX_HP_LED
, .name
= "hp-led" },
2161 { .id
= STAC_92HD83XXX_HP_INV_LED
, .name
= "hp-inv-led" },
2162 { .id
= STAC_92HD83XXX_HP_MIC_LED
, .name
= "hp-mic-led" },
2163 { .id
= STAC_92HD83XXX_HEADSET_JACK
, .name
= "headset-jack" },
2164 { .id
= STAC_HP_ENVY_BASS
, .name
= "hp-envy-bass" },
2168 static const struct snd_pci_quirk stac92hd83xxx_fixup_tbl
[] = {
2169 /* SigmaTel reference board */
2170 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL
, 0x2668,
2171 "DFI LanParty", STAC_92HD83XXX_REF
),
2172 SND_PCI_QUIRK(PCI_VENDOR_ID_DFI
, 0x3101,
2173 "DFI LanParty", STAC_92HD83XXX_REF
),
2174 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL
, 0x02ba,
2175 "unknown Dell", STAC_DELL_S14
),
2176 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL
, 0x0532,
2177 "Dell Latitude E6230", STAC_92HD83XXX_HEADSET_JACK
),
2178 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL
, 0x0533,
2179 "Dell Latitude E6330", STAC_92HD83XXX_HEADSET_JACK
),
2180 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL
, 0x0534,
2181 "Dell Latitude E6430", STAC_92HD83XXX_HEADSET_JACK
),
2182 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL
, 0x0535,
2183 "Dell Latitude E6530", STAC_92HD83XXX_HEADSET_JACK
),
2184 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL
, 0x053c,
2185 "Dell Latitude E5430", STAC_92HD83XXX_HEADSET_JACK
),
2186 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL
, 0x053d,
2187 "Dell Latitude E5530", STAC_92HD83XXX_HEADSET_JACK
),
2188 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL
, 0x0549,
2189 "Dell Latitude E5430", STAC_92HD83XXX_HEADSET_JACK
),
2190 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL
, 0x057d,
2191 "Dell Latitude E6430s", STAC_92HD83XXX_HEADSET_JACK
),
2192 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL
, 0x0584,
2193 "Dell Latitude E6430U", STAC_92HD83XXX_HEADSET_JACK
),
2194 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL
, 0x1028,
2195 "Dell Vostro 3500", STAC_DELL_VOSTRO_3500
),
2196 SND_PCI_QUIRK(PCI_VENDOR_ID_HP
, 0x1656,
2197 "HP", STAC_92HD83XXX_HP_cNB11_INTQUAD
),
2198 SND_PCI_QUIRK(PCI_VENDOR_ID_HP
, 0x1657,
2199 "HP", STAC_92HD83XXX_HP_cNB11_INTQUAD
),
2200 SND_PCI_QUIRK(PCI_VENDOR_ID_HP
, 0x1658,
2201 "HP", STAC_92HD83XXX_HP_cNB11_INTQUAD
),
2202 SND_PCI_QUIRK(PCI_VENDOR_ID_HP
, 0x1659,
2203 "HP Pavilion dv7", STAC_HP_DV7_4000
),
2204 SND_PCI_QUIRK(PCI_VENDOR_ID_HP
, 0x165A,
2205 "HP", STAC_92HD83XXX_HP_cNB11_INTQUAD
),
2206 SND_PCI_QUIRK(PCI_VENDOR_ID_HP
, 0x165B,
2207 "HP", STAC_92HD83XXX_HP_cNB11_INTQUAD
),
2208 SND_PCI_QUIRK(PCI_VENDOR_ID_HP
, 0x1888,
2209 "HP Envy Spectre", STAC_HP_ENVY_BASS
),
2210 SND_PCI_QUIRK(PCI_VENDOR_ID_HP
, 0x18df,
2211 "HP Folio", STAC_92HD83XXX_HP_MIC_LED
),
2212 SND_PCI_QUIRK(PCI_VENDOR_ID_HP
, 0x3388,
2213 "HP", STAC_92HD83XXX_HP_cNB11_INTQUAD
),
2214 SND_PCI_QUIRK(PCI_VENDOR_ID_HP
, 0x3389,
2215 "HP", STAC_92HD83XXX_HP_cNB11_INTQUAD
),
2216 SND_PCI_QUIRK(PCI_VENDOR_ID_HP
, 0x355B,
2217 "HP", STAC_92HD83XXX_HP_cNB11_INTQUAD
),
2218 SND_PCI_QUIRK(PCI_VENDOR_ID_HP
, 0x355C,
2219 "HP", STAC_92HD83XXX_HP_cNB11_INTQUAD
),
2220 SND_PCI_QUIRK(PCI_VENDOR_ID_HP
, 0x355D,
2221 "HP", STAC_92HD83XXX_HP_cNB11_INTQUAD
),
2222 SND_PCI_QUIRK(PCI_VENDOR_ID_HP
, 0x355E,
2223 "HP", STAC_92HD83XXX_HP_cNB11_INTQUAD
),
2224 SND_PCI_QUIRK(PCI_VENDOR_ID_HP
, 0x355F,
2225 "HP", STAC_92HD83XXX_HP_cNB11_INTQUAD
),
2226 SND_PCI_QUIRK(PCI_VENDOR_ID_HP
, 0x3560,
2227 "HP", STAC_92HD83XXX_HP_cNB11_INTQUAD
),
2228 SND_PCI_QUIRK(PCI_VENDOR_ID_HP
, 0x358B,
2229 "HP", STAC_92HD83XXX_HP_cNB11_INTQUAD
),
2230 SND_PCI_QUIRK(PCI_VENDOR_ID_HP
, 0x358C,
2231 "HP", STAC_92HD83XXX_HP_cNB11_INTQUAD
),
2232 SND_PCI_QUIRK(PCI_VENDOR_ID_HP
, 0x358D,
2233 "HP", STAC_92HD83XXX_HP_cNB11_INTQUAD
),
2234 SND_PCI_QUIRK(PCI_VENDOR_ID_HP
, 0x3591,
2235 "HP", STAC_92HD83XXX_HP_cNB11_INTQUAD
),
2236 SND_PCI_QUIRK(PCI_VENDOR_ID_HP
, 0x3592,
2237 "HP", STAC_92HD83XXX_HP_cNB11_INTQUAD
),
2238 SND_PCI_QUIRK(PCI_VENDOR_ID_HP
, 0x3593,
2239 "HP", STAC_92HD83XXX_HP_cNB11_INTQUAD
),
2240 SND_PCI_QUIRK(PCI_VENDOR_ID_HP
, 0x3561,
2241 "HP", STAC_HP_ZEPHYR
),
2242 SND_PCI_QUIRK(PCI_VENDOR_ID_HP
, 0x3660,
2243 "HP Mini", STAC_92HD83XXX_HP_LED
),
2244 SND_PCI_QUIRK(PCI_VENDOR_ID_HP
, 0x144E,
2245 "HP Pavilion dv5", STAC_92HD83XXX_HP_INV_LED
),
2246 SND_PCI_QUIRK(PCI_VENDOR_ID_HP
, 0x148a,
2247 "HP Mini", STAC_92HD83XXX_HP_LED
),
2248 SND_PCI_QUIRK_VENDOR(PCI_VENDOR_ID_HP
, "HP", STAC_92HD83XXX_HP
),
2252 /* HP dv7 bass switch - GPIO5 */
2253 #define stac_hp_bass_gpio_info snd_ctl_boolean_mono_info
2254 static int stac_hp_bass_gpio_get(struct snd_kcontrol
*kcontrol
,
2255 struct snd_ctl_elem_value
*ucontrol
)
2257 struct hda_codec
*codec
= snd_kcontrol_chip(kcontrol
);
2258 struct sigmatel_spec
*spec
= codec
->spec
;
2259 ucontrol
->value
.integer
.value
[0] = !!(spec
->gpio_data
& 0x20);
2263 static int stac_hp_bass_gpio_put(struct snd_kcontrol
*kcontrol
,
2264 struct snd_ctl_elem_value
*ucontrol
)
2266 struct hda_codec
*codec
= snd_kcontrol_chip(kcontrol
);
2267 struct sigmatel_spec
*spec
= codec
->spec
;
2268 unsigned int gpio_data
;
2270 gpio_data
= (spec
->gpio_data
& ~0x20) |
2271 (ucontrol
->value
.integer
.value
[0] ? 0x20 : 0);
2272 if (gpio_data
== spec
->gpio_data
)
2274 spec
->gpio_data
= gpio_data
;
2275 stac_gpio_set(codec
, spec
->gpio_mask
, spec
->gpio_dir
, spec
->gpio_data
);
2279 static const struct snd_kcontrol_new stac_hp_bass_sw_ctrl
= {
2280 .iface
= SNDRV_CTL_ELEM_IFACE_MIXER
,
2281 .info
= stac_hp_bass_gpio_info
,
2282 .get
= stac_hp_bass_gpio_get
,
2283 .put
= stac_hp_bass_gpio_put
,
2286 static int stac_add_hp_bass_switch(struct hda_codec
*codec
)
2288 struct sigmatel_spec
*spec
= codec
->spec
;
2290 if (!snd_hda_gen_add_kctl(&spec
->gen
, "Bass Speaker Playback Switch",
2291 &stac_hp_bass_sw_ctrl
))
2294 spec
->gpio_mask
|= 0x20;
2295 spec
->gpio_dir
|= 0x20;
2296 spec
->gpio_data
|= 0x20;
2300 static const struct hda_pintbl ref92hd71bxx_pin_configs
[] = {
2301 { 0x0a, 0x02214030 },
2302 { 0x0b, 0x02a19040 },
2303 { 0x0c, 0x01a19020 },
2304 { 0x0d, 0x01014010 },
2305 { 0x0e, 0x0181302e },
2306 { 0x0f, 0x01014010 },
2307 { 0x14, 0x01019020 },
2308 { 0x18, 0x90a000f0 },
2309 { 0x19, 0x90a000f0 },
2310 { 0x1e, 0x01452050 },
2311 { 0x1f, 0x01452050 },
2315 static const struct hda_pintbl dell_m4_1_pin_configs
[] = {
2316 { 0x0a, 0x0421101f },
2317 { 0x0b, 0x04a11221 },
2318 { 0x0c, 0x40f000f0 },
2319 { 0x0d, 0x90170110 },
2320 { 0x0e, 0x23a1902e },
2321 { 0x0f, 0x23014250 },
2322 { 0x14, 0x40f000f0 },
2323 { 0x18, 0x90a000f0 },
2324 { 0x19, 0x40f000f0 },
2325 { 0x1e, 0x4f0000f0 },
2326 { 0x1f, 0x4f0000f0 },
2330 static const struct hda_pintbl dell_m4_2_pin_configs
[] = {
2331 { 0x0a, 0x0421101f },
2332 { 0x0b, 0x04a11221 },
2333 { 0x0c, 0x90a70330 },
2334 { 0x0d, 0x90170110 },
2335 { 0x0e, 0x23a1902e },
2336 { 0x0f, 0x23014250 },
2337 { 0x14, 0x40f000f0 },
2338 { 0x18, 0x40f000f0 },
2339 { 0x19, 0x40f000f0 },
2340 { 0x1e, 0x044413b0 },
2341 { 0x1f, 0x044413b0 },
2345 static const struct hda_pintbl dell_m4_3_pin_configs
[] = {
2346 { 0x0a, 0x0421101f },
2347 { 0x0b, 0x04a11221 },
2348 { 0x0c, 0x90a70330 },
2349 { 0x0d, 0x90170110 },
2350 { 0x0e, 0x40f000f0 },
2351 { 0x0f, 0x40f000f0 },
2352 { 0x14, 0x40f000f0 },
2353 { 0x18, 0x90a000f0 },
2354 { 0x19, 0x40f000f0 },
2355 { 0x1e, 0x044413b0 },
2356 { 0x1f, 0x044413b0 },
2360 static void stac92hd71bxx_fixup_ref(struct hda_codec
*codec
,
2361 const struct hda_fixup
*fix
, int action
)
2363 struct sigmatel_spec
*spec
= codec
->spec
;
2365 if (action
!= HDA_FIXUP_ACT_PRE_PROBE
)
2368 snd_hda_apply_pincfgs(codec
, ref92hd71bxx_pin_configs
);
2369 spec
->gpio_mask
= spec
->gpio_dir
= spec
->gpio_data
= 0;
2372 static void stac92hd71bxx_fixup_hp_m4(struct hda_codec
*codec
,
2373 const struct hda_fixup
*fix
, int action
)
2375 struct sigmatel_spec
*spec
= codec
->spec
;
2376 struct hda_jack_tbl
*jack
;
2378 if (action
!= HDA_FIXUP_ACT_PRE_PROBE
)
2381 /* Enable VREF power saving on GPIO1 detect */
2382 snd_hda_codec_write_cache(codec
, codec
->afg
, 0,
2383 AC_VERB_SET_GPIO_UNSOLICITED_RSP_MASK
, 0x02);
2384 snd_hda_jack_detect_enable_callback(codec
, codec
->afg
,
2387 jack
= snd_hda_jack_tbl_get(codec
, codec
->afg
);
2389 jack
->private_data
= 0x02;
2391 spec
->gpio_mask
|= 0x02;
2393 /* enable internal microphone */
2394 snd_hda_codec_set_pincfg(codec
, 0x0e, 0x01813040);
2397 static void stac92hd71bxx_fixup_hp_dv4(struct hda_codec
*codec
,
2398 const struct hda_fixup
*fix
, int action
)
2400 struct sigmatel_spec
*spec
= codec
->spec
;
2402 if (action
!= HDA_FIXUP_ACT_PRE_PROBE
)
2404 spec
->gpio_led
= 0x01;
2407 static void stac92hd71bxx_fixup_hp_dv5(struct hda_codec
*codec
,
2408 const struct hda_fixup
*fix
, int action
)
2413 case HDA_FIXUP_ACT_PRE_PROBE
:
2414 snd_hda_codec_set_pincfg(codec
, 0x0d, 0x90170010);
2417 case HDA_FIXUP_ACT_PROBE
:
2418 /* enable bass on HP dv7 */
2419 cap
= snd_hda_param_read(codec
, 0x1, AC_PAR_GPIO_CAP
);
2420 cap
&= AC_GPIO_IO_COUNT
;
2422 stac_add_hp_bass_switch(codec
);
2427 static void stac92hd71bxx_fixup_hp_hdx(struct hda_codec
*codec
,
2428 const struct hda_fixup
*fix
, int action
)
2430 struct sigmatel_spec
*spec
= codec
->spec
;
2432 if (action
!= HDA_FIXUP_ACT_PRE_PROBE
)
2434 spec
->gpio_led
= 0x08;
2438 static void stac92hd71bxx_fixup_hp(struct hda_codec
*codec
,
2439 const struct hda_fixup
*fix
, int action
)
2441 struct sigmatel_spec
*spec
= codec
->spec
;
2443 if (action
!= HDA_FIXUP_ACT_PRE_PROBE
)
2446 if (hp_blike_system(codec
->subsystem_id
)) {
2447 unsigned int pin_cfg
= snd_hda_codec_get_pincfg(codec
, 0x0f);
2448 if (get_defcfg_device(pin_cfg
) == AC_JACK_LINE_OUT
||
2449 get_defcfg_device(pin_cfg
) == AC_JACK_SPEAKER
||
2450 get_defcfg_device(pin_cfg
) == AC_JACK_HP_OUT
) {
2451 /* It was changed in the BIOS to just satisfy MS DTM.
2452 * Lets turn it back into slaved HP
2454 pin_cfg
= (pin_cfg
& (~AC_DEFCFG_DEVICE
))
2455 | (AC_JACK_HP_OUT
<<
2456 AC_DEFCFG_DEVICE_SHIFT
);
2457 pin_cfg
= (pin_cfg
& (~(AC_DEFCFG_DEF_ASSOC
2458 | AC_DEFCFG_SEQUENCE
)))
2460 snd_hda_codec_set_pincfg(codec
, 0x0f, pin_cfg
);
2464 if (find_mute_led_cfg(codec
, 1))
2465 snd_printd("mute LED gpio %d polarity %d\n",
2467 spec
->gpio_led_polarity
);
2471 static const struct hda_fixup stac92hd71bxx_fixups
[] = {
2472 [STAC_92HD71BXX_REF
] = {
2473 .type
= HDA_FIXUP_FUNC
,
2474 .v
.func
= stac92hd71bxx_fixup_ref
,
2476 [STAC_DELL_M4_1
] = {
2477 .type
= HDA_FIXUP_PINS
,
2478 .v
.pins
= dell_m4_1_pin_configs
,
2480 [STAC_DELL_M4_2
] = {
2481 .type
= HDA_FIXUP_PINS
,
2482 .v
.pins
= dell_m4_2_pin_configs
,
2484 [STAC_DELL_M4_3
] = {
2485 .type
= HDA_FIXUP_PINS
,
2486 .v
.pins
= dell_m4_3_pin_configs
,
2489 .type
= HDA_FIXUP_FUNC
,
2490 .v
.func
= stac92hd71bxx_fixup_hp_m4
,
2492 .chain_id
= STAC_92HD71BXX_HP
,
2495 .type
= HDA_FIXUP_FUNC
,
2496 .v
.func
= stac92hd71bxx_fixup_hp_dv4
,
2498 .chain_id
= STAC_HP_DV5
,
2501 .type
= HDA_FIXUP_FUNC
,
2502 .v
.func
= stac92hd71bxx_fixup_hp_dv5
,
2504 .chain_id
= STAC_92HD71BXX_HP
,
2507 .type
= HDA_FIXUP_FUNC
,
2508 .v
.func
= stac92hd71bxx_fixup_hp_hdx
,
2510 .chain_id
= STAC_92HD71BXX_HP
,
2512 [STAC_92HD71BXX_HP
] = {
2513 .type
= HDA_FIXUP_FUNC
,
2514 .v
.func
= stac92hd71bxx_fixup_hp
,
2518 static const struct hda_model_fixup stac92hd71bxx_models
[] = {
2519 { .id
= STAC_92HD71BXX_REF
, .name
= "ref" },
2520 { .id
= STAC_DELL_M4_1
, .name
= "dell-m4-1" },
2521 { .id
= STAC_DELL_M4_2
, .name
= "dell-m4-2" },
2522 { .id
= STAC_DELL_M4_3
, .name
= "dell-m4-3" },
2523 { .id
= STAC_HP_M4
, .name
= "hp-m4" },
2524 { .id
= STAC_HP_DV4
, .name
= "hp-dv4" },
2525 { .id
= STAC_HP_DV5
, .name
= "hp-dv5" },
2526 { .id
= STAC_HP_HDX
, .name
= "hp-hdx" },
2527 { .id
= STAC_HP_DV4
, .name
= "hp-dv4-1222nr" },
2531 static const struct snd_pci_quirk stac92hd71bxx_fixup_tbl
[] = {
2532 /* SigmaTel reference board */
2533 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL
, 0x2668,
2534 "DFI LanParty", STAC_92HD71BXX_REF
),
2535 SND_PCI_QUIRK(PCI_VENDOR_ID_DFI
, 0x3101,
2536 "DFI LanParty", STAC_92HD71BXX_REF
),
2537 SND_PCI_QUIRK_MASK(PCI_VENDOR_ID_HP
, 0xfff0, 0x1720,
2539 SND_PCI_QUIRK_MASK(PCI_VENDOR_ID_HP
, 0xfff0, 0x3080,
2541 SND_PCI_QUIRK_MASK(PCI_VENDOR_ID_HP
, 0xfff0, 0x30f0,
2542 "HP dv4-7", STAC_HP_DV4
),
2543 SND_PCI_QUIRK_MASK(PCI_VENDOR_ID_HP
, 0xfff0, 0x3600,
2544 "HP dv4-7", STAC_HP_DV5
),
2545 SND_PCI_QUIRK(PCI_VENDOR_ID_HP
, 0x3610,
2546 "HP HDX", STAC_HP_HDX
), /* HDX18 */
2547 SND_PCI_QUIRK(PCI_VENDOR_ID_HP
, 0x361a,
2548 "HP mini 1000", STAC_HP_M4
),
2549 SND_PCI_QUIRK(PCI_VENDOR_ID_HP
, 0x361b,
2550 "HP HDX", STAC_HP_HDX
), /* HDX16 */
2551 SND_PCI_QUIRK_MASK(PCI_VENDOR_ID_HP
, 0xfff0, 0x3620,
2552 "HP dv6", STAC_HP_DV5
),
2553 SND_PCI_QUIRK(PCI_VENDOR_ID_HP
, 0x3061,
2554 "HP dv6", STAC_HP_DV5
), /* HP dv6-1110ax */
2555 SND_PCI_QUIRK(PCI_VENDOR_ID_HP
, 0x363e,
2556 "HP DV6", STAC_HP_DV5
),
2557 SND_PCI_QUIRK_MASK(PCI_VENDOR_ID_HP
, 0xfff0, 0x7010,
2559 SND_PCI_QUIRK_VENDOR(PCI_VENDOR_ID_HP
, "HP", STAC_92HD71BXX_HP
),
2560 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL
, 0x0233,
2561 "unknown Dell", STAC_DELL_M4_1
),
2562 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL
, 0x0234,
2563 "unknown Dell", STAC_DELL_M4_1
),
2564 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL
, 0x0250,
2565 "unknown Dell", STAC_DELL_M4_1
),
2566 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL
, 0x024f,
2567 "unknown Dell", STAC_DELL_M4_1
),
2568 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL
, 0x024d,
2569 "unknown Dell", STAC_DELL_M4_1
),
2570 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL
, 0x0251,
2571 "unknown Dell", STAC_DELL_M4_1
),
2572 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL
, 0x0277,
2573 "unknown Dell", STAC_DELL_M4_1
),
2574 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL
, 0x0263,
2575 "unknown Dell", STAC_DELL_M4_2
),
2576 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL
, 0x0265,
2577 "unknown Dell", STAC_DELL_M4_2
),
2578 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL
, 0x0262,
2579 "unknown Dell", STAC_DELL_M4_2
),
2580 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL
, 0x0264,
2581 "unknown Dell", STAC_DELL_M4_2
),
2582 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL
, 0x02aa,
2583 "unknown Dell", STAC_DELL_M4_3
),
2587 static const struct hda_pintbl ref922x_pin_configs
[] = {
2588 { 0x0a, 0x01014010 },
2589 { 0x0b, 0x01016011 },
2590 { 0x0c, 0x01012012 },
2591 { 0x0d, 0x0221401f },
2592 { 0x0e, 0x01813122 },
2593 { 0x0f, 0x01011014 },
2594 { 0x10, 0x01441030 },
2595 { 0x11, 0x01c41030 },
2596 { 0x15, 0x40000100 },
2597 { 0x1b, 0x40000100 },
2602 STAC 922X pin configs for
2609 static const struct hda_pintbl dell_922x_d81_pin_configs
[] = {
2610 { 0x0a, 0x02214030 },
2611 { 0x0b, 0x01a19021 },
2612 { 0x0c, 0x01111012 },
2613 { 0x0d, 0x01114010 },
2614 { 0x0e, 0x02a19020 },
2615 { 0x0f, 0x01117011 },
2616 { 0x10, 0x400001f0 },
2617 { 0x11, 0x400001f1 },
2618 { 0x15, 0x01813122 },
2619 { 0x1b, 0x400001f2 },
2624 STAC 922X pin configs for
2628 static const struct hda_pintbl dell_922x_d82_pin_configs
[] = {
2629 { 0x0a, 0x02214030 },
2630 { 0x0b, 0x01a19021 },
2631 { 0x0c, 0x01111012 },
2632 { 0x0d, 0x01114010 },
2633 { 0x0e, 0x02a19020 },
2634 { 0x0f, 0x01117011 },
2635 { 0x10, 0x01451140 },
2636 { 0x11, 0x400001f0 },
2637 { 0x15, 0x01813122 },
2638 { 0x1b, 0x400001f1 },
2643 STAC 922X pin configs for
2646 static const struct hda_pintbl dell_922x_m81_pin_configs
[] = {
2647 { 0x0a, 0x0321101f },
2648 { 0x0b, 0x01112024 },
2649 { 0x0c, 0x01111222 },
2650 { 0x0d, 0x91174220 },
2651 { 0x0e, 0x03a11050 },
2652 { 0x0f, 0x01116221 },
2653 { 0x10, 0x90a70330 },
2654 { 0x11, 0x01452340 },
2655 { 0x15, 0x40C003f1 },
2656 { 0x1b, 0x405003f0 },
2661 STAC 9221 A1 pin configs for
2662 102801D7 (Dell XPS M1210)
2664 static const struct hda_pintbl dell_922x_m82_pin_configs
[] = {
2665 { 0x0a, 0x02211211 },
2666 { 0x0b, 0x408103ff },
2667 { 0x0c, 0x02a1123e },
2668 { 0x0d, 0x90100310 },
2669 { 0x0e, 0x408003f1 },
2670 { 0x0f, 0x0221121f },
2671 { 0x10, 0x03451340 },
2672 { 0x11, 0x40c003f2 },
2673 { 0x15, 0x508003f3 },
2674 { 0x1b, 0x405003f4 },
2678 static const struct hda_pintbl d945gtp3_pin_configs
[] = {
2679 { 0x0a, 0x0221401f },
2680 { 0x0b, 0x01a19022 },
2681 { 0x0c, 0x01813021 },
2682 { 0x0d, 0x01014010 },
2683 { 0x0e, 0x40000100 },
2684 { 0x0f, 0x40000100 },
2685 { 0x10, 0x40000100 },
2686 { 0x11, 0x40000100 },
2687 { 0x15, 0x02a19120 },
2688 { 0x1b, 0x40000100 },
2692 static const struct hda_pintbl d945gtp5_pin_configs
[] = {
2693 { 0x0a, 0x0221401f },
2694 { 0x0b, 0x01011012 },
2695 { 0x0c, 0x01813024 },
2696 { 0x0d, 0x01014010 },
2697 { 0x0e, 0x01a19021 },
2698 { 0x0f, 0x01016011 },
2699 { 0x10, 0x01452130 },
2700 { 0x11, 0x40000100 },
2701 { 0x15, 0x02a19320 },
2702 { 0x1b, 0x40000100 },
2706 static const struct hda_pintbl intel_mac_v1_pin_configs
[] = {
2707 { 0x0a, 0x0121e21f },
2708 { 0x0b, 0x400000ff },
2709 { 0x0c, 0x9017e110 },
2710 { 0x0d, 0x400000fd },
2711 { 0x0e, 0x400000fe },
2712 { 0x0f, 0x0181e020 },
2713 { 0x10, 0x1145e030 },
2714 { 0x11, 0x11c5e240 },
2715 { 0x15, 0x400000fc },
2716 { 0x1b, 0x400000fb },
2720 static const struct hda_pintbl intel_mac_v2_pin_configs
[] = {
2721 { 0x0a, 0x0121e21f },
2722 { 0x0b, 0x90a7012e },
2723 { 0x0c, 0x9017e110 },
2724 { 0x0d, 0x400000fd },
2725 { 0x0e, 0x400000fe },
2726 { 0x0f, 0x0181e020 },
2727 { 0x10, 0x1145e230 },
2728 { 0x11, 0x500000fa },
2729 { 0x15, 0x400000fc },
2730 { 0x1b, 0x400000fb },
2734 static const struct hda_pintbl intel_mac_v3_pin_configs
[] = {
2735 { 0x0a, 0x0121e21f },
2736 { 0x0b, 0x90a7012e },
2737 { 0x0c, 0x9017e110 },
2738 { 0x0d, 0x400000fd },
2739 { 0x0e, 0x400000fe },
2740 { 0x0f, 0x0181e020 },
2741 { 0x10, 0x1145e230 },
2742 { 0x11, 0x11c5e240 },
2743 { 0x15, 0x400000fc },
2744 { 0x1b, 0x400000fb },
2748 static const struct hda_pintbl intel_mac_v4_pin_configs
[] = {
2749 { 0x0a, 0x0321e21f },
2750 { 0x0b, 0x03a1e02e },
2751 { 0x0c, 0x9017e110 },
2752 { 0x0d, 0x9017e11f },
2753 { 0x0e, 0x400000fe },
2754 { 0x0f, 0x0381e020 },
2755 { 0x10, 0x1345e230 },
2756 { 0x11, 0x13c5e240 },
2757 { 0x15, 0x400000fc },
2758 { 0x1b, 0x400000fb },
2762 static const struct hda_pintbl intel_mac_v5_pin_configs
[] = {
2763 { 0x0a, 0x0321e21f },
2764 { 0x0b, 0x03a1e02e },
2765 { 0x0c, 0x9017e110 },
2766 { 0x0d, 0x9017e11f },
2767 { 0x0e, 0x400000fe },
2768 { 0x0f, 0x0381e020 },
2769 { 0x10, 0x1345e230 },
2770 { 0x11, 0x13c5e240 },
2771 { 0x15, 0x400000fc },
2772 { 0x1b, 0x400000fb },
2776 static const struct hda_pintbl ecs202_pin_configs
[] = {
2777 { 0x0a, 0x0221401f },
2778 { 0x0b, 0x02a19020 },
2779 { 0x0c, 0x01a19020 },
2780 { 0x0d, 0x01114010 },
2781 { 0x0e, 0x408000f0 },
2782 { 0x0f, 0x01813022 },
2783 { 0x10, 0x074510a0 },
2784 { 0x11, 0x40c400f1 },
2785 { 0x15, 0x9037012e },
2786 { 0x1b, 0x40e000f2 },
2790 /* codec SSIDs for Intel Mac sharing the same PCI SSID 8384:7680 */
2791 static const struct snd_pci_quirk stac922x_intel_mac_fixup_tbl
[] = {
2792 SND_PCI_QUIRK(0x106b, 0x0800, "Mac", STAC_INTEL_MAC_V1
),
2793 SND_PCI_QUIRK(0x106b, 0x0600, "Mac", STAC_INTEL_MAC_V2
),
2794 SND_PCI_QUIRK(0x106b, 0x0700, "Mac", STAC_INTEL_MAC_V2
),
2795 SND_PCI_QUIRK(0x106b, 0x0e00, "Mac", STAC_INTEL_MAC_V3
),
2796 SND_PCI_QUIRK(0x106b, 0x0f00, "Mac", STAC_INTEL_MAC_V3
),
2797 SND_PCI_QUIRK(0x106b, 0x1600, "Mac", STAC_INTEL_MAC_V3
),
2798 SND_PCI_QUIRK(0x106b, 0x1700, "Mac", STAC_INTEL_MAC_V3
),
2799 SND_PCI_QUIRK(0x106b, 0x0200, "Mac", STAC_INTEL_MAC_V3
),
2800 SND_PCI_QUIRK(0x106b, 0x1e00, "Mac", STAC_INTEL_MAC_V3
),
2801 SND_PCI_QUIRK(0x106b, 0x1a00, "Mac", STAC_INTEL_MAC_V4
),
2802 SND_PCI_QUIRK(0x106b, 0x0a00, "Mac", STAC_INTEL_MAC_V5
),
2803 SND_PCI_QUIRK(0x106b, 0x2200, "Mac", STAC_INTEL_MAC_V5
),
2807 static const struct hda_fixup stac922x_fixups
[];
2809 /* remap the fixup from codec SSID and apply it */
2810 static void stac922x_fixup_intel_mac_auto(struct hda_codec
*codec
,
2811 const struct hda_fixup
*fix
,
2814 if (action
!= HDA_FIXUP_ACT_PRE_PROBE
)
2816 snd_hda_pick_fixup(codec
, NULL
, stac922x_intel_mac_fixup_tbl
,
2818 if (codec
->fixup_id
!= STAC_INTEL_MAC_AUTO
)
2819 snd_hda_apply_fixup(codec
, action
);
2822 static void stac922x_fixup_intel_mac_gpio(struct hda_codec
*codec
,
2823 const struct hda_fixup
*fix
,
2826 struct sigmatel_spec
*spec
= codec
->spec
;
2828 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
2829 spec
->gpio_mask
= spec
->gpio_dir
= 0x03;
2830 spec
->gpio_data
= 0x03;
2834 static const struct hda_fixup stac922x_fixups
[] = {
2836 .type
= HDA_FIXUP_PINS
,
2837 .v
.pins
= ref922x_pin_configs
,
2840 .type
= HDA_FIXUP_PINS
,
2841 .v
.pins
= d945gtp3_pin_configs
,
2844 .type
= HDA_FIXUP_PINS
,
2845 .v
.pins
= d945gtp5_pin_configs
,
2847 [STAC_INTEL_MAC_AUTO
] = {
2848 .type
= HDA_FIXUP_FUNC
,
2849 .v
.func
= stac922x_fixup_intel_mac_auto
,
2851 [STAC_INTEL_MAC_V1
] = {
2852 .type
= HDA_FIXUP_PINS
,
2853 .v
.pins
= intel_mac_v1_pin_configs
,
2855 .chain_id
= STAC_922X_INTEL_MAC_GPIO
,
2857 [STAC_INTEL_MAC_V2
] = {
2858 .type
= HDA_FIXUP_PINS
,
2859 .v
.pins
= intel_mac_v2_pin_configs
,
2861 .chain_id
= STAC_922X_INTEL_MAC_GPIO
,
2863 [STAC_INTEL_MAC_V3
] = {
2864 .type
= HDA_FIXUP_PINS
,
2865 .v
.pins
= intel_mac_v3_pin_configs
,
2867 .chain_id
= STAC_922X_INTEL_MAC_GPIO
,
2869 [STAC_INTEL_MAC_V4
] = {
2870 .type
= HDA_FIXUP_PINS
,
2871 .v
.pins
= intel_mac_v4_pin_configs
,
2873 .chain_id
= STAC_922X_INTEL_MAC_GPIO
,
2875 [STAC_INTEL_MAC_V5
] = {
2876 .type
= HDA_FIXUP_PINS
,
2877 .v
.pins
= intel_mac_v5_pin_configs
,
2879 .chain_id
= STAC_922X_INTEL_MAC_GPIO
,
2881 [STAC_922X_INTEL_MAC_GPIO
] = {
2882 .type
= HDA_FIXUP_FUNC
,
2883 .v
.func
= stac922x_fixup_intel_mac_gpio
,
2886 .type
= HDA_FIXUP_PINS
,
2887 .v
.pins
= ecs202_pin_configs
,
2889 [STAC_922X_DELL_D81
] = {
2890 .type
= HDA_FIXUP_PINS
,
2891 .v
.pins
= dell_922x_d81_pin_configs
,
2893 [STAC_922X_DELL_D82
] = {
2894 .type
= HDA_FIXUP_PINS
,
2895 .v
.pins
= dell_922x_d82_pin_configs
,
2897 [STAC_922X_DELL_M81
] = {
2898 .type
= HDA_FIXUP_PINS
,
2899 .v
.pins
= dell_922x_m81_pin_configs
,
2901 [STAC_922X_DELL_M82
] = {
2902 .type
= HDA_FIXUP_PINS
,
2903 .v
.pins
= dell_922x_m82_pin_configs
,
2907 static const struct hda_model_fixup stac922x_models
[] = {
2908 { .id
= STAC_D945_REF
, .name
= "ref" },
2909 { .id
= STAC_D945GTP5
, .name
= "5stack" },
2910 { .id
= STAC_D945GTP3
, .name
= "3stack" },
2911 { .id
= STAC_INTEL_MAC_V1
, .name
= "intel-mac-v1" },
2912 { .id
= STAC_INTEL_MAC_V2
, .name
= "intel-mac-v2" },
2913 { .id
= STAC_INTEL_MAC_V3
, .name
= "intel-mac-v3" },
2914 { .id
= STAC_INTEL_MAC_V4
, .name
= "intel-mac-v4" },
2915 { .id
= STAC_INTEL_MAC_V5
, .name
= "intel-mac-v5" },
2916 { .id
= STAC_INTEL_MAC_AUTO
, .name
= "intel-mac-auto" },
2917 { .id
= STAC_ECS_202
, .name
= "ecs202" },
2918 { .id
= STAC_922X_DELL_D81
, .name
= "dell-d81" },
2919 { .id
= STAC_922X_DELL_D82
, .name
= "dell-d82" },
2920 { .id
= STAC_922X_DELL_M81
, .name
= "dell-m81" },
2921 { .id
= STAC_922X_DELL_M82
, .name
= "dell-m82" },
2922 /* for backward compatibility */
2923 { .id
= STAC_INTEL_MAC_V3
, .name
= "macmini" },
2924 { .id
= STAC_INTEL_MAC_V5
, .name
= "macbook" },
2925 { .id
= STAC_INTEL_MAC_V3
, .name
= "macbook-pro-v1" },
2926 { .id
= STAC_INTEL_MAC_V3
, .name
= "macbook-pro" },
2927 { .id
= STAC_INTEL_MAC_V2
, .name
= "imac-intel" },
2928 { .id
= STAC_INTEL_MAC_V3
, .name
= "imac-intel-20" },
2932 static const struct snd_pci_quirk stac922x_fixup_tbl
[] = {
2933 /* SigmaTel reference board */
2934 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL
, 0x2668,
2935 "DFI LanParty", STAC_D945_REF
),
2936 SND_PCI_QUIRK(PCI_VENDOR_ID_DFI
, 0x3101,
2937 "DFI LanParty", STAC_D945_REF
),
2938 /* Intel 945G based systems */
2939 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL
, 0x0101,
2940 "Intel D945G", STAC_D945GTP3
),
2941 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL
, 0x0202,
2942 "Intel D945G", STAC_D945GTP3
),
2943 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL
, 0x0606,
2944 "Intel D945G", STAC_D945GTP3
),
2945 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL
, 0x0601,
2946 "Intel D945G", STAC_D945GTP3
),
2947 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL
, 0x0111,
2948 "Intel D945G", STAC_D945GTP3
),
2949 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL
, 0x1115,
2950 "Intel D945G", STAC_D945GTP3
),
2951 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL
, 0x1116,
2952 "Intel D945G", STAC_D945GTP3
),
2953 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL
, 0x1117,
2954 "Intel D945G", STAC_D945GTP3
),
2955 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL
, 0x1118,
2956 "Intel D945G", STAC_D945GTP3
),
2957 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL
, 0x1119,
2958 "Intel D945G", STAC_D945GTP3
),
2959 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL
, 0x8826,
2960 "Intel D945G", STAC_D945GTP3
),
2961 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL
, 0x5049,
2962 "Intel D945G", STAC_D945GTP3
),
2963 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL
, 0x5055,
2964 "Intel D945G", STAC_D945GTP3
),
2965 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL
, 0x5048,
2966 "Intel D945G", STAC_D945GTP3
),
2967 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL
, 0x0110,
2968 "Intel D945G", STAC_D945GTP3
),
2969 /* Intel D945G 5-stack systems */
2970 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL
, 0x0404,
2971 "Intel D945G", STAC_D945GTP5
),
2972 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL
, 0x0303,
2973 "Intel D945G", STAC_D945GTP5
),
2974 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL
, 0x0013,
2975 "Intel D945G", STAC_D945GTP5
),
2976 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL
, 0x0417,
2977 "Intel D945G", STAC_D945GTP5
),
2978 /* Intel 945P based systems */
2979 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL
, 0x0b0b,
2980 "Intel D945P", STAC_D945GTP3
),
2981 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL
, 0x0112,
2982 "Intel D945P", STAC_D945GTP3
),
2983 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL
, 0x0d0d,
2984 "Intel D945P", STAC_D945GTP3
),
2985 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL
, 0x0909,
2986 "Intel D945P", STAC_D945GTP3
),
2987 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL
, 0x0505,
2988 "Intel D945P", STAC_D945GTP3
),
2989 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL
, 0x0707,
2990 "Intel D945P", STAC_D945GTP5
),
2992 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL
, 0x0204,
2993 "Intel D945", STAC_D945_REF
),
2996 /* Apple Intel Mac (Mac Mini, MacBook, MacBook Pro...) */
2997 SND_PCI_QUIRK(0x8384, 0x7680, "Mac", STAC_INTEL_MAC_AUTO
),
3000 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL
, 0x01a7,
3001 "unknown Dell", STAC_922X_DELL_D81
),
3002 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL
, 0x01a9,
3003 "unknown Dell", STAC_922X_DELL_D81
),
3004 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL
, 0x01ab,
3005 "unknown Dell", STAC_922X_DELL_D81
),
3006 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL
, 0x01ac,
3007 "unknown Dell", STAC_922X_DELL_D82
),
3008 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL
, 0x01bf,
3009 "unknown Dell", STAC_922X_DELL_M81
),
3010 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL
, 0x01d0,
3011 "unknown Dell", STAC_922X_DELL_D82
),
3012 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL
, 0x01d1,
3013 "unknown Dell", STAC_922X_DELL_D81
),
3014 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL
, 0x01d2,
3015 "unknown Dell", STAC_922X_DELL_D81
),
3016 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL
, 0x01d7,
3017 "Dell XPS M1210", STAC_922X_DELL_M82
),
3018 /* ECS/PC Chips boards */
3019 SND_PCI_QUIRK_MASK(0x1019, 0xf000, 0x2000,
3020 "ECS/PC chips", STAC_ECS_202
),
3024 static const struct hda_pintbl ref927x_pin_configs
[] = {
3025 { 0x0a, 0x02214020 },
3026 { 0x0b, 0x02a19080 },
3027 { 0x0c, 0x0181304e },
3028 { 0x0d, 0x01014010 },
3029 { 0x0e, 0x01a19040 },
3030 { 0x0f, 0x01011012 },
3031 { 0x10, 0x01016011 },
3032 { 0x11, 0x0101201f },
3033 { 0x12, 0x183301f0 },
3034 { 0x13, 0x18a001f0 },
3035 { 0x14, 0x18a001f0 },
3036 { 0x21, 0x01442070 },
3037 { 0x22, 0x01c42190 },
3038 { 0x23, 0x40000100 },
3042 static const struct hda_pintbl d965_3st_pin_configs
[] = {
3043 { 0x0a, 0x0221401f },
3044 { 0x0b, 0x02a19120 },
3045 { 0x0c, 0x40000100 },
3046 { 0x0d, 0x01014011 },
3047 { 0x0e, 0x01a19021 },
3048 { 0x0f, 0x01813024 },
3049 { 0x10, 0x40000100 },
3050 { 0x11, 0x40000100 },
3051 { 0x12, 0x40000100 },
3052 { 0x13, 0x40000100 },
3053 { 0x14, 0x40000100 },
3054 { 0x21, 0x40000100 },
3055 { 0x22, 0x40000100 },
3056 { 0x23, 0x40000100 },
3060 static const struct hda_pintbl d965_5st_pin_configs
[] = {
3061 { 0x0a, 0x02214020 },
3062 { 0x0b, 0x02a19080 },
3063 { 0x0c, 0x0181304e },
3064 { 0x0d, 0x01014010 },
3065 { 0x0e, 0x01a19040 },
3066 { 0x0f, 0x01011012 },
3067 { 0x10, 0x01016011 },
3068 { 0x11, 0x40000100 },
3069 { 0x12, 0x40000100 },
3070 { 0x13, 0x40000100 },
3071 { 0x14, 0x40000100 },
3072 { 0x21, 0x01442070 },
3073 { 0x22, 0x40000100 },
3074 { 0x23, 0x40000100 },
3078 static const struct hda_pintbl d965_5st_no_fp_pin_configs
[] = {
3079 { 0x0a, 0x40000100 },
3080 { 0x0b, 0x40000100 },
3081 { 0x0c, 0x0181304e },
3082 { 0x0d, 0x01014010 },
3083 { 0x0e, 0x01a19040 },
3084 { 0x0f, 0x01011012 },
3085 { 0x10, 0x01016011 },
3086 { 0x11, 0x40000100 },
3087 { 0x12, 0x40000100 },
3088 { 0x13, 0x40000100 },
3089 { 0x14, 0x40000100 },
3090 { 0x21, 0x01442070 },
3091 { 0x22, 0x40000100 },
3092 { 0x23, 0x40000100 },
3096 static const struct hda_pintbl dell_3st_pin_configs
[] = {
3097 { 0x0a, 0x02211230 },
3098 { 0x0b, 0x02a11220 },
3099 { 0x0c, 0x01a19040 },
3100 { 0x0d, 0x01114210 },
3101 { 0x0e, 0x01111212 },
3102 { 0x0f, 0x01116211 },
3103 { 0x10, 0x01813050 },
3104 { 0x11, 0x01112214 },
3105 { 0x12, 0x403003fa },
3106 { 0x13, 0x90a60040 },
3107 { 0x14, 0x90a60040 },
3108 { 0x21, 0x404003fb },
3109 { 0x22, 0x40c003fc },
3110 { 0x23, 0x40000100 },
3114 static void stac927x_fixup_ref_no_jd(struct hda_codec
*codec
,
3115 const struct hda_fixup
*fix
, int action
)
3117 /* no jack detecion for ref-no-jd model */
3118 if (action
== HDA_FIXUP_ACT_PRE_PROBE
)
3119 codec
->no_jack_detect
= 1;
3122 static void stac927x_fixup_ref(struct hda_codec
*codec
,
3123 const struct hda_fixup
*fix
, int action
)
3125 struct sigmatel_spec
*spec
= codec
->spec
;
3127 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
3128 snd_hda_apply_pincfgs(codec
, ref927x_pin_configs
);
3129 spec
->eapd_mask
= spec
->gpio_mask
= 0;
3130 spec
->gpio_dir
= spec
->gpio_data
= 0;
3134 static void stac927x_fixup_dell_dmic(struct hda_codec
*codec
,
3135 const struct hda_fixup
*fix
, int action
)
3137 struct sigmatel_spec
*spec
= codec
->spec
;
3139 if (action
!= HDA_FIXUP_ACT_PRE_PROBE
)
3142 if (codec
->subsystem_id
!= 0x1028022f) {
3143 /* GPIO2 High = Enable EAPD */
3144 spec
->eapd_mask
= spec
->gpio_mask
= 0x04;
3145 spec
->gpio_dir
= spec
->gpio_data
= 0x04;
3148 snd_hda_add_verbs(codec
, dell_3st_core_init
);
3149 spec
->volknob_init
= 1;
3152 static void stac927x_fixup_volknob(struct hda_codec
*codec
,
3153 const struct hda_fixup
*fix
, int action
)
3155 struct sigmatel_spec
*spec
= codec
->spec
;
3157 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
3158 snd_hda_add_verbs(codec
, stac927x_volknob_core_init
);
3159 spec
->volknob_init
= 1;
3163 static const struct hda_fixup stac927x_fixups
[] = {
3164 [STAC_D965_REF_NO_JD
] = {
3165 .type
= HDA_FIXUP_FUNC
,
3166 .v
.func
= stac927x_fixup_ref_no_jd
,
3168 .chain_id
= STAC_D965_REF
,
3171 .type
= HDA_FIXUP_FUNC
,
3172 .v
.func
= stac927x_fixup_ref
,
3175 .type
= HDA_FIXUP_PINS
,
3176 .v
.pins
= d965_3st_pin_configs
,
3178 .chain_id
= STAC_D965_VERBS
,
3181 .type
= HDA_FIXUP_PINS
,
3182 .v
.pins
= d965_5st_pin_configs
,
3184 .chain_id
= STAC_D965_VERBS
,
3186 [STAC_D965_VERBS
] = {
3187 .type
= HDA_FIXUP_VERBS
,
3188 .v
.verbs
= d965_core_init
,
3190 [STAC_D965_5ST_NO_FP
] = {
3191 .type
= HDA_FIXUP_PINS
,
3192 .v
.pins
= d965_5st_no_fp_pin_configs
,
3195 .type
= HDA_FIXUP_PINS
,
3196 .v
.pins
= dell_3st_pin_configs
,
3198 .chain_id
= STAC_927X_DELL_DMIC
,
3200 [STAC_DELL_BIOS
] = {
3201 .type
= HDA_FIXUP_PINS
,
3202 .v
.pins
= (const struct hda_pintbl
[]) {
3203 /* configure the analog microphone on some laptops */
3204 { 0x0c, 0x90a79130 },
3205 /* correct the front output jack as a hp out */
3206 { 0x0f, 0x0227011f },
3207 /* correct the front input jack as a mic */
3208 { 0x0e, 0x02a79130 },
3212 .chain_id
= STAC_927X_DELL_DMIC
,
3214 [STAC_DELL_BIOS_SPDIF
] = {
3215 .type
= HDA_FIXUP_PINS
,
3216 .v
.pins
= (const struct hda_pintbl
[]) {
3217 /* correct the device field to SPDIF out */
3218 { 0x21, 0x01442070 },
3222 .chain_id
= STAC_DELL_BIOS
,
3224 [STAC_927X_DELL_DMIC
] = {
3225 .type
= HDA_FIXUP_FUNC
,
3226 .v
.func
= stac927x_fixup_dell_dmic
,
3228 [STAC_927X_VOLKNOB
] = {
3229 .type
= HDA_FIXUP_FUNC
,
3230 .v
.func
= stac927x_fixup_volknob
,
3234 static const struct hda_model_fixup stac927x_models
[] = {
3235 { .id
= STAC_D965_REF_NO_JD
, .name
= "ref-no-jd" },
3236 { .id
= STAC_D965_REF
, .name
= "ref" },
3237 { .id
= STAC_D965_3ST
, .name
= "3stack" },
3238 { .id
= STAC_D965_5ST
, .name
= "5stack" },
3239 { .id
= STAC_D965_5ST_NO_FP
, .name
= "5stack-no-fp" },
3240 { .id
= STAC_DELL_3ST
, .name
= "dell-3stack" },
3241 { .id
= STAC_DELL_BIOS
, .name
= "dell-bios" },
3242 { .id
= STAC_927X_VOLKNOB
, .name
= "volknob" },
3246 static const struct snd_pci_quirk stac927x_fixup_tbl
[] = {
3247 /* SigmaTel reference board */
3248 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL
, 0x2668,
3249 "DFI LanParty", STAC_D965_REF
),
3250 SND_PCI_QUIRK(PCI_VENDOR_ID_DFI
, 0x3101,
3251 "DFI LanParty", STAC_D965_REF
),
3252 /* Intel 946 based systems */
3253 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL
, 0x3d01, "Intel D946", STAC_D965_3ST
),
3254 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL
, 0xa301, "Intel D946", STAC_D965_3ST
),
3255 /* 965 based 3 stack systems */
3256 SND_PCI_QUIRK_MASK(PCI_VENDOR_ID_INTEL
, 0xff00, 0x2100,
3257 "Intel D965", STAC_D965_3ST
),
3258 SND_PCI_QUIRK_MASK(PCI_VENDOR_ID_INTEL
, 0xff00, 0x2000,
3259 "Intel D965", STAC_D965_3ST
),
3260 /* Dell 3 stack systems */
3261 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL
, 0x01dd, "Dell Dimension E520", STAC_DELL_3ST
),
3262 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL
, 0x01ed, "Dell ", STAC_DELL_3ST
),
3263 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL
, 0x01f4, "Dell ", STAC_DELL_3ST
),
3264 /* Dell 3 stack systems with verb table in BIOS */
3265 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL
, 0x01f3, "Dell Inspiron 1420", STAC_DELL_BIOS
),
3266 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL
, 0x01f7, "Dell XPS M1730", STAC_DELL_BIOS
),
3267 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL
, 0x0227, "Dell Vostro 1400 ", STAC_DELL_BIOS
),
3268 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL
, 0x022e, "Dell ", STAC_DELL_BIOS_SPDIF
),
3269 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL
, 0x022f, "Dell Inspiron 1525", STAC_DELL_BIOS
),
3270 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL
, 0x0242, "Dell ", STAC_DELL_BIOS
),
3271 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL
, 0x0243, "Dell ", STAC_DELL_BIOS
),
3272 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL
, 0x02ff, "Dell ", STAC_DELL_BIOS
),
3273 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL
, 0x0209, "Dell XPS 1330", STAC_DELL_BIOS_SPDIF
),
3274 /* 965 based 5 stack systems */
3275 SND_PCI_QUIRK_MASK(PCI_VENDOR_ID_INTEL
, 0xff00, 0x2300,
3276 "Intel D965", STAC_D965_5ST
),
3277 SND_PCI_QUIRK_MASK(PCI_VENDOR_ID_INTEL
, 0xff00, 0x2500,
3278 "Intel D965", STAC_D965_5ST
),
3279 /* volume-knob fixes */
3280 SND_PCI_QUIRK_VENDOR(0x10cf, "FSC", STAC_927X_VOLKNOB
),
3284 static const struct hda_pintbl ref9205_pin_configs
[] = {
3285 { 0x0a, 0x40000100 },
3286 { 0x0b, 0x40000100 },
3287 { 0x0c, 0x01016011 },
3288 { 0x0d, 0x01014010 },
3289 { 0x0e, 0x01813122 },
3290 { 0x0f, 0x01a19021 },
3291 { 0x14, 0x01019020 },
3292 { 0x16, 0x40000100 },
3293 { 0x17, 0x90a000f0 },
3294 { 0x18, 0x90a000f0 },
3295 { 0x21, 0x01441030 },
3296 { 0x22, 0x01c41030 },
3301 STAC 9205 pin configs for
3308 10280228 (Dell Vostro 1500)
3309 10280229 (Dell Vostro 1700)
3311 static const struct hda_pintbl dell_9205_m42_pin_configs
[] = {
3312 { 0x0a, 0x0321101F },
3313 { 0x0b, 0x03A11020 },
3314 { 0x0c, 0x400003FA },
3315 { 0x0d, 0x90170310 },
3316 { 0x0e, 0x400003FB },
3317 { 0x0f, 0x400003FC },
3318 { 0x14, 0x400003FD },
3319 { 0x16, 0x40F000F9 },
3320 { 0x17, 0x90A60330 },
3321 { 0x18, 0x400003FF },
3322 { 0x21, 0x0144131F },
3323 { 0x22, 0x40C003FE },
3328 STAC 9205 pin configs for
3332 102801FF (Dell Precision M4300)
3337 static const struct hda_pintbl dell_9205_m43_pin_configs
[] = {
3338 { 0x0a, 0x0321101f },
3339 { 0x0b, 0x03a11020 },
3340 { 0x0c, 0x90a70330 },
3341 { 0x0d, 0x90170310 },
3342 { 0x0e, 0x400000fe },
3343 { 0x0f, 0x400000ff },
3344 { 0x14, 0x400000fd },
3345 { 0x16, 0x40f000f9 },
3346 { 0x17, 0x400000fa },
3347 { 0x18, 0x400000fc },
3348 { 0x21, 0x0144131f },
3349 { 0x22, 0x40c003f8 },
3350 /* Enable SPDIF in/out */
3351 { 0x1f, 0x01441030 },
3352 { 0x20, 0x1c410030 },
3356 static const struct hda_pintbl dell_9205_m44_pin_configs
[] = {
3357 { 0x0a, 0x0421101f },
3358 { 0x0b, 0x04a11020 },
3359 { 0x0c, 0x400003fa },
3360 { 0x0d, 0x90170310 },
3361 { 0x0e, 0x400003fb },
3362 { 0x0f, 0x400003fc },
3363 { 0x14, 0x400003fd },
3364 { 0x16, 0x400003f9 },
3365 { 0x17, 0x90a60330 },
3366 { 0x18, 0x400003ff },
3367 { 0x21, 0x01441340 },
3368 { 0x22, 0x40c003fe },
3372 static void stac9205_fixup_ref(struct hda_codec
*codec
,
3373 const struct hda_fixup
*fix
, int action
)
3375 struct sigmatel_spec
*spec
= codec
->spec
;
3377 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
3378 snd_hda_apply_pincfgs(codec
, ref9205_pin_configs
);
3379 /* SPDIF-In enabled */
3380 spec
->eapd_mask
= spec
->gpio_mask
= spec
->gpio_dir
= 0;
3384 static void stac9205_fixup_dell_m43(struct hda_codec
*codec
,
3385 const struct hda_fixup
*fix
, int action
)
3387 struct sigmatel_spec
*spec
= codec
->spec
;
3388 struct hda_jack_tbl
*jack
;
3390 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
3391 snd_hda_apply_pincfgs(codec
, dell_9205_m43_pin_configs
);
3393 /* Enable unsol response for GPIO4/Dock HP connection */
3394 snd_hda_codec_write_cache(codec
, codec
->afg
, 0,
3395 AC_VERB_SET_GPIO_UNSOLICITED_RSP_MASK
, 0x10);
3396 snd_hda_jack_detect_enable_callback(codec
, codec
->afg
,
3399 jack
= snd_hda_jack_tbl_get(codec
, codec
->afg
);
3401 jack
->private_data
= 0x01;
3403 spec
->gpio_dir
= 0x0b;
3404 spec
->eapd_mask
= 0x01;
3405 spec
->gpio_mask
= 0x1b;
3406 spec
->gpio_mute
= 0x10;
3407 /* GPIO0 High = EAPD, GPIO1 Low = Headphone Mute,
3410 spec
->gpio_data
= 0x01;
3414 static void stac9205_fixup_eapd(struct hda_codec
*codec
,
3415 const struct hda_fixup
*fix
, int action
)
3417 struct sigmatel_spec
*spec
= codec
->spec
;
3419 if (action
== HDA_FIXUP_ACT_PRE_PROBE
)
3420 spec
->eapd_switch
= 0;
3423 static const struct hda_fixup stac9205_fixups
[] = {
3425 .type
= HDA_FIXUP_FUNC
,
3426 .v
.func
= stac9205_fixup_ref
,
3428 [STAC_9205_DELL_M42
] = {
3429 .type
= HDA_FIXUP_PINS
,
3430 .v
.pins
= dell_9205_m42_pin_configs
,
3432 [STAC_9205_DELL_M43
] = {
3433 .type
= HDA_FIXUP_FUNC
,
3434 .v
.func
= stac9205_fixup_dell_m43
,
3436 [STAC_9205_DELL_M44
] = {
3437 .type
= HDA_FIXUP_PINS
,
3438 .v
.pins
= dell_9205_m44_pin_configs
,
3440 [STAC_9205_EAPD
] = {
3441 .type
= HDA_FIXUP_FUNC
,
3442 .v
.func
= stac9205_fixup_eapd
,
3447 static const struct hda_model_fixup stac9205_models
[] = {
3448 { .id
= STAC_9205_REF
, .name
= "ref" },
3449 { .id
= STAC_9205_DELL_M42
, .name
= "dell-m42" },
3450 { .id
= STAC_9205_DELL_M43
, .name
= "dell-m43" },
3451 { .id
= STAC_9205_DELL_M44
, .name
= "dell-m44" },
3452 { .id
= STAC_9205_EAPD
, .name
= "eapd" },
3456 static const struct snd_pci_quirk stac9205_fixup_tbl
[] = {
3457 /* SigmaTel reference board */
3458 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL
, 0x2668,
3459 "DFI LanParty", STAC_9205_REF
),
3460 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL
, 0xfb30,
3461 "SigmaTel", STAC_9205_REF
),
3462 SND_PCI_QUIRK(PCI_VENDOR_ID_DFI
, 0x3101,
3463 "DFI LanParty", STAC_9205_REF
),
3465 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL
, 0x01f1,
3466 "unknown Dell", STAC_9205_DELL_M42
),
3467 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL
, 0x01f2,
3468 "unknown Dell", STAC_9205_DELL_M42
),
3469 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL
, 0x01f8,
3470 "Dell Precision", STAC_9205_DELL_M43
),
3471 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL
, 0x01f9,
3472 "Dell Precision", STAC_9205_DELL_M43
),
3473 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL
, 0x01fa,
3474 "Dell Precision", STAC_9205_DELL_M43
),
3475 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL
, 0x01fc,
3476 "unknown Dell", STAC_9205_DELL_M42
),
3477 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL
, 0x01fd,
3478 "unknown Dell", STAC_9205_DELL_M42
),
3479 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL
, 0x01fe,
3480 "Dell Precision", STAC_9205_DELL_M43
),
3481 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL
, 0x01ff,
3482 "Dell Precision M4300", STAC_9205_DELL_M43
),
3483 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL
, 0x0204,
3484 "unknown Dell", STAC_9205_DELL_M42
),
3485 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL
, 0x0206,
3486 "Dell Precision", STAC_9205_DELL_M43
),
3487 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL
, 0x021b,
3488 "Dell Precision", STAC_9205_DELL_M43
),
3489 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL
, 0x021c,
3490 "Dell Precision", STAC_9205_DELL_M43
),
3491 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL
, 0x021f,
3492 "Dell Inspiron", STAC_9205_DELL_M44
),
3493 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL
, 0x0228,
3494 "Dell Vostro 1500", STAC_9205_DELL_M42
),
3495 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL
, 0x0229,
3496 "Dell Vostro 1700", STAC_9205_DELL_M42
),
3498 SND_PCI_QUIRK(0x107b, 0x0560, "Gateway T6834c", STAC_9205_EAPD
),
3499 SND_PCI_QUIRK(0x107b, 0x0565, "Gateway T1616", STAC_9205_EAPD
),
3503 static int stac_parse_auto_config(struct hda_codec
*codec
)
3505 struct sigmatel_spec
*spec
= codec
->spec
;
3508 err
= snd_hda_parse_pin_defcfg(codec
, &spec
->gen
.autocfg
, NULL
, 0);
3513 spec
->gen
.pcm_playback_hook
= stac_playback_pcm_hook
;
3514 spec
->gen
.pcm_capture_hook
= stac_capture_pcm_hook
;
3516 spec
->gen
.automute_hook
= stac_update_outputs
;
3517 spec
->gen
.hp_automute_hook
= stac_hp_automute
;
3518 spec
->gen
.line_automute_hook
= stac_line_automute
;
3519 spec
->gen
.mic_autoswitch_hook
= stac_mic_autoswitch
;
3521 err
= snd_hda_gen_parse_auto_config(codec
, &spec
->gen
.autocfg
);
3525 /* minimum value is actually mute */
3526 spec
->gen
.vmaster_tlv
[3] |= TLV_DB_SCALE_MUTE
;
3528 /* setup analog beep controls */
3529 if (spec
->anabeep_nid
> 0) {
3530 err
= stac_auto_create_beep_ctls(codec
,
3536 /* setup digital beep controls and input device */
3537 #ifdef CONFIG_SND_HDA_INPUT_BEEP
3538 if (spec
->digbeep_nid
> 0) {
3539 hda_nid_t nid
= spec
->digbeep_nid
;
3542 err
= stac_auto_create_beep_ctls(codec
, nid
);
3545 err
= snd_hda_attach_beep_device(codec
, nid
);
3549 /* IDT/STAC codecs have linear beep tone parameter */
3550 codec
->beep
->linear_tone
= spec
->linear_tone_beep
;
3551 /* if no beep switch is available, make its own one */
3552 caps
= query_amp_caps(codec
, nid
, HDA_OUTPUT
);
3553 if (!(caps
& AC_AMPCAP_MUTE
)) {
3554 err
= stac_beep_switch_ctl(codec
);
3563 spec
->gen
.vmaster_mute
.hook
= stac_vmaster_hook
;
3565 if (spec
->aloopback_ctl
&&
3566 snd_hda_get_bool_hint(codec
, "loopback") == 1) {
3567 if (!snd_hda_gen_add_kctl(&spec
->gen
, NULL
, spec
->aloopback_ctl
))
3571 if (spec
->have_spdif_mux
) {
3572 err
= stac_create_spdif_mux_ctls(codec
);
3577 stac_init_power_map(codec
);
3583 static int stac_init(struct hda_codec
*codec
)
3585 struct sigmatel_spec
*spec
= codec
->spec
;
3589 /* override some hints */
3590 stac_store_hints(codec
);
3593 gpio
= spec
->gpio_data
;
3594 /* turn on EAPD statically when spec->eapd_switch isn't set.
3595 * otherwise, unsol event will turn it on/off dynamically
3597 if (!spec
->eapd_switch
)
3598 gpio
|= spec
->eapd_mask
;
3599 stac_gpio_set(codec
, spec
->gpio_mask
, spec
->gpio_dir
, gpio
);
3601 snd_hda_gen_init(codec
);
3603 /* sync the power-map */
3605 snd_hda_codec_write(codec
, codec
->afg
, 0,
3606 AC_VERB_IDT_SET_POWER_MAP
,
3607 spec
->power_map_bits
);
3609 /* power down inactive ADCs */
3610 if (spec
->powerdown_adcs
) {
3611 for (i
= 0; i
< spec
->gen
.num_all_adcs
; i
++) {
3612 if (spec
->active_adcs
& (1 << i
))
3614 snd_hda_codec_write(codec
, spec
->gen
.all_adcs
[i
], 0,
3615 AC_VERB_SET_POWER_STATE
,
3623 static void stac_shutup(struct hda_codec
*codec
)
3625 struct sigmatel_spec
*spec
= codec
->spec
;
3627 snd_hda_shutup_pins(codec
);
3629 if (spec
->eapd_mask
)
3630 stac_gpio_set(codec
, spec
->gpio_mask
,
3631 spec
->gpio_dir
, spec
->gpio_data
&
3635 static void stac_free(struct hda_codec
*codec
)
3637 struct sigmatel_spec
*spec
= codec
->spec
;
3642 snd_hda_gen_spec_free(&spec
->gen
);
3644 snd_hda_detach_beep_device(codec
);
3647 #ifdef CONFIG_PROC_FS
3648 static void stac92hd_proc_hook(struct snd_info_buffer
*buffer
,
3649 struct hda_codec
*codec
, hda_nid_t nid
)
3651 if (nid
== codec
->afg
)
3652 snd_iprintf(buffer
, "Power-Map: 0x%02x\n",
3653 snd_hda_codec_read(codec
, nid
, 0,
3654 AC_VERB_IDT_GET_POWER_MAP
, 0));
3657 static void analog_loop_proc_hook(struct snd_info_buffer
*buffer
,
3658 struct hda_codec
*codec
,
3661 snd_iprintf(buffer
, "Analog Loopback: 0x%02x\n",
3662 snd_hda_codec_read(codec
, codec
->afg
, 0, verb
, 0));
3665 /* stac92hd71bxx, stac92hd73xx */
3666 static void stac92hd7x_proc_hook(struct snd_info_buffer
*buffer
,
3667 struct hda_codec
*codec
, hda_nid_t nid
)
3669 stac92hd_proc_hook(buffer
, codec
, nid
);
3670 if (nid
== codec
->afg
)
3671 analog_loop_proc_hook(buffer
, codec
, 0xfa0);
3674 static void stac9205_proc_hook(struct snd_info_buffer
*buffer
,
3675 struct hda_codec
*codec
, hda_nid_t nid
)
3677 if (nid
== codec
->afg
)
3678 analog_loop_proc_hook(buffer
, codec
, 0xfe0);
3681 static void stac927x_proc_hook(struct snd_info_buffer
*buffer
,
3682 struct hda_codec
*codec
, hda_nid_t nid
)
3684 if (nid
== codec
->afg
)
3685 analog_loop_proc_hook(buffer
, codec
, 0xfeb);
3688 #define stac92hd_proc_hook NULL
3689 #define stac92hd7x_proc_hook NULL
3690 #define stac9205_proc_hook NULL
3691 #define stac927x_proc_hook NULL
3695 static int stac_resume(struct hda_codec
*codec
)
3697 codec
->patch_ops
.init(codec
);
3698 snd_hda_codec_resume_amp(codec
);
3699 snd_hda_codec_resume_cache(codec
);
3703 static int stac_suspend(struct hda_codec
*codec
)
3709 static void stac_set_power_state(struct hda_codec
*codec
, hda_nid_t fg
,
3710 unsigned int power_state
)
3712 unsigned int afg_power_state
= power_state
;
3713 struct sigmatel_spec
*spec
= codec
->spec
;
3715 if (power_state
== AC_PWRST_D3
) {
3716 if (spec
->vref_mute_led_nid
) {
3717 /* with vref-out pin used for mute led control
3718 * codec AFG is prevented from D3 state
3720 afg_power_state
= AC_PWRST_D1
;
3722 /* this delay seems necessary to avoid click noise at power-down */
3725 snd_hda_codec_read(codec
, fg
, 0, AC_VERB_SET_POWER_STATE
,
3727 snd_hda_codec_set_power_to_all(codec
, fg
, power_state
);
3730 #define stac_suspend NULL
3731 #define stac_resume NULL
3732 #define stac_set_power_state NULL
3733 #endif /* CONFIG_PM */
3735 static const struct hda_codec_ops stac_patch_ops
= {
3736 .build_controls
= snd_hda_gen_build_controls
,
3737 .build_pcms
= snd_hda_gen_build_pcms
,
3740 .unsol_event
= snd_hda_jack_unsol_event
,
3742 .suspend
= stac_suspend
,
3743 .resume
= stac_resume
,
3745 .reboot_notify
= stac_shutup
,
3748 static int alloc_stac_spec(struct hda_codec
*codec
)
3750 struct sigmatel_spec
*spec
;
3752 spec
= kzalloc(sizeof(*spec
), GFP_KERNEL
);
3755 snd_hda_gen_spec_init(&spec
->gen
);
3757 codec
->no_trigger_sense
= 1; /* seems common with STAC/IDT codecs */
3761 static int patch_stac9200(struct hda_codec
*codec
)
3763 struct sigmatel_spec
*spec
;
3766 err
= alloc_stac_spec(codec
);
3771 spec
->linear_tone_beep
= 1;
3772 spec
->gen
.own_eapd_ctl
= 1;
3774 codec
->patch_ops
= stac_patch_ops
;
3776 snd_hda_add_verbs(codec
, stac9200_eapd_init
);
3778 snd_hda_pick_fixup(codec
, stac9200_models
, stac9200_fixup_tbl
,
3780 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PRE_PROBE
);
3782 err
= stac_parse_auto_config(codec
);
3788 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PROBE
);
3793 static int patch_stac925x(struct hda_codec
*codec
)
3795 struct sigmatel_spec
*spec
;
3798 err
= alloc_stac_spec(codec
);
3803 spec
->linear_tone_beep
= 1;
3804 spec
->gen
.own_eapd_ctl
= 1;
3806 codec
->patch_ops
= stac_patch_ops
;
3808 snd_hda_add_verbs(codec
, stac925x_core_init
);
3810 snd_hda_pick_fixup(codec
, stac925x_models
, stac925x_fixup_tbl
,
3812 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PRE_PROBE
);
3814 err
= stac_parse_auto_config(codec
);
3820 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PROBE
);
3825 static int patch_stac92hd73xx(struct hda_codec
*codec
)
3827 struct sigmatel_spec
*spec
;
3831 err
= alloc_stac_spec(codec
);
3836 spec
->linear_tone_beep
= 0;
3837 spec
->gen
.mixer_nid
= 0x1d;
3838 spec
->have_spdif_mux
= 1;
3840 num_dacs
= snd_hda_get_num_conns(codec
, 0x0a) - 1;
3841 if (num_dacs
< 3 || num_dacs
> 5) {
3842 printk(KERN_WARNING
"hda_codec: Could not determine "
3843 "number of channels defaulting to DAC count\n");
3848 case 0x3: /* 6 Channel */
3849 spec
->aloopback_ctl
= &stac92hd73xx_6ch_loopback
;
3851 case 0x4: /* 8 Channel */
3852 spec
->aloopback_ctl
= &stac92hd73xx_8ch_loopback
;
3854 case 0x5: /* 10 Channel */
3855 spec
->aloopback_ctl
= &stac92hd73xx_10ch_loopback
;
3859 spec
->aloopback_mask
= 0x01;
3860 spec
->aloopback_shift
= 8;
3862 spec
->digbeep_nid
= 0x1c;
3864 /* GPIO0 High = Enable EAPD */
3865 spec
->eapd_mask
= spec
->gpio_mask
= spec
->gpio_dir
= 0x1;
3866 spec
->gpio_data
= 0x01;
3868 spec
->eapd_switch
= 1;
3870 spec
->num_pwrs
= ARRAY_SIZE(stac92hd73xx_pwr_nids
);
3871 spec
->pwr_nids
= stac92hd73xx_pwr_nids
;
3873 spec
->gen
.own_eapd_ctl
= 1;
3874 spec
->gen
.power_down_unused
= 1;
3876 codec
->patch_ops
= stac_patch_ops
;
3878 snd_hda_pick_fixup(codec
, stac92hd73xx_models
, stac92hd73xx_fixup_tbl
,
3879 stac92hd73xx_fixups
);
3880 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PRE_PROBE
);
3882 if (!spec
->volknob_init
)
3883 snd_hda_add_verbs(codec
, stac92hd73xx_core_init
);
3885 err
= stac_parse_auto_config(codec
);
3891 codec
->proc_widget_hook
= stac92hd7x_proc_hook
;
3893 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PROBE
);
3898 static void stac_setup_gpio(struct hda_codec
*codec
)
3900 struct sigmatel_spec
*spec
= codec
->spec
;
3902 if (spec
->gpio_led
) {
3903 if (!spec
->vref_mute_led_nid
) {
3904 spec
->gpio_mask
|= spec
->gpio_led
;
3905 spec
->gpio_dir
|= spec
->gpio_led
;
3906 spec
->gpio_data
|= spec
->gpio_led
;
3908 codec
->patch_ops
.set_power_state
=
3909 stac_set_power_state
;
3913 if (spec
->mic_mute_led_gpio
) {
3914 spec
->gpio_mask
|= spec
->mic_mute_led_gpio
;
3915 spec
->gpio_dir
|= spec
->mic_mute_led_gpio
;
3916 spec
->mic_mute_led_on
= true;
3917 spec
->gpio_data
|= spec
->mic_mute_led_gpio
;
3919 spec
->gen
.cap_sync_hook
= stac_capture_led_hook
;
3923 static int patch_stac92hd83xxx(struct hda_codec
*codec
)
3925 struct sigmatel_spec
*spec
;
3928 err
= alloc_stac_spec(codec
);
3932 codec
->epss
= 0; /* longer delay needed for D3 */
3935 spec
->linear_tone_beep
= 0;
3936 spec
->gen
.own_eapd_ctl
= 1;
3937 spec
->gen
.power_down_unused
= 1;
3938 spec
->gen
.mixer_nid
= 0x1b;
3940 spec
->digbeep_nid
= 0x21;
3941 spec
->pwr_nids
= stac92hd83xxx_pwr_nids
;
3942 spec
->num_pwrs
= ARRAY_SIZE(stac92hd83xxx_pwr_nids
);
3943 spec
->default_polarity
= -1; /* no default cfg */
3945 codec
->patch_ops
= stac_patch_ops
;
3947 snd_hda_add_verbs(codec
, stac92hd83xxx_core_init
);
3949 snd_hda_pick_fixup(codec
, stac92hd83xxx_models
, stac92hd83xxx_fixup_tbl
,
3950 stac92hd83xxx_fixups
);
3951 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PRE_PROBE
);
3953 stac_setup_gpio(codec
);
3955 err
= stac_parse_auto_config(codec
);
3961 codec
->proc_widget_hook
= stac92hd_proc_hook
;
3963 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PROBE
);
3968 static int patch_stac92hd71bxx(struct hda_codec
*codec
)
3970 struct sigmatel_spec
*spec
;
3971 const struct hda_verb
*unmute_init
= stac92hd71bxx_unmute_core_init
;
3974 err
= alloc_stac_spec(codec
);
3979 spec
->linear_tone_beep
= 0;
3980 spec
->gen
.own_eapd_ctl
= 1;
3981 spec
->gen
.power_down_unused
= 1;
3982 spec
->gen
.mixer_nid
= 0x17;
3983 spec
->have_spdif_mux
= 1;
3985 codec
->patch_ops
= stac_patch_ops
;
3988 spec
->gpio_mask
= 0x01;
3989 spec
->gpio_dir
= 0x01;
3990 spec
->gpio_data
= 0x01;
3992 switch (codec
->vendor_id
) {
3993 case 0x111d76b6: /* 4 Port without Analog Mixer */
3997 case 0x111d7608: /* 5 Port with Analog Mixer */
3998 if ((codec
->revision_id
& 0xf) == 0 ||
3999 (codec
->revision_id
& 0xf) == 1)
4000 spec
->stream_delay
= 40; /* 40 milliseconds */
4004 snd_hda_codec_set_pincfg(codec
, 0x0f, 0x40f000f0);
4005 snd_hda_codec_set_pincfg(codec
, 0x19, 0x40f000f3);
4007 case 0x111d7603: /* 6 Port with Analog Mixer */
4008 if ((codec
->revision_id
& 0xf) == 1)
4009 spec
->stream_delay
= 40; /* 40 milliseconds */
4014 if (get_wcaps_type(get_wcaps(codec
, 0x28)) == AC_WID_VOL_KNB
)
4015 snd_hda_add_verbs(codec
, stac92hd71bxx_core_init
);
4017 if (get_wcaps(codec
, 0xa) & AC_WCAP_IN_AMP
)
4018 snd_hda_sequence_write_cache(codec
, unmute_init
);
4020 spec
->aloopback_ctl
= &stac92hd71bxx_loopback
;
4021 spec
->aloopback_mask
= 0x50;
4022 spec
->aloopback_shift
= 0;
4024 spec
->powerdown_adcs
= 1;
4025 spec
->digbeep_nid
= 0x26;
4026 spec
->num_pwrs
= ARRAY_SIZE(stac92hd71bxx_pwr_nids
);
4027 spec
->pwr_nids
= stac92hd71bxx_pwr_nids
;
4029 snd_hda_pick_fixup(codec
, stac92hd71bxx_models
, stac92hd71bxx_fixup_tbl
,
4030 stac92hd71bxx_fixups
);
4031 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PRE_PROBE
);
4033 stac_setup_gpio(codec
);
4035 err
= stac_parse_auto_config(codec
);
4041 codec
->proc_widget_hook
= stac92hd7x_proc_hook
;
4043 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PROBE
);
4048 static int patch_stac922x(struct hda_codec
*codec
)
4050 struct sigmatel_spec
*spec
;
4053 err
= alloc_stac_spec(codec
);
4058 spec
->linear_tone_beep
= 1;
4059 spec
->gen
.own_eapd_ctl
= 1;
4061 codec
->patch_ops
= stac_patch_ops
;
4063 snd_hda_add_verbs(codec
, stac922x_core_init
);
4065 /* Fix Mux capture level; max to 2 */
4066 snd_hda_override_amp_caps(codec
, 0x12, HDA_OUTPUT
,
4067 (0 << AC_AMPCAP_OFFSET_SHIFT
) |
4068 (2 << AC_AMPCAP_NUM_STEPS_SHIFT
) |
4069 (0x27 << AC_AMPCAP_STEP_SIZE_SHIFT
) |
4070 (0 << AC_AMPCAP_MUTE_SHIFT
));
4072 snd_hda_pick_fixup(codec
, stac922x_models
, stac922x_fixup_tbl
,
4074 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PRE_PROBE
);
4076 err
= stac_parse_auto_config(codec
);
4082 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PROBE
);
4087 static const char * const stac927x_spdif_labels
[] = {
4088 "Digital Playback", "ADAT", "Analog Mux 1",
4089 "Analog Mux 2", "Analog Mux 3", NULL
4092 static int patch_stac927x(struct hda_codec
*codec
)
4094 struct sigmatel_spec
*spec
;
4097 err
= alloc_stac_spec(codec
);
4102 spec
->linear_tone_beep
= 1;
4103 spec
->gen
.own_eapd_ctl
= 1;
4104 spec
->have_spdif_mux
= 1;
4105 spec
->spdif_labels
= stac927x_spdif_labels
;
4107 spec
->digbeep_nid
= 0x23;
4109 /* GPIO0 High = Enable EAPD */
4110 spec
->eapd_mask
= spec
->gpio_mask
= 0x01;
4111 spec
->gpio_dir
= spec
->gpio_data
= 0x01;
4113 spec
->aloopback_ctl
= &stac927x_loopback
;
4114 spec
->aloopback_mask
= 0x40;
4115 spec
->aloopback_shift
= 0;
4116 spec
->eapd_switch
= 1;
4118 codec
->patch_ops
= stac_patch_ops
;
4120 snd_hda_pick_fixup(codec
, stac927x_models
, stac927x_fixup_tbl
,
4122 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PRE_PROBE
);
4124 if (!spec
->volknob_init
)
4125 snd_hda_add_verbs(codec
, stac927x_core_init
);
4127 err
= stac_parse_auto_config(codec
);
4133 codec
->proc_widget_hook
= stac927x_proc_hook
;
4137 * The STAC927x seem to require fairly long delays for certain
4138 * command sequences. With too short delays (even if the answer
4139 * is set to RIRB properly), it results in the silence output
4140 * on some hardwares like Dell.
4142 * The below flag enables the longer delay (see get_response
4145 codec
->bus
->needs_damn_long_delay
= 1;
4147 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PROBE
);
4152 static int patch_stac9205(struct hda_codec
*codec
)
4154 struct sigmatel_spec
*spec
;
4157 err
= alloc_stac_spec(codec
);
4162 spec
->linear_tone_beep
= 1;
4163 spec
->gen
.own_eapd_ctl
= 1;
4164 spec
->have_spdif_mux
= 1;
4166 spec
->digbeep_nid
= 0x23;
4168 snd_hda_add_verbs(codec
, stac9205_core_init
);
4169 spec
->aloopback_ctl
= &stac9205_loopback
;
4171 spec
->aloopback_mask
= 0x40;
4172 spec
->aloopback_shift
= 0;
4174 /* GPIO0 High = EAPD */
4175 spec
->eapd_mask
= spec
->gpio_mask
= spec
->gpio_dir
= 0x1;
4176 spec
->gpio_data
= 0x01;
4178 /* Turn on/off EAPD per HP plugging */
4179 spec
->eapd_switch
= 1;
4181 codec
->patch_ops
= stac_patch_ops
;
4183 snd_hda_pick_fixup(codec
, stac9205_models
, stac9205_fixup_tbl
,
4185 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PRE_PROBE
);
4187 err
= stac_parse_auto_config(codec
);
4193 codec
->proc_widget_hook
= stac9205_proc_hook
;
4195 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PROBE
);
4204 static const struct hda_verb stac9872_core_init
[] = {
4205 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x1}, /* mic-sel: 0a,0d,14,02 */
4206 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
}, /* Mic-in -> 0x9 */
4210 static const struct hda_pintbl stac9872_vaio_pin_configs
[] = {
4211 { 0x0a, 0x03211020 },
4212 { 0x0b, 0x411111f0 },
4213 { 0x0c, 0x411111f0 },
4214 { 0x0d, 0x03a15030 },
4215 { 0x0e, 0x411111f0 },
4216 { 0x0f, 0x90170110 },
4217 { 0x11, 0x411111f0 },
4218 { 0x13, 0x411111f0 },
4219 { 0x14, 0x90a7013e },
4223 static const struct hda_model_fixup stac9872_models
[] = {
4224 { .id
= STAC_9872_VAIO
, .name
= "vaio" },
4228 static const struct hda_fixup stac9872_fixups
[] = {
4229 [STAC_9872_VAIO
] = {
4230 .type
= HDA_FIXUP_PINS
,
4231 .v
.pins
= stac9872_vaio_pin_configs
,
4235 static const struct snd_pci_quirk stac9872_fixup_tbl
[] = {
4236 SND_PCI_QUIRK_MASK(0x104d, 0xfff0, 0x81e0,
4237 "Sony VAIO F/S", STAC_9872_VAIO
),
4241 static int patch_stac9872(struct hda_codec
*codec
)
4243 struct sigmatel_spec
*spec
;
4246 err
= alloc_stac_spec(codec
);
4251 spec
->linear_tone_beep
= 1;
4252 spec
->gen
.own_eapd_ctl
= 1;
4254 codec
->patch_ops
= stac_patch_ops
;
4256 snd_hda_add_verbs(codec
, stac9872_core_init
);
4258 snd_hda_pick_fixup(codec
, stac9872_models
, stac9872_fixup_tbl
,
4260 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PRE_PROBE
);
4262 err
= stac_parse_auto_config(codec
);
4268 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PROBE
);
4277 static const struct hda_codec_preset snd_hda_preset_sigmatel
[] = {
4278 { .id
= 0x83847690, .name
= "STAC9200", .patch
= patch_stac9200
},
4279 { .id
= 0x83847882, .name
= "STAC9220 A1", .patch
= patch_stac922x
},
4280 { .id
= 0x83847680, .name
= "STAC9221 A1", .patch
= patch_stac922x
},
4281 { .id
= 0x83847880, .name
= "STAC9220 A2", .patch
= patch_stac922x
},
4282 { .id
= 0x83847681, .name
= "STAC9220D/9223D A2", .patch
= patch_stac922x
},
4283 { .id
= 0x83847682, .name
= "STAC9221 A2", .patch
= patch_stac922x
},
4284 { .id
= 0x83847683, .name
= "STAC9221D A2", .patch
= patch_stac922x
},
4285 { .id
= 0x83847618, .name
= "STAC9227", .patch
= patch_stac927x
},
4286 { .id
= 0x83847619, .name
= "STAC9227", .patch
= patch_stac927x
},
4287 { .id
= 0x83847616, .name
= "STAC9228", .patch
= patch_stac927x
},
4288 { .id
= 0x83847617, .name
= "STAC9228", .patch
= patch_stac927x
},
4289 { .id
= 0x83847614, .name
= "STAC9229", .patch
= patch_stac927x
},
4290 { .id
= 0x83847615, .name
= "STAC9229", .patch
= patch_stac927x
},
4291 { .id
= 0x83847620, .name
= "STAC9274", .patch
= patch_stac927x
},
4292 { .id
= 0x83847621, .name
= "STAC9274D", .patch
= patch_stac927x
},
4293 { .id
= 0x83847622, .name
= "STAC9273X", .patch
= patch_stac927x
},
4294 { .id
= 0x83847623, .name
= "STAC9273D", .patch
= patch_stac927x
},
4295 { .id
= 0x83847624, .name
= "STAC9272X", .patch
= patch_stac927x
},
4296 { .id
= 0x83847625, .name
= "STAC9272D", .patch
= patch_stac927x
},
4297 { .id
= 0x83847626, .name
= "STAC9271X", .patch
= patch_stac927x
},
4298 { .id
= 0x83847627, .name
= "STAC9271D", .patch
= patch_stac927x
},
4299 { .id
= 0x83847628, .name
= "STAC9274X5NH", .patch
= patch_stac927x
},
4300 { .id
= 0x83847629, .name
= "STAC9274D5NH", .patch
= patch_stac927x
},
4301 { .id
= 0x83847632, .name
= "STAC9202", .patch
= patch_stac925x
},
4302 { .id
= 0x83847633, .name
= "STAC9202D", .patch
= patch_stac925x
},
4303 { .id
= 0x83847634, .name
= "STAC9250", .patch
= patch_stac925x
},
4304 { .id
= 0x83847635, .name
= "STAC9250D", .patch
= patch_stac925x
},
4305 { .id
= 0x83847636, .name
= "STAC9251", .patch
= patch_stac925x
},
4306 { .id
= 0x83847637, .name
= "STAC9250D", .patch
= patch_stac925x
},
4307 { .id
= 0x83847645, .name
= "92HD206X", .patch
= patch_stac927x
},
4308 { .id
= 0x83847646, .name
= "92HD206D", .patch
= patch_stac927x
},
4309 /* The following does not take into account .id=0x83847661 when subsys =
4310 * 104D0C00 which is STAC9225s. Because of this, some SZ Notebooks are
4311 * currently not fully supported.
4313 { .id
= 0x83847661, .name
= "CXD9872RD/K", .patch
= patch_stac9872
},
4314 { .id
= 0x83847662, .name
= "STAC9872AK", .patch
= patch_stac9872
},
4315 { .id
= 0x83847664, .name
= "CXD9872AKD", .patch
= patch_stac9872
},
4316 { .id
= 0x83847698, .name
= "STAC9205", .patch
= patch_stac9205
},
4317 { .id
= 0x838476a0, .name
= "STAC9205", .patch
= patch_stac9205
},
4318 { .id
= 0x838476a1, .name
= "STAC9205D", .patch
= patch_stac9205
},
4319 { .id
= 0x838476a2, .name
= "STAC9204", .patch
= patch_stac9205
},
4320 { .id
= 0x838476a3, .name
= "STAC9204D", .patch
= patch_stac9205
},
4321 { .id
= 0x838476a4, .name
= "STAC9255", .patch
= patch_stac9205
},
4322 { .id
= 0x838476a5, .name
= "STAC9255D", .patch
= patch_stac9205
},
4323 { .id
= 0x838476a6, .name
= "STAC9254", .patch
= patch_stac9205
},
4324 { .id
= 0x838476a7, .name
= "STAC9254D", .patch
= patch_stac9205
},
4325 { .id
= 0x111d7603, .name
= "92HD75B3X5", .patch
= patch_stac92hd71bxx
},
4326 { .id
= 0x111d7604, .name
= "92HD83C1X5", .patch
= patch_stac92hd83xxx
},
4327 { .id
= 0x111d76d4, .name
= "92HD83C1C5", .patch
= patch_stac92hd83xxx
},
4328 { .id
= 0x111d7605, .name
= "92HD81B1X5", .patch
= patch_stac92hd83xxx
},
4329 { .id
= 0x111d76d5, .name
= "92HD81B1C5", .patch
= patch_stac92hd83xxx
},
4330 { .id
= 0x111d76d1, .name
= "92HD87B1/3", .patch
= patch_stac92hd83xxx
},
4331 { .id
= 0x111d76d9, .name
= "92HD87B2/4", .patch
= patch_stac92hd83xxx
},
4332 { .id
= 0x111d7666, .name
= "92HD88B3", .patch
= patch_stac92hd83xxx
},
4333 { .id
= 0x111d7667, .name
= "92HD88B1", .patch
= patch_stac92hd83xxx
},
4334 { .id
= 0x111d7668, .name
= "92HD88B2", .patch
= patch_stac92hd83xxx
},
4335 { .id
= 0x111d7669, .name
= "92HD88B4", .patch
= patch_stac92hd83xxx
},
4336 { .id
= 0x111d7608, .name
= "92HD75B2X5", .patch
= patch_stac92hd71bxx
},
4337 { .id
= 0x111d7674, .name
= "92HD73D1X5", .patch
= patch_stac92hd73xx
},
4338 { .id
= 0x111d7675, .name
= "92HD73C1X5", .patch
= patch_stac92hd73xx
},
4339 { .id
= 0x111d7676, .name
= "92HD73E1X5", .patch
= patch_stac92hd73xx
},
4340 { .id
= 0x111d76b0, .name
= "92HD71B8X", .patch
= patch_stac92hd71bxx
},
4341 { .id
= 0x111d76b1, .name
= "92HD71B8X", .patch
= patch_stac92hd71bxx
},
4342 { .id
= 0x111d76b2, .name
= "92HD71B7X", .patch
= patch_stac92hd71bxx
},
4343 { .id
= 0x111d76b3, .name
= "92HD71B7X", .patch
= patch_stac92hd71bxx
},
4344 { .id
= 0x111d76b4, .name
= "92HD71B6X", .patch
= patch_stac92hd71bxx
},
4345 { .id
= 0x111d76b5, .name
= "92HD71B6X", .patch
= patch_stac92hd71bxx
},
4346 { .id
= 0x111d76b6, .name
= "92HD71B5X", .patch
= patch_stac92hd71bxx
},
4347 { .id
= 0x111d76b7, .name
= "92HD71B5X", .patch
= patch_stac92hd71bxx
},
4348 { .id
= 0x111d76c0, .name
= "92HD89C3", .patch
= patch_stac92hd73xx
},
4349 { .id
= 0x111d76c1, .name
= "92HD89C2", .patch
= patch_stac92hd73xx
},
4350 { .id
= 0x111d76c2, .name
= "92HD89C1", .patch
= patch_stac92hd73xx
},
4351 { .id
= 0x111d76c3, .name
= "92HD89B3", .patch
= patch_stac92hd73xx
},
4352 { .id
= 0x111d76c4, .name
= "92HD89B2", .patch
= patch_stac92hd73xx
},
4353 { .id
= 0x111d76c5, .name
= "92HD89B1", .patch
= patch_stac92hd73xx
},
4354 { .id
= 0x111d76c6, .name
= "92HD89E3", .patch
= patch_stac92hd73xx
},
4355 { .id
= 0x111d76c7, .name
= "92HD89E2", .patch
= patch_stac92hd73xx
},
4356 { .id
= 0x111d76c8, .name
= "92HD89E1", .patch
= patch_stac92hd73xx
},
4357 { .id
= 0x111d76c9, .name
= "92HD89D3", .patch
= patch_stac92hd73xx
},
4358 { .id
= 0x111d76ca, .name
= "92HD89D2", .patch
= patch_stac92hd73xx
},
4359 { .id
= 0x111d76cb, .name
= "92HD89D1", .patch
= patch_stac92hd73xx
},
4360 { .id
= 0x111d76cc, .name
= "92HD89F3", .patch
= patch_stac92hd73xx
},
4361 { .id
= 0x111d76cd, .name
= "92HD89F2", .patch
= patch_stac92hd73xx
},
4362 { .id
= 0x111d76ce, .name
= "92HD89F1", .patch
= patch_stac92hd73xx
},
4363 { .id
= 0x111d76df, .name
= "92HD93BXX", .patch
= patch_stac92hd83xxx
},
4364 { .id
= 0x111d76e0, .name
= "92HD91BXX", .patch
= patch_stac92hd83xxx
},
4365 { .id
= 0x111d76e3, .name
= "92HD98BXX", .patch
= patch_stac92hd83xxx
},
4366 { .id
= 0x111d76e5, .name
= "92HD99BXX", .patch
= patch_stac92hd83xxx
},
4367 { .id
= 0x111d76e7, .name
= "92HD90BXX", .patch
= patch_stac92hd83xxx
},
4368 { .id
= 0x111d76e8, .name
= "92HD66B1X5", .patch
= patch_stac92hd83xxx
},
4369 { .id
= 0x111d76e9, .name
= "92HD66B2X5", .patch
= patch_stac92hd83xxx
},
4370 { .id
= 0x111d76ea, .name
= "92HD66B3X5", .patch
= patch_stac92hd83xxx
},
4371 { .id
= 0x111d76eb, .name
= "92HD66C1X5", .patch
= patch_stac92hd83xxx
},
4372 { .id
= 0x111d76ec, .name
= "92HD66C2X5", .patch
= patch_stac92hd83xxx
},
4373 { .id
= 0x111d76ed, .name
= "92HD66C3X5", .patch
= patch_stac92hd83xxx
},
4374 { .id
= 0x111d76ee, .name
= "92HD66B1X3", .patch
= patch_stac92hd83xxx
},
4375 { .id
= 0x111d76ef, .name
= "92HD66B2X3", .patch
= patch_stac92hd83xxx
},
4376 { .id
= 0x111d76f0, .name
= "92HD66B3X3", .patch
= patch_stac92hd83xxx
},
4377 { .id
= 0x111d76f1, .name
= "92HD66C1X3", .patch
= patch_stac92hd83xxx
},
4378 { .id
= 0x111d76f2, .name
= "92HD66C2X3", .patch
= patch_stac92hd83xxx
},
4379 { .id
= 0x111d76f3, .name
= "92HD66C3/65", .patch
= patch_stac92hd83xxx
},
4383 MODULE_ALIAS("snd-hda-codec-id:8384*");
4384 MODULE_ALIAS("snd-hda-codec-id:111d*");
4386 MODULE_LICENSE("GPL");
4387 MODULE_DESCRIPTION("IDT/Sigmatel HD-audio codec");
4389 static struct hda_codec_preset_list sigmatel_list
= {
4390 .preset
= snd_hda_preset_sigmatel
,
4391 .owner
= THIS_MODULE
,
4394 static int __init
patch_sigmatel_init(void)
4396 return snd_hda_add_codec_preset(&sigmatel_list
);
4399 static void __exit
patch_sigmatel_exit(void)
4401 snd_hda_delete_codec_preset(&sigmatel_list
);
4404 module_init(patch_sigmatel_init
)
4405 module_exit(patch_sigmatel_exit
)