From b6a7213f8a4804c16e2f603804a3e6edf4e56ce5 Mon Sep 17 00:00:00 2001 From: David Schleef Date: Tue, 4 Sep 2001 01:23:10 +0000 Subject: [PATCH] Added MODULE_DEVICE_TABLE() on a bunch of drivers --- comedi/drivers/amplc_pci230.c | 7 +++++++ comedi/drivers/cb_pcidas.c | 18 ++++++++++++++++-- comedi/drivers/cb_pcidas64.c | 15 +++++++++++++-- comedi/drivers/cb_pcidda.c | 16 ++++++++++++++-- comedi/drivers/das08.c | 13 +++++++++++-- comedi/drivers/dt3000.c | 16 +++++++++++++++- comedi/drivers/ni_670x.c | 10 ++++++++++ comedi/drivers/ni_pcidio.c | 18 +++++++++++++++++- comedi/drivers/ni_pcimio.c | 35 ++++++++++++++++++++++++++++++++++- comedi/drivers/rtd520.c | 13 +++++++++++-- comedi/drivers/skel.c | 13 +++++++++++++ 11 files changed, 161 insertions(+), 13 deletions(-) diff --git a/comedi/drivers/amplc_pci230.c b/comedi/drivers/amplc_pci230.c index c8eb7ce8..e0e265ff 100644 --- a/comedi/drivers/amplc_pci230.c +++ b/comedi/drivers/amplc_pci230.c @@ -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 */ diff --git a/comedi/drivers/cb_pcidas.c b/comedi/drivers/cb_pcidas.c index 6508c11d..6aa3d9d3 100644 --- a/comedi/drivers/cb_pcidas.c +++ b/comedi/drivers/cb_pcidas.c @@ -58,6 +58,7 @@ analog triggering on 1602 series #include #include #include +#include #include #include #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++) diff --git a/comedi/drivers/cb_pcidas64.c b/comedi/drivers/cb_pcidas64.c index 4456bf09..3bb43e22 100644 --- a/comedi/drivers/cb_pcidas64.c +++ b/comedi/drivers/cb_pcidas64.c @@ -53,6 +53,7 @@ TODO: #include #include #include +#include #include #include #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", diff --git a/comedi/drivers/cb_pcidda.c b/comedi/drivers/cb_pcidda.c index 8f3a13ea..99a3c1f2 100644 --- a/comedi/drivers/cb_pcidda.c +++ b/comedi/drivers/cb_pcidda.c @@ -43,12 +43,13 @@ #include #include #include +#include #include #include #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]){ diff --git a/comedi/drivers/das08.c b/comedi/drivers/das08.c index fd2b9778..253e731f 100644 --- a/comedi/drivers/das08.c +++ b/comedi/drivers/das08.c @@ -31,11 +31,14 @@ Support for pci-das08 card added by Frank M. Hess #include #include #include -#include #include #include -#include "8255.h" #include +#include + +#include + +#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) diff --git a/comedi/drivers/dt3000.c b/comedi/drivers/dt3000.c index 6bf9eb55..89ddbcd2 100644 --- a/comedi/drivers/dt3000.c +++ b/comedi/drivers/dt3000.c @@ -40,9 +40,11 @@ #include #include -#include #include #include +#include + +#include #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 */ diff --git a/comedi/drivers/ni_670x.c b/comedi/drivers/ni_670x.c index 544de355..3f2342c8 100644 --- a/comedi/drivers/ni_670x.c +++ b/comedi/drivers/ni_670x.c @@ -33,7 +33,10 @@ #include #include #include +#include + #include + #include #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 diff --git a/comedi/drivers/ni_pcidio.c b/comedi/drivers/ni_pcidio.c index 59de4184..74d9a838 100644 --- a/comedi/drivers/ni_pcidio.c +++ b/comedi/drivers/ni_pcidio.c @@ -42,10 +42,12 @@ #include #include #include -#include #include #include #include +#include + +#include #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; diff --git a/comedi/drivers/ni_pcimio.c b/comedi/drivers/ni_pcimio.c index f1990182..a85069a2 100644 --- a/comedi/drivers/ni_pcimio.c +++ b/comedi/drivers/ni_pcimio.c @@ -70,9 +70,12 @@ #include #include #include -#include #include #include +#include + +#include + #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? diff --git a/comedi/drivers/rtd520.c b/comedi/drivers/rtd520.c index c0b5bc28..bbfa2aee 100644 --- a/comedi/drivers/rtd520.c +++ b/comedi/drivers/rtd520.c @@ -83,6 +83,8 @@ #include #include #include +#include + #include #include @@ -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]) { diff --git a/comedi/drivers/skel.c b/comedi/drivers/skel.c index b8c5f1ae..8b9a4245 100644 --- a/comedi/drivers/skel.c +++ b/comedi/drivers/skel.c @@ -32,6 +32,8 @@ #include #include #include +#include +#include #include #include @@ -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 */ -- 2.26.2