]> git.hungrycats.org Git - linux/commitdiff
ALSA CVS update
authorJaroslav Kysela <perex@suse.cz>
Wed, 20 Aug 2003 23:15:44 +0000 (01:15 +0200)
committerJaroslav Kysela <perex@suse.cz>
Wed, 20 Aug 2003 23:15:44 +0000 (01:15 +0200)
D:2003/08/05 13:43:10
A:Takashi Iwai <tiwai@suse.de>
F:pci/es1968.c:1.45->1.46
L:- rewritten the pm whitelist as a static list.
L:- added more pci subsystem ids to the whitelist.

sound/pci/es1968.c

index 7db8f7818aaef3afdf2ccddf1c0723fcfe3926b7..22402da5611b5a12025c4881766934aabe5a0bf9 100644 (file)
@@ -2532,6 +2532,18 @@ static int snd_es1968_dev_free(snd_device_t *device)
        return snd_es1968_free(chip);
 }
 
+struct pm_whitelist {
+       unsigned short type;    /* chip type */
+       unsigned short vendor;  /* subsystem vendor id */
+};
+
+static struct pm_whitelist whitelist[] __devinitdata = {
+       { TYPE_MAESTRO2E, 0x1028 },
+       { TYPE_MAESTRO2E, 0x103c },
+       { TYPE_MAESTRO2E, 0x1179 },
+       { TYPE_MAESTRO2E, 0x14c0 },
+};
+
 static int __devinit snd_es1968_create(snd_card_t * card,
                                       struct pci_dev *pci,
                                       int total_bufsize,
@@ -2607,12 +2619,18 @@ static int __devinit snd_es1968_create(snd_card_t * card,
        pci_set_master(pci);
 
        if (do_pm > 1) {
-               /* disable power-management if not maestro2e or
-                * if not on the whitelist
-                */
+               /* disable power-management if not on the whitelist */
                unsigned short vend;
                pci_read_config_word(chip->pci, PCI_SUBSYSTEM_VENDOR_ID, &vend);
-               if (chip->type != TYPE_MAESTRO2E || (vend != 0x1028 && vend != 0x1179)) {
+               for (i = 0; i < (int)ARRAY_SIZE(whitelist); i++) {
+                       if (chip->type == whitelist[i].type &&
+                           vend == whitelist[i].vendor) {
+                               do_pm = 1;
+                               break;
+                       }
+               }
+               if (do_pm > 1) {
+                       /* not matched; disabling pm */
                        printk(KERN_INFO "es1968: not attempting power management.\n");
                        do_pm = 0;
                }