[ALSA] hda-codec - Re-add quirk support for Dell XPS 1330 and Inspiron 1420
[pandora-kernel.git] / sound / pci / hda / patch_sigmatel.c
index f843e21..9fae4f1 100644 (file)
@@ -49,6 +49,7 @@ enum {
        STAC_9200_DELL_M25,
        STAC_9200_DELL_M26,
        STAC_9200_DELL_M27,
+       STAC_9200_GATEWAY,
        STAC_9200_MODELS
 };
 
@@ -57,7 +58,6 @@ enum {
        STAC_9205_DELL_M42,
        STAC_9205_DELL_M43,
        STAC_9205_DELL_M44,
-       STAC_9205_M43xx,
        STAC_9205_MODELS
 };
 
@@ -379,6 +379,13 @@ static struct hda_verb stac9200_core_init[] = {
        {}
 };
 
+static struct hda_verb stac9200_eapd_init[] = {
+       /* set dac0mux for dac converter */
+       {0x07, AC_VERB_SET_CONNECT_SEL, 0x00},
+       {0x08, AC_VERB_SET_EAPD_BTLENABLE, 0x02},
+       {}
+};
+
 static struct hda_verb stac925x_core_init[] = {
        /* set dac0mux for dac converter */
        { 0x06, AC_VERB_SET_CONNECT_SEL, 0x00},
@@ -694,6 +701,7 @@ static const char *stac9200_models[STAC_9200_MODELS] = {
        [STAC_9200_DELL_M25] = "dell-m25",
        [STAC_9200_DELL_M26] = "dell-m26",
        [STAC_9200_DELL_M27] = "dell-m27",
+       [STAC_9200_GATEWAY] = "gateway",
 };
 
 static struct snd_pci_quirk stac9200_cfg_tbl[] = {
@@ -761,7 +769,12 @@ static struct snd_pci_quirk stac9200_cfg_tbl[] = {
                      "unknown Dell", STAC_9200_DELL_M26),
        /* Panasonic */
        SND_PCI_QUIRK(0x10f7, 0x8338, "Panasonic CF-74", STAC_REF),
-
+       /* Gateway machines needs EAPD to be set on resume */
+       SND_PCI_QUIRK(0x107b, 0x0205, "Gateway S-7110M", STAC_9200_GATEWAY),
+       SND_PCI_QUIRK(0x107b, 0x0317, "Gateway MT3423, MX341*",
+                     STAC_9200_GATEWAY),
+       SND_PCI_QUIRK(0x107b, 0x0318, "Gateway ML3019, MT3707",
+                     STAC_9200_GATEWAY),
        {} /* terminator */
 };
 
@@ -1098,11 +1111,13 @@ static struct snd_pci_quirk stac927x_cfg_tbl[] = {
        SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2003, "Intel D965", STAC_D965_3ST),
        SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2002, "Intel D965", STAC_D965_3ST),
        SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2001, "Intel D965", STAC_D965_3ST),
+       SND_PCI_QUIRK(PCI_VENDOR_ID_DELL,  0x01f3, "Dell Inspiron 1420", STAC_D965_3ST),
        /* Dell 3 stack systems */
        SND_PCI_QUIRK(PCI_VENDOR_ID_DELL,  0x01dd, "Dell Dimension E520", STAC_DELL_3ST),
        SND_PCI_QUIRK(PCI_VENDOR_ID_DELL,  0x01ed, "Dell     ", STAC_DELL_3ST),
        SND_PCI_QUIRK(PCI_VENDOR_ID_DELL,  0x01f4, "Dell     ", STAC_DELL_3ST),
        /* 965 based 5 stack systems */
+       SND_PCI_QUIRK(PCI_VENDOR_ID_DELL,  0x0209, "Dell XPS 1330", STAC_D965_5ST),
        SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2301, "Intel D965", STAC_D965_5ST),
        SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2302, "Intel D965", STAC_D965_5ST),
        SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2303, "Intel D965", STAC_D965_5ST),
@@ -1163,7 +1178,6 @@ static unsigned int *stac9205_brd_tbl[STAC_9205_MODELS] = {
        [STAC_9205_DELL_M42] = dell_9205_m42_pin_configs,
        [STAC_9205_DELL_M43] = dell_9205_m43_pin_configs,
        [STAC_9205_DELL_M44] = dell_9205_m44_pin_configs,
-       [STAC_9205_M43xx] = NULL,
 };
 
 static const char *stac9205_models[STAC_9205_MODELS] = {
@@ -1182,9 +1196,13 @@ static struct snd_pci_quirk stac9205_cfg_tbl[] = {
        SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01f2,
                      "unknown Dell", STAC_9205_DELL_M42),
        SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01f8,
-                     "Dell Precision", STAC_9205_M43xx),
+                     "Dell Precision", STAC_9205_DELL_M43),
+       SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x021c,
+                         "Dell Precision", STAC_9205_DELL_M43),
        SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01f9,
                      "Dell Precision", STAC_9205_DELL_M43),
+       SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x021b,
+                     "Dell Precision", STAC_9205_DELL_M43),
        SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01fa,
                      "Dell Precision", STAC_9205_DELL_M43),
        SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01fc,
@@ -2490,7 +2508,10 @@ static int patch_stac9200(struct hda_codec *codec)
        spec->num_dmics = 0;
        spec->num_adcs = 1;
 
-       spec->init = stac9200_core_init;
+       if (spec->board_config == STAC_9200_GATEWAY)
+               spec->init = stac9200_eapd_init;
+       else
+               spec->init = stac9200_core_init;
        spec->mixer = stac9200_mixer;
 
        err = stac9200_parse_auto_config(codec);
@@ -2805,7 +2826,6 @@ static int patch_stac9205(struct hda_codec *codec)
        spec->multiout.dac_nids = spec->dac_nids;
        
        switch (spec->board_config){
-       case STAC_9205_M43xx:
        case STAC_9205_DELL_M43:
                /* Enable SPDIF in/out */
                stac92xx_set_config_reg(codec, 0x1f, 0x01441030);