Update of /cvsroot/alsa/alsa-kernel/pci
In directory sc8-pr-cvs1:/tmp/cvs-serv797

Modified Files:
        es1968.c 
Log Message:
- rewritten the pm whitelist as a static list.
- added more pci subsystem ids to the whitelist.



Index: es1968.c
===================================================================
RCS file: /cvsroot/alsa/alsa-kernel/pci/es1968.c,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -r1.45 -r1.46
--- es1968.c    30 Jul 2003 15:35:33 -0000      1.45
+++ es1968.c    5 Aug 2003 12:43:10 -0000       1.46
@@ -2532,6 +2532,18 @@
        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 @@
        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;
                }



-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
_______________________________________________
Alsa-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-cvslog

Reply via email to