[ALSA] intel8x0 - Add quirk for Compaq Deskpro EN
[safe/jmp/linux-2.6] / sound / pci / intel8x0.c
index 7cf2dcb..c52abd0 100644 (file)
@@ -1,7 +1,7 @@
 /*
  *   ALSA driver for Intel ICH (i8x0) chipsets
  *
- *     Copyright (c) 2000 Jaroslav Kysela <perex@suse.cz>
+ *     Copyright (c) 2000 Jaroslav Kysela <perex@perex.cz>
  *
  *
  *   This code also contains alpha support for SiS 735 chipsets provided
@@ -26,7 +26,6 @@
  *
  */      
 
-#include <sound/driver.h>
 #include <asm/io.h>
 #include <linux/delay.h>
 #include <linux/interrupt.h>
@@ -43,7 +42,7 @@
 #include <asm/pgtable.h>
 #include <asm/cacheflush.h>
 
-MODULE_AUTHOR("Jaroslav Kysela <perex@suse.cz>");
+MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>");
 MODULE_DESCRIPTION("Intel 82801AA,82901AB,i810,i820,i830,i840,i845,MX440; SiS 7012; Ali 5455");
 MODULE_LICENSE("GPL");
 MODULE_SUPPORTED_DEVICE("{{Intel,82801AA-ICH},"
@@ -711,11 +710,13 @@ static void snd_intel8x0_setup_periods(struct intel8x0 *chip, struct ichdev *ich
 static void fill_nocache(void *buf, int size, int nocache)
 {
        size = (size + PAGE_SIZE - 1) >> PAGE_SHIFT;
-       change_page_attr(virt_to_page(buf), size, nocache ? PAGE_KERNEL_NOCACHE : PAGE_KERNEL);
-       global_flush_tlb();
+       if (nocache)
+               set_pages_uc(virt_to_page(buf), size);
+       else
+               set_pages_wb(virt_to_page(buf), size);
 }
 #else
-#define fill_nocache(buf,size,nocache)
+#define fill_nocache(buf, size, nocache) do { ; } while (0)
 #endif
 
 /*
@@ -1707,6 +1708,12 @@ static struct ac97_pcm ac97_pcm_defs[] __devinitdata = {
 };
 
 static struct ac97_quirk ac97_quirks[] __devinitdata = {
+        {
+               .subvendor = 0x0e11,
+               .subdevice = 0x000e,
+               .name = "Compaq Deskpro EN",    /* AD1885 */
+               .type = AC97_TUNE_HP_ONLY
+        },
        {
                .subvendor = 0x0e11,
                .subdevice = 0x008a,
@@ -1739,6 +1746,12 @@ static struct ac97_quirk ac97_quirks[] __devinitdata = {
        },
        {
                .subvendor = 0x1025,
+               .subdevice = 0x0082,
+               .name = "Acer Travelmate 2310",
+               .type = AC97_TUNE_HP_ONLY
+       },
+       {
+               .subvendor = 0x1025,
                .subdevice = 0x0083,
                .name = "Acer Aspire 3003LCi",
                .type = AC97_TUNE_HP_ONLY
@@ -1799,6 +1812,18 @@ static struct ac97_quirk ac97_quirks[] __devinitdata = {
        },
        {
                .subvendor = 0x1028,
+               .subdevice = 0x0186,
+               .name = "Dell Latitude D810", /* cf. Malone #41015 */
+               .type = AC97_TUNE_HP_MUTE_LED
+       },
+       {
+               .subvendor = 0x1028,
+               .subdevice = 0x0188,
+               .name = "Dell Inspiron 6000",
+               .type = AC97_TUNE_HP_MUTE_LED /* cf. Malone #41015 */
+       },
+       {
+               .subvendor = 0x1028,
                .subdevice = 0x0191,
                .name = "Dell Inspiron 8600",
                .type = AC97_TUNE_HP_ONLY
@@ -1819,7 +1844,7 @@ static struct ac97_quirk ac97_quirks[] __devinitdata = {
                .subvendor = 0x103c,
                .subdevice = 0x088c,
                .name = "HP nc8000",
-               .type = AC97_TUNE_MUTE_LED
+               .type = AC97_TUNE_HP_MUTE_LED
        },
        {
                .subvendor = 0x103c,
@@ -1913,6 +1938,12 @@ static struct ac97_quirk ac97_quirks[] __devinitdata = {
        },
        {
                .subvendor = 0x10cf,
+               .subdevice = 0x127e,
+               .name = "Fujitsu Lifebook C1211D",
+               .type = AC97_TUNE_HP_ONLY
+       },
+       {
+               .subvendor = 0x10cf,
                .subdevice = 0x12ec,
                .name = "Fujitsu-Siemens 4010",
                .type = AC97_TUNE_HP_ONLY
@@ -2126,7 +2157,6 @@ static int __devinit snd_intel8x0_mixer(struct intel8x0 *chip, int ac97_clock,
                                snd_printk(KERN_ERR "Unable to initialize codec #%d\n", i);
                        if (i == 0)
                                goto __err;
-                       continue;
                }
        }
        /* tune up the primary codec */
@@ -2493,6 +2523,7 @@ static int intel8x0_resume(struct pci_dev *pci)
                return -EIO;
        }
        pci_set_master(pci);
+       snd_intel8x0_chip_init(chip, 0);
        if (request_irq(pci->irq, snd_intel8x0_interrupt,
                        IRQF_SHARED, card->shortname, chip)) {
                printk(KERN_ERR "intel8x0: unable to grab IRQ %d, "
@@ -2502,7 +2533,6 @@ static int intel8x0_resume(struct pci_dev *pci)
        }
        chip->irq = pci->irq;
        synchronize_irq(chip->irq);
-       snd_intel8x0_chip_init(chip, 0);
 
        /* re-initialize mixer stuff */
        if (chip->device_type == DEVICE_INTEL_ICH4 && !spdif_aclink) {
@@ -2862,16 +2892,7 @@ static int __devinit snd_intel8x0_create(struct snd_card *card,
                ICH_REG_ALI_INTERRUPTSR : ICH_REG_GLOB_STA;
        chip->int_sta_mask = int_sta_masks;
 
-       /* request irq after initializaing int_sta_mask, etc */
-       if (request_irq(pci->irq, snd_intel8x0_interrupt,
-                       IRQF_SHARED, card->shortname, chip)) {
-               snd_printk(KERN_ERR "unable to grab IRQ %d\n", pci->irq);
-               snd_intel8x0_free(chip);
-               return -EBUSY;
-       }
-       chip->irq = pci->irq;
        pci_set_master(pci);
-       synchronize_irq(chip->irq);
 
        switch(chip->device_type) {
        case DEVICE_INTEL_ICH4:
@@ -2901,6 +2922,15 @@ static int __devinit snd_intel8x0_create(struct snd_card *card,
                return err;
        }
 
+       /* request irq after initializaing int_sta_mask, etc */
+       if (request_irq(pci->irq, snd_intel8x0_interrupt,
+                       IRQF_SHARED, card->shortname, chip)) {
+               snd_printk(KERN_ERR "unable to grab IRQ %d\n", pci->irq);
+               snd_intel8x0_free(chip);
+               return -EBUSY;
+       }
+       chip->irq = pci->irq;
+
        if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops)) < 0) {
                snd_intel8x0_free(chip);
                return err;