Added MODULE_DEVICE_TABLE() on a bunch of drivers
authorDavid Schleef <ds@schleef.org>
Tue, 4 Sep 2001 01:23:10 +0000 (01:23 +0000)
committerDavid Schleef <ds@schleef.org>
Tue, 4 Sep 2001 01:23:10 +0000 (01:23 +0000)
comedi/drivers/amplc_pci230.c
comedi/drivers/cb_pcidas.c
comedi/drivers/cb_pcidas64.c
comedi/drivers/cb_pcidda.c
comedi/drivers/das08.c
comedi/drivers/dt3000.c
comedi/drivers/ni_670x.c
comedi/drivers/ni_pcidio.c
comedi/drivers/ni_pcimio.c
comedi/drivers/rtd520.c
comedi/drivers/skel.c

index c8eb7ce8d61923a70544e61c1adadcd9e2433d77..e0e265ffc3274ffb1982ccbe7c429c9185a83271 100644 (file)
@@ -168,6 +168,13 @@ static pci230_board pci230_boards[] = {
        have_dio:       0,
        },
 };
+
+static struct pci_device_id pci230_pci_table[] __devinitdata = {
+       { PCI_VENDOR_ID_AMPLICON, PCI_DEVICE_ID_PCI230, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
+       { PCI_VENDOR_ID_AMPLICON, PCI_DEVICE_ID_PCI260, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
+       { 0 }
+};
+MODULE_DEVICE_TABLE(pci, pci230_pci_table);
 /*
  * Useful for shorthand access to the particular board structure
  */
index 6508c11d2ea9b353d013d02424f245c76f4f3248..6aa3d9d3ea4a97a0717adeaf8aa9fd26fdafea88 100644 (file)
@@ -58,6 +58,7 @@ analog triggering on 1602 series
 #include <linux/timex.h>
 #include <linux/timer.h>
 #include <linux/pci.h>
+#include <linux/init.h>
 #include <asm/io.h>
 #include <linux/comedidev.h>
 #include "8253.h"
@@ -67,7 +68,7 @@ analog triggering on 1602 series
 //#undef CB_PCIDAS_DEBUG       // disable debugging code
 
 // PCI vendor number of ComputerBoards/MeasurementComputing
-#define PCI_VENDOR_CB  0x1307
+#define PCI_VENDOR_ID_CB       0x1307
 #define TIMER_BASE 100 // 10MHz master clock
 static const int max_fifo_size = 1024; // maximum fifo size of any supported board
 
@@ -329,6 +330,19 @@ static cb_pcidas_board cb_pcidas_boards[] =
 // Number of boards in cb_pcidas_boards
 #define N_BOARDS       (sizeof(cb_pcidas_boards) / sizeof(cb_pcidas_board))
 
+static struct pci_device_id cb_pcidas_pci_table[] __devinitdata = {
+       { PCI_VENDOR_ID_CB, 0x0001, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
+       { PCI_VENDOR_ID_CB, 0x000f, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
+       { PCI_VENDOR_ID_CB, 0x0010, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
+       { PCI_VENDOR_ID_CB, 0x0019, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
+       { PCI_VENDOR_ID_CB, 0x001c, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
+       { PCI_VENDOR_ID_CB, 0x004c, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
+       { PCI_VENDOR_ID_CB, 0x001a, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
+       { PCI_VENDOR_ID_CB, 0x001b, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
+       { 0 }
+};
+MODULE_DEVICE_TABLE(pci, cb_pcidas_pci_table);
+
 /*
  * Useful for shorthand access to the particular board structure
  */
@@ -428,7 +442,7 @@ static int cb_pcidas_attach(comedi_device *dev, comedi_devconfig *it)
        pci_for_each_dev(pcidev)
        {
                // is it not a computer boards card?
-               if(pcidev->vendor != PCI_VENDOR_CB)
+               if(pcidev->vendor != PCI_VENDOR_ID_CB)
                        continue;
                // loop through cards supported by this driver
                for(index = 0; index < N_BOARDS; index++)
index 4456bf0931dee68b348cbe2b6fafdc8ed2c35d32..3bb43e2200b81efba7c944781e56ce4839eadec7 100644 (file)
@@ -53,6 +53,7 @@ TODO:
 #include <linux/timex.h>
 #include <linux/timer.h>
 #include <linux/pci.h>
+#include <linux/init.h>
 #include <asm/io.h>
 #include <linux/comedidev.h>
 #include "8253.h"
@@ -62,7 +63,7 @@ TODO:
 //#undef PCIDAS64_DEBUG        // disable debugging code
 
 // PCI vendor number of ComputerBoards/MeasurementComputing
-#define PCI_VENDOR_CB  0x1307
+#define PCI_VENDOR_ID_CB       0x1307
 #define TIMER_BASE 25  // 40MHz master clock
 
 /* PCI-DAS64xxx base addresses */
@@ -273,6 +274,16 @@ static pcidas64_board pcidas64_boards[] =
 // Number of boards in cb_pcidas_boards
 #define N_BOARDS       (sizeof(pcidas64_boards) / sizeof(pcidas64_board))
 
+static struct pci_device_id pcidas64_pci_table[] __devinitdata = {
+       { PCI_VENDOR_ID_CB, 0x001d, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
+       { PCI_VENDOR_ID_CB, 0x001e, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
+       { PCI_VENDOR_ID_CB, 0x0035, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
+       { PCI_VENDOR_ID_CB, 0x0036, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
+       { PCI_VENDOR_ID_CB, 0x0037, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
+       { 0 }
+};
+MODULE_DEVICE_TABLE(pci, pcidas64_pci_table);
+
 /*
  * Useful for shorthand access to the particular board structure
  */
@@ -373,7 +384,7 @@ static int attach(comedi_device *dev, comedi_devconfig *it)
        pci_for_each_dev(pcidev)
        {
                // is it not a computer boards card?
-               if(pcidev->vendor != PCI_VENDOR_CB)
+               if(pcidev->vendor != PCI_VENDOR_ID_CB)
                        continue;
 #ifdef PCIDAS64_DEBUG
                printk(" found computer boards device id 0x%x on bus %i slot %i\n",
index 8f3a13ea8bce47b5891f6bacd56460fd47432b3c..99a3c1f2b94f0a5780a03835f0f0da02fe73d837 100644 (file)
 #include <linux/timex.h>
 #include <linux/timer.h>
 #include <linux/pci.h>
+#include <linux/init.h>
 #include <asm/io.h>
 #include <linux/comedidev.h>
 
 #include "8255.h"
 
-#define PCI_VENDOR_CB  0x1307  // PCI vendor number of ComputerBoards
+#define PCI_VENDOR_ID_CB       0x1307  // PCI vendor number of ComputerBoards
 #define N_BOARDS       10      // Number of boards in cb_pcidda_boards
 
 /* PCI-DDA base addresses */
@@ -176,6 +177,17 @@ static cb_pcidda_board cb_pcidda_boards[] =
        },
 };
 
+static struct pci_device_id cb_pcidda_pci_table[] __devinitdata = {
+       { PCI_VENDOR_ID_CB, 0x0020, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
+       { PCI_VENDOR_ID_CB, 0x0021, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
+       { PCI_VENDOR_ID_CB, 0x0022, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
+       { PCI_VENDOR_ID_CB, 0x0023, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
+       { PCI_VENDOR_ID_CB, 0x0024, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
+       { PCI_VENDOR_ID_CB, 0x0025, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
+       { 0 }
+};
+MODULE_DEVICE_TABLE(pci, cb_pcidda_pci_table);
+
 /*
  * Useful for shorthand access to the particular board structure
  */
@@ -251,7 +263,7 @@ static int cb_pcidda_attach(comedi_device *dev, comedi_devconfig *it)
        printk("\n");
 
        pci_for_each_dev(pcidev){
-               if(pcidev->vendor==PCI_VENDOR_CB){
+               if(pcidev->vendor==PCI_VENDOR_ID_CB){
                        if(it->options[0] || it->options[1]){
                                if(pcidev->bus->number==it->options[0] &&
                                   PCI_SLOT(pcidev->devfn)==it->options[1]){
index fd2b977858bd1550534916b1d886b60e101ef97d..253e731f197f1e2e12c101eaf4bc94ba729a7977 100644 (file)
@@ -31,11 +31,14 @@ Support for pci-das08 card added by Frank M. Hess
 #include <linux/comedidev.h>
 #include <linux/errno.h>
 #include <linux/ioport.h>
-#include <asm/io.h>
 #include <linux/malloc.h>
 #include <linux/delay.h>
-#include "8255.h"
 #include <linux/pci.h>
+#include <linux/init.h>
+
+#include <asm/io.h>
+
+#include "8255.h"
 
 
 #define PCI_VENDOR_ID_COMPUTERBOARDS 0x1307
@@ -381,6 +384,12 @@ struct das08_private_struct{
        unsigned int    pci_iobase;     // additional base address for pci-das08
 };
 
+static struct pci_device_id das08_pci_table[] __devinitdata = {
+       { PCI_VENDOR_ID_COMPUTERBOARDS, PCI_DEVICE_ID_PCIDAS08, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
+       { 0 }
+};
+MODULE_DEVICE_TABLE(pci, das08_pci_table);
+
 #define devpriv ((struct das08_private_struct *)dev->private)
 #define thisboard ((struct das08_board_struct *)dev->board_ptr)
 
index 6bf9eb5569299569efbec6e1ae9d15d8424e691c..89ddbcd215b58c3cf37f2e83ea0126d061227a52 100644 (file)
 
 #include <linux/comedidev.h>
 #include <linux/module.h>
-#include <asm/io.h>
 #include <linux/delay.h>
 #include <linux/pci.h>
+#include <linux/init.h>
+
+#include <asm/io.h>
 
 #define PCI_VENDOR_ID_DT       0x1116
 
@@ -130,6 +132,18 @@ static dt3k_boardtype dt3k_boardtypes[]={
 #define n_dt3k_boards sizeof(dt3k_boardtypes)/sizeof(dt3k_boardtype)
 #define this_board ((dt3k_boardtype *)dev->board_ptr)
 
+static struct pci_device_id dt3k_pci_table[] __devinitdata = {
+       { PCI_VENDOR_ID_DT, 0x0022, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
+       { PCI_VENDOR_ID_DT, 0x0027, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
+       { PCI_VENDOR_ID_DT, 0x0023, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
+       { PCI_VENDOR_ID_DT, 0x0024, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
+       { PCI_VENDOR_ID_DT, 0x0028, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
+       { PCI_VENDOR_ID_DT, 0x0025, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
+       { PCI_VENDOR_ID_DT, 0x0026, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
+       { 0 }
+};
+MODULE_DEVICE_TABLE(pci, dt3k_pci_table);
+
 #define DT3000_SIZE            (4*0x1000)
 
 /* dual-ported RAM location definitions */
index 544de3558d1cca503e139ee25b5f988d9eca06c9..3f2342c8ebd6050e3599d3c1104ffec133d35924 100644 (file)
 #include <linux/errno.h> 
 #include <linux/delay.h>
 #include <linux/interrupt.h>
+#include <linux/init.h>
+
 #include <asm/io.h>
+
 #include <linux/comedidev.h>
 #include "mite.h"
 
@@ -75,6 +78,13 @@ ni_670x_board ni_670x_boards[] =
        },
 };
 
+static struct pci_device_id ni_670x_pci_table[] __devinitdata = {
+       { PCI_VENDOR_ID_NATINST, 0x2c90, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
+       //{ PCI_VENDOR_ID_NATINST, 0x2c90, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
+       { 0 }
+};
+MODULE_DEVICE_TABLE(pci, ni_670x_pci_table);
+
 #define thisboard ((ni_670x_board *)dev->board_ptr)
 
 typedef struct
index 59de418479f40cef0af82235834028f36199b27d..74d9a83890f6e71986d4f6d89b6174d59d62a467 100644 (file)
 #include <linux/comedidev.h>
 #include <linux/errno.h>
 #include <linux/ioport.h>
-#include <asm/io.h>
 #include <linux/malloc.h>
 #include <linux/delay.h>
 #include <linux/irq.h>
+#include <linux/init.h>
+
+#include <asm/io.h>
 #include "mite.h"
 #include "8255.h"
 
@@ -219,6 +221,20 @@ static nidio_board nidio_boards[]={
 #define n_nidio_boards (sizeof(nidio_boards)/sizeof(nidio_boards[0]))
 #define this_board ((nidio_board *)dev->board_ptr)
 
+static struct pci_device_id ni_pcidio_pci_table[] __devinitdata = {
+       { PCI_VENDOR_ID_NATINST, 0x1150, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
+       { PCI_VENDOR_ID_NATINST, 0x1320, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
+       { PCI_VENDOR_ID_NATINST, 0x0160, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
+       { PCI_VENDOR_ID_NATINST, 0x1630, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
+       { PCI_VENDOR_ID_NATINST, 0x13c0, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
+       { PCI_VENDOR_ID_NATINST, 0x0400, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
+       { PCI_VENDOR_ID_NATINST, 0x1250, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
+       { PCI_VENDOR_ID_NATINST, 0x17d0, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
+       { PCI_VENDOR_ID_NATINST, 0x1800, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
+       { 0 }
+};
+MODULE_DEVICE_TABLE(pci, ni_pcidio_pci_table);
+
 typedef struct{
        struct mite_struct *mite;
        int boardtype;
index f1990182661055a34d58577258d49126812bbfb9..a85069a22d66684db698505b2f88ea3f3d965985 100644 (file)
 #include <linux/delay.h>
 #include <linux/mm.h>
 #include <linux/interrupt.h>
-#include <asm/io.h>
 #include <linux/malloc.h>
 #include <linux/comedidev.h>
+#include <linux/init.h>
+
+#include <asm/io.h>
+
 #include "ni_stc.h"
 #include "mite.h"
 
@@ -90,6 +93,36 @@ static struct caldac_struct *type4[]={&caldac_mb88341,&caldac_mb88341,&caldac_ad
 
 #define MAX_N_CALDACS (12+12+1)
 
+#define NI_VENDOR_ID 0x1093
+/* The following two tables must be in the same order */
+static struct pci_device_id ni_pci_table[] __devinitdata = {
+       { NI_VENDOR_ID, 0x0162, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
+       { NI_VENDOR_ID, 0x1170, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
+       { NI_VENDOR_ID, 0x11d0, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
+       { NI_VENDOR_ID, 0x1180, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
+       { NI_VENDOR_ID, 0x1190, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
+       { NI_VENDOR_ID, 0x11c0, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
+       { NI_VENDOR_ID, 0x1330, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
+       { NI_VENDOR_ID, 0x1270, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
+       { NI_VENDOR_ID, 0x1340, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
+       { NI_VENDOR_ID, 0x1350, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
+       { NI_VENDOR_ID, 0x2a60, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
+       { NI_VENDOR_ID, 0x2a70, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
+       { NI_VENDOR_ID, 0x2a80, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
+       { NI_VENDOR_ID, 0x2ab0, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
+       { NI_VENDOR_ID, 0x2ca0, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
+       { NI_VENDOR_ID, 0x2c80, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
+       { NI_VENDOR_ID, 0x18b0, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
+       { NI_VENDOR_ID, 0x14e0, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
+       { NI_VENDOR_ID, 0x14f0, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
+       { NI_VENDOR_ID, 0x1880, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
+       { NI_VENDOR_ID, 0x1870, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
+       { NI_VENDOR_ID, 0x15b0, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
+       { NI_VENDOR_ID, 0x11b0, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
+       { NI_VENDOR_ID, 0x18c0, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
+       { 0 }
+};
+MODULE_DEVICE_TABLE(pci, ni_pci_table);
 
 static ni_board ni_boards[]={
        {       device_id:      0x0162, // NI also says 0x1620.  typo?
index c0b5bc282f0aa9eceee9847fe89f333ea1f1938c..bbfa2aeef94cc117b0268df98c62c696fb1357e2 100644 (file)
@@ -83,6 +83,8 @@
 #include <linux/timex.h>
 #include <linux/timer.h>
 #include <linux/pci.h>
+#include <linux/init.h>
+
 #include <asm/io.h>
 #include <linux/comedidev.h>
 
@@ -92,7 +94,7 @@
 ======================================================================*/
 
 /* registers  */
-#define RTD_VENDOR_ID  0x1435
+#define PCI_VENDOR_ID_RTD      0x1435
 /*
   The board has three memory windows: las0, las1, and lcfg (the PCI chip)
   Las1 has the data and can be burst DMAed 32bits at a time.
@@ -217,6 +219,13 @@ static rtdBoard rtd520Boards[] = {
     },
 };
 
+static struct pci_device_id rtd520_pci_table[] __devinitdata = {
+       { PCI_VENDOR_ID_RTD, 0x7520, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
+       { PCI_VENDOR_ID_RTD, 0x4520, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
+       { 0 }
+};
+MODULE_DEVICE_TABLE(pci, rtd520_pci_table);
+
 /*
  * Useful for shorthand access to the particular board structure
  */
@@ -558,7 +567,7 @@ static int rtd_attach (
      * Probe the device to determine what device in the series it is.
      */
     pci_for_each_dev (pcidev) {
-       if (pcidev->vendor == RTD_VENDOR_ID) {
+       if (pcidev->vendor == PCI_VENDOR_ID_RTD) {
            if (it->options[0] || it->options[1]) {
                if (pcidev->bus->number == it->options[0]
                    && PCI_SLOT(pcidev->devfn) == it->options[1]) {
index b8c5f1aeb8f2a58772fd68e36acd3e2c4f5042f4..8b9a424572749f7c801a9f5fac4cfe6c0aa634b6 100644 (file)
@@ -32,6 +32,8 @@
 #include <linux/interrupt.h>
 #include <linux/timex.h>
 #include <linux/timer.h>
+#include <linux/init.h>
+#include <linux/pci.h>
 #include <asm/io.h>
 #include <linux/comedidev.h>
 
@@ -68,6 +70,17 @@ static skel_board skel_boards[] = {
        have_dio:       0,
        },
 };
+
+/* This is used by modprobe to translate PCI IDs to drivers.  Should
+ * only be used for PCI and ISA-PnP devices */
+#define PCI_VENDOR_ID_SKEL 0xdafe
+static struct pci_device_id skel_pci_table[] __devinitdata = {
+       { PCI_VENDOR_ID_SKEL, 0x0100, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
+       { PCI_VENDOR_ID_SKEL, 0x0200, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
+       { 0 }
+};
+MODULE_DEVICE_TABLE(pci, skel_pci_table);
+
 /*
  * Useful for shorthand access to the particular board structure
  */