Commit 852d3f91 authored by Ian Abbott's avatar Ian Abbott Committed by Greg Kroah-Hartman

staging: comedi: daqboard2000: use shorter, consistent prefix

Use a consistent prefix of `db2k_` or `DB2K_` for identifiers.  The
existing prefixes `DAQBOARD2000_` and `daqboard2000_` are a bit on the
lengthy side.
Signed-off-by: default avatarIan Abbott <abbotti@mev.co.uk>
Reviewed-by: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 1c5a6eab
...@@ -111,12 +111,12 @@ ...@@ -111,12 +111,12 @@
#include "8255.h" #include "8255.h"
#include "plx9080.h" #include "plx9080.h"
#define DAQBOARD2000_FIRMWARE "daqboard2000_firmware.bin" #define DB2K_FIRMWARE "daqboard2000_firmware.bin"
#define DAQBOARD2000_SUBSYSTEM_IDS2 0x0002 /* Daqboard/2000 - 2 Dacs */ #define DB2K_SUBSYSTEM_IDS2 0x0002 /* Daqboard/2000 - 2 Dacs */
#define DAQBOARD2000_SUBSYSTEM_IDS4 0x0004 /* Daqboard/2000 - 4 Dacs */ #define DB2K_SUBSYSTEM_IDS4 0x0004 /* Daqboard/2000 - 4 Dacs */
static const struct comedi_lrange range_daqboard2000_ai = { static const struct comedi_lrange db2k_ai_range = {
13, { 13, {
BIP_RANGE(10), BIP_RANGE(10),
BIP_RANGE(5), BIP_RANGE(5),
...@@ -245,30 +245,28 @@ static const struct comedi_lrange range_daqboard2000_ai = { ...@@ -245,30 +245,28 @@ static const struct comedi_lrange range_daqboard2000_ai = {
/* "New CPLD" signature. */ /* "New CPLD" signature. */
#define DB2K_CPLD_VERSION_NEW 0x5000 #define DB2K_CPLD_VERSION_NEW 0x5000
struct daq200_boardtype { struct db2k_boardtype {
const char *name; const char *name;
int id; int id;
}; };
static const struct daq200_boardtype boardtypes[] = { static const struct db2k_boardtype db2k_boardtypes[] = {
{"ids2", DAQBOARD2000_SUBSYSTEM_IDS2}, {"ids2", DB2K_SUBSYSTEM_IDS2},
{"ids4", DAQBOARD2000_SUBSYSTEM_IDS4}, {"ids4", DB2K_SUBSYSTEM_IDS4},
}; };
struct daqboard2000_private { struct db2k_private {
void __iomem *plx; void __iomem *plx;
}; };
static void daqboard2000_write_acq_scan_list_entry(struct comedi_device *dev, static void db2k_write_acq_scan_list_entry(struct comedi_device *dev, u16 entry)
u16 entry)
{ {
writew(entry & 0x00ff, dev->mmio + DB2K_REG_ACQ_SCAN_LIST_FIFO); writew(entry & 0x00ff, dev->mmio + DB2K_REG_ACQ_SCAN_LIST_FIFO);
writew((entry >> 8) & 0x00ff, writew((entry >> 8) & 0x00ff,
dev->mmio + DB2K_REG_ACQ_SCAN_LIST_FIFO); dev->mmio + DB2K_REG_ACQ_SCAN_LIST_FIFO);
} }
static void daqboard2000_setup_sampling(struct comedi_device *dev, int chan, static void db2k_setup_sampling(struct comedi_device *dev, int chan, int gain)
int gain)
{ {
u16 word0, word1, word2, word3; u16 word0, word1, word2, word3;
...@@ -302,16 +300,14 @@ static void daqboard2000_setup_sampling(struct comedi_device *dev, int chan, ...@@ -302,16 +300,14 @@ static void daqboard2000_setup_sampling(struct comedi_device *dev, int chan,
/* These should be read from EEPROM */ /* These should be read from EEPROM */
word2 |= 0x0800; /* offset */ word2 |= 0x0800; /* offset */
word3 |= 0xc000; /* gain */ word3 |= 0xc000; /* gain */
daqboard2000_write_acq_scan_list_entry(dev, word0); db2k_write_acq_scan_list_entry(dev, word0);
daqboard2000_write_acq_scan_list_entry(dev, word1); db2k_write_acq_scan_list_entry(dev, word1);
daqboard2000_write_acq_scan_list_entry(dev, word2); db2k_write_acq_scan_list_entry(dev, word2);
daqboard2000_write_acq_scan_list_entry(dev, word3); db2k_write_acq_scan_list_entry(dev, word3);
} }
static int daqboard2000_ai_status(struct comedi_device *dev, static int db2k_ai_status(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_subdevice *s, struct comedi_insn *insn, unsigned long context)
struct comedi_insn *insn,
unsigned long context)
{ {
unsigned int status; unsigned int status;
...@@ -321,10 +317,9 @@ static int daqboard2000_ai_status(struct comedi_device *dev, ...@@ -321,10 +317,9 @@ static int daqboard2000_ai_status(struct comedi_device *dev,
return -EBUSY; return -EBUSY;
} }
static int daqboard2000_ai_insn_read(struct comedi_device *dev, static int db2k_ai_insn_read(struct comedi_device *dev,
struct comedi_subdevice *s, struct comedi_subdevice *s,
struct comedi_insn *insn, struct comedi_insn *insn, unsigned int *data)
unsigned int *data)
{ {
int gain, chan; int gain, chan;
int ret; int ret;
...@@ -353,12 +348,12 @@ static int daqboard2000_ai_insn_read(struct comedi_device *dev, ...@@ -353,12 +348,12 @@ static int daqboard2000_ai_insn_read(struct comedi_device *dev,
* forced to fix it. --ds * forced to fix it. --ds
*/ */
for (i = 0; i < insn->n; i++) { for (i = 0; i < insn->n; i++) {
daqboard2000_setup_sampling(dev, chan, gain); db2k_setup_sampling(dev, chan, gain);
/* Enable reading from the scanlist FIFO */ /* Enable reading from the scanlist FIFO */
writew(DB2K_ACQ_CONTROL_SEQ_START_SCAN_LIST, writew(DB2K_ACQ_CONTROL_SEQ_START_SCAN_LIST,
dev->mmio + DB2K_REG_ACQ_CONTROL); dev->mmio + DB2K_REG_ACQ_CONTROL);
ret = comedi_timeout(dev, s, insn, daqboard2000_ai_status, ret = comedi_timeout(dev, s, insn, db2k_ai_status,
DB2K_ACQ_STATUS_CONFIG_PIPE_FULL); DB2K_ACQ_STATUS_CONFIG_PIPE_FULL);
if (ret) if (ret)
return ret; return ret;
...@@ -366,13 +361,13 @@ static int daqboard2000_ai_insn_read(struct comedi_device *dev, ...@@ -366,13 +361,13 @@ static int daqboard2000_ai_insn_read(struct comedi_device *dev,
writew(DB2K_ACQ_CONTROL_ADC_PACER_ENABLE, writew(DB2K_ACQ_CONTROL_ADC_PACER_ENABLE,
dev->mmio + DB2K_REG_ACQ_CONTROL); dev->mmio + DB2K_REG_ACQ_CONTROL);
ret = comedi_timeout(dev, s, insn, daqboard2000_ai_status, ret = comedi_timeout(dev, s, insn, db2k_ai_status,
DB2K_ACQ_STATUS_LOGIC_SCANNING); DB2K_ACQ_STATUS_LOGIC_SCANNING);
if (ret) if (ret)
return ret; return ret;
ret = ret =
comedi_timeout(dev, s, insn, daqboard2000_ai_status, comedi_timeout(dev, s, insn, db2k_ai_status,
DB2K_ACQ_STATUS_RESULTS_FIFO_HAS_DATA); DB2K_ACQ_STATUS_RESULTS_FIFO_HAS_DATA);
if (ret) if (ret)
return ret; return ret;
...@@ -387,10 +382,8 @@ static int daqboard2000_ai_insn_read(struct comedi_device *dev, ...@@ -387,10 +382,8 @@ static int daqboard2000_ai_insn_read(struct comedi_device *dev,
return i; return i;
} }
static int daqboard2000_ao_eoc(struct comedi_device *dev, static int db2k_ao_eoc(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_subdevice *s, struct comedi_insn *insn, unsigned long context)
struct comedi_insn *insn,
unsigned long context)
{ {
unsigned int chan = CR_CHAN(insn->chanspec); unsigned int chan = CR_CHAN(insn->chanspec);
unsigned int status; unsigned int status;
...@@ -401,10 +394,9 @@ static int daqboard2000_ao_eoc(struct comedi_device *dev, ...@@ -401,10 +394,9 @@ static int daqboard2000_ao_eoc(struct comedi_device *dev,
return -EBUSY; return -EBUSY;
} }
static int daqboard2000_ao_insn_write(struct comedi_device *dev, static int db2k_ao_insn_write(struct comedi_device *dev,
struct comedi_subdevice *s, struct comedi_subdevice *s,
struct comedi_insn *insn, struct comedi_insn *insn, unsigned int *data)
unsigned int *data)
{ {
unsigned int chan = CR_CHAN(insn->chanspec); unsigned int chan = CR_CHAN(insn->chanspec);
int i; int i;
...@@ -415,7 +407,7 @@ static int daqboard2000_ao_insn_write(struct comedi_device *dev, ...@@ -415,7 +407,7 @@ static int daqboard2000_ao_insn_write(struct comedi_device *dev,
writew(val, dev->mmio + DB2K_REG_DAC_SETTING(chan)); writew(val, dev->mmio + DB2K_REG_DAC_SETTING(chan));
ret = comedi_timeout(dev, s, insn, daqboard2000_ao_eoc, 0); ret = comedi_timeout(dev, s, insn, db2k_ao_eoc, 0);
if (ret) if (ret)
return ret; return ret;
...@@ -425,9 +417,9 @@ static int daqboard2000_ao_insn_write(struct comedi_device *dev, ...@@ -425,9 +417,9 @@ static int daqboard2000_ao_insn_write(struct comedi_device *dev,
return insn->n; return insn->n;
} }
static void daqboard2000_reset_local_bus(struct comedi_device *dev) static void db2k_reset_local_bus(struct comedi_device *dev)
{ {
struct daqboard2000_private *devpriv = dev->private; struct db2k_private *devpriv = dev->private;
u32 cntrl; u32 cntrl;
cntrl = readl(devpriv->plx + PLX_REG_CNTRL); cntrl = readl(devpriv->plx + PLX_REG_CNTRL);
...@@ -439,9 +431,9 @@ static void daqboard2000_reset_local_bus(struct comedi_device *dev) ...@@ -439,9 +431,9 @@ static void daqboard2000_reset_local_bus(struct comedi_device *dev)
mdelay(10); mdelay(10);
} }
static void daqboard2000_reload_plx(struct comedi_device *dev) static void db2k_reload_plx(struct comedi_device *dev)
{ {
struct daqboard2000_private *devpriv = dev->private; struct db2k_private *devpriv = dev->private;
u32 cntrl; u32 cntrl;
cntrl = readl(devpriv->plx + PLX_REG_CNTRL); cntrl = readl(devpriv->plx + PLX_REG_CNTRL);
...@@ -456,9 +448,9 @@ static void daqboard2000_reload_plx(struct comedi_device *dev) ...@@ -456,9 +448,9 @@ static void daqboard2000_reload_plx(struct comedi_device *dev)
mdelay(10); mdelay(10);
} }
static void daqboard2000_pulse_prog_pin(struct comedi_device *dev) static void db2k_pulse_prog_pin(struct comedi_device *dev)
{ {
struct daqboard2000_private *devpriv = dev->private; struct db2k_private *devpriv = dev->private;
u32 cntrl; u32 cntrl;
cntrl = readl(devpriv->plx + PLX_REG_CNTRL); cntrl = readl(devpriv->plx + PLX_REG_CNTRL);
...@@ -470,7 +462,7 @@ static void daqboard2000_pulse_prog_pin(struct comedi_device *dev) ...@@ -470,7 +462,7 @@ static void daqboard2000_pulse_prog_pin(struct comedi_device *dev)
mdelay(10); /* Not in the original code, but I like symmetry... */ mdelay(10); /* Not in the original code, but I like symmetry... */
} }
static int daqboard2000_wait_cpld_init(struct comedi_device *dev) static int db2k_wait_cpld_init(struct comedi_device *dev)
{ {
int result = -ETIMEDOUT; int result = -ETIMEDOUT;
int i; int i;
...@@ -489,7 +481,7 @@ static int daqboard2000_wait_cpld_init(struct comedi_device *dev) ...@@ -489,7 +481,7 @@ static int daqboard2000_wait_cpld_init(struct comedi_device *dev)
return result; return result;
} }
static int daqboard2000_wait_cpld_txready(struct comedi_device *dev) static int db2k_wait_cpld_txready(struct comedi_device *dev)
{ {
int i; int i;
...@@ -503,13 +495,12 @@ static int daqboard2000_wait_cpld_txready(struct comedi_device *dev) ...@@ -503,13 +495,12 @@ static int daqboard2000_wait_cpld_txready(struct comedi_device *dev)
return -ETIMEDOUT; return -ETIMEDOUT;
} }
static int daqboard2000_write_cpld(struct comedi_device *dev, u16 data, static int db2k_write_cpld(struct comedi_device *dev, u16 data, bool new_cpld)
bool new_cpld)
{ {
int result = 0; int result = 0;
if (new_cpld) { if (new_cpld) {
result = daqboard2000_wait_cpld_txready(dev); result = db2k_wait_cpld_txready(dev);
if (result) if (result)
return result; return result;
} else { } else {
...@@ -522,9 +513,9 @@ static int daqboard2000_write_cpld(struct comedi_device *dev, u16 data, ...@@ -522,9 +513,9 @@ static int daqboard2000_write_cpld(struct comedi_device *dev, u16 data,
return result; return result;
} }
static int daqboard2000_wait_fpga_programmed(struct comedi_device *dev) static int db2k_wait_fpga_programmed(struct comedi_device *dev)
{ {
struct daqboard2000_private *devpriv = dev->private; struct db2k_private *devpriv = dev->private;
int i; int i;
/* Time out after 200 tries -> 20ms */ /* Time out after 200 tries -> 20ms */
...@@ -539,11 +530,10 @@ static int daqboard2000_wait_fpga_programmed(struct comedi_device *dev) ...@@ -539,11 +530,10 @@ static int daqboard2000_wait_fpga_programmed(struct comedi_device *dev)
return -ETIMEDOUT; return -ETIMEDOUT;
} }
static int daqboard2000_load_firmware(struct comedi_device *dev, static int db2k_load_firmware(struct comedi_device *dev, const u8 *cpld_array,
const u8 *cpld_array, size_t len, size_t len, unsigned long context)
unsigned long context)
{ {
struct daqboard2000_private *devpriv = dev->private; struct db2k_private *devpriv = dev->private;
int result = -EIO; int result = -EIO;
u32 cntrl; u32 cntrl;
int retry; int retry;
...@@ -576,10 +566,10 @@ static int daqboard2000_load_firmware(struct comedi_device *dev, ...@@ -576,10 +566,10 @@ static int daqboard2000_load_firmware(struct comedi_device *dev,
return -EIO; return -EIO;
for (retry = 0; retry < 3; retry++) { for (retry = 0; retry < 3; retry++) {
daqboard2000_reset_local_bus(dev); db2k_reset_local_bus(dev);
daqboard2000_reload_plx(dev); db2k_reload_plx(dev);
daqboard2000_pulse_prog_pin(dev); db2k_pulse_prog_pin(dev);
result = daqboard2000_wait_cpld_init(dev); result = db2k_wait_cpld_init(dev);
if (result) if (result)
continue; continue;
...@@ -588,26 +578,26 @@ static int daqboard2000_load_firmware(struct comedi_device *dev, ...@@ -588,26 +578,26 @@ static int daqboard2000_load_firmware(struct comedi_device *dev,
for (; i < len; i += 2) { for (; i < len; i += 2) {
u16 data = (cpld_array[i] << 8) + cpld_array[i + 1]; u16 data = (cpld_array[i] << 8) + cpld_array[i + 1];
result = daqboard2000_write_cpld(dev, data, new_cpld); result = db2k_write_cpld(dev, data, new_cpld);
if (result) if (result)
break; break;
} }
if (result == 0) if (result == 0)
result = daqboard2000_wait_fpga_programmed(dev); result = db2k_wait_fpga_programmed(dev);
if (result == 0) { if (result == 0) {
daqboard2000_reset_local_bus(dev); db2k_reset_local_bus(dev);
daqboard2000_reload_plx(dev); db2k_reload_plx(dev);
break; break;
} }
} }
return result; return result;
} }
static void daqboard2000_adc_stop_dma_transfer(struct comedi_device *dev) static void db2k_adc_stop_dma_transfer(struct comedi_device *dev)
{ {
} }
static void daqboard2000_adc_disarm(struct comedi_device *dev) static void db2k_adc_disarm(struct comedi_device *dev)
{ {
/* Disable hardware triggers */ /* Disable hardware triggers */
udelay(2); udelay(2);
...@@ -628,10 +618,10 @@ static void daqboard2000_adc_disarm(struct comedi_device *dev) ...@@ -628,10 +618,10 @@ static void daqboard2000_adc_disarm(struct comedi_device *dev)
dev->mmio + DB2K_REG_ACQ_CONTROL); dev->mmio + DB2K_REG_ACQ_CONTROL);
/* Stop the input dma (abort channel 1) */ /* Stop the input dma (abort channel 1) */
daqboard2000_adc_stop_dma_transfer(dev); db2k_adc_stop_dma_transfer(dev);
} }
static void daqboard2000_activate_reference_dacs(struct comedi_device *dev) static void db2k_activate_reference_dacs(struct comedi_device *dev)
{ {
unsigned int val; unsigned int val;
int timeout; int timeout;
...@@ -657,33 +647,32 @@ static void daqboard2000_activate_reference_dacs(struct comedi_device *dev) ...@@ -657,33 +647,32 @@ static void daqboard2000_activate_reference_dacs(struct comedi_device *dev)
} }
} }
static void daqboard2000_initialize_ctrs(struct comedi_device *dev) static void db2k_initialize_ctrs(struct comedi_device *dev)
{ {
} }
static void daqboard2000_initialize_tmrs(struct comedi_device *dev) static void db2k_initialize_tmrs(struct comedi_device *dev)
{ {
} }
static void daqboard2000_dac_disarm(struct comedi_device *dev) static void db2k_dac_disarm(struct comedi_device *dev)
{ {
} }
static void daqboard2000_initialize_adc(struct comedi_device *dev) static void db2k_initialize_adc(struct comedi_device *dev)
{ {
daqboard2000_adc_disarm(dev); db2k_adc_disarm(dev);
daqboard2000_activate_reference_dacs(dev); db2k_activate_reference_dacs(dev);
daqboard2000_initialize_ctrs(dev); db2k_initialize_ctrs(dev);
daqboard2000_initialize_tmrs(dev); db2k_initialize_tmrs(dev);
} }
static void daqboard2000_initialize_dac(struct comedi_device *dev) static void db2k_initialize_dac(struct comedi_device *dev)
{ {
daqboard2000_dac_disarm(dev); db2k_dac_disarm(dev);
} }
static int daqboard2000_8255_cb(struct comedi_device *dev, static int db2k_8255_cb(struct comedi_device *dev, int dir, int port, int data,
int dir, int port, int data,
unsigned long iobase) unsigned long iobase)
{ {
if (dir) { if (dir) {
...@@ -693,33 +682,33 @@ static int daqboard2000_8255_cb(struct comedi_device *dev, ...@@ -693,33 +682,33 @@ static int daqboard2000_8255_cb(struct comedi_device *dev,
return readw(dev->mmio + iobase + port * 2); return readw(dev->mmio + iobase + port * 2);
} }
static const void *daqboard2000_find_boardinfo(struct comedi_device *dev, static const void *db2k_find_boardinfo(struct comedi_device *dev,
struct pci_dev *pcidev) struct pci_dev *pcidev)
{ {
const struct daq200_boardtype *board; const struct db2k_boardtype *board;
int i; int i;
if (pcidev->subsystem_vendor != PCI_VENDOR_ID_IOTECH) if (pcidev->subsystem_vendor != PCI_VENDOR_ID_IOTECH)
return NULL; return NULL;
for (i = 0; i < ARRAY_SIZE(boardtypes); i++) { for (i = 0; i < ARRAY_SIZE(db2k_boardtypes); i++) {
board = &boardtypes[i]; board = &db2k_boardtypes[i];
if (pcidev->subsystem_device == board->id) if (pcidev->subsystem_device == board->id)
return board; return board;
} }
return NULL; return NULL;
} }
static int daqboard2000_auto_attach(struct comedi_device *dev, static int db2k_auto_attach(struct comedi_device *dev,
unsigned long context_unused) unsigned long context_unused)
{ {
struct pci_dev *pcidev = comedi_to_pci_dev(dev); struct pci_dev *pcidev = comedi_to_pci_dev(dev);
const struct daq200_boardtype *board; const struct db2k_boardtype *board;
struct daqboard2000_private *devpriv; struct db2k_private *devpriv;
struct comedi_subdevice *s; struct comedi_subdevice *s;
int result; int result;
board = daqboard2000_find_boardinfo(dev, pcidev); board = db2k_find_boardinfo(dev, pcidev);
if (!board) if (!board)
return -ENODEV; return -ENODEV;
dev->board_ptr = board; dev->board_ptr = board;
...@@ -743,13 +732,12 @@ static int daqboard2000_auto_attach(struct comedi_device *dev, ...@@ -743,13 +732,12 @@ static int daqboard2000_auto_attach(struct comedi_device *dev,
return result; return result;
result = comedi_load_firmware(dev, &comedi_to_pci_dev(dev)->dev, result = comedi_load_firmware(dev, &comedi_to_pci_dev(dev)->dev,
DAQBOARD2000_FIRMWARE, DB2K_FIRMWARE, db2k_load_firmware, 0);
daqboard2000_load_firmware, 0);
if (result < 0) if (result < 0)
return result; return result;
daqboard2000_initialize_adc(dev); db2k_initialize_adc(dev);
daqboard2000_initialize_dac(dev); db2k_initialize_dac(dev);
s = &dev->subdevices[0]; s = &dev->subdevices[0];
/* ai subdevice */ /* ai subdevice */
...@@ -757,8 +745,8 @@ static int daqboard2000_auto_attach(struct comedi_device *dev, ...@@ -757,8 +745,8 @@ static int daqboard2000_auto_attach(struct comedi_device *dev,
s->subdev_flags = SDF_READABLE | SDF_GROUND; s->subdev_flags = SDF_READABLE | SDF_GROUND;
s->n_chan = 24; s->n_chan = 24;
s->maxdata = 0xffff; s->maxdata = 0xffff;
s->insn_read = daqboard2000_ai_insn_read; s->insn_read = db2k_ai_insn_read;
s->range_table = &range_daqboard2000_ai; s->range_table = &db2k_ai_range;
s = &dev->subdevices[1]; s = &dev->subdevices[1];
/* ao subdevice */ /* ao subdevice */
...@@ -766,7 +754,7 @@ static int daqboard2000_auto_attach(struct comedi_device *dev, ...@@ -766,7 +754,7 @@ static int daqboard2000_auto_attach(struct comedi_device *dev,
s->subdev_flags = SDF_WRITABLE; s->subdev_flags = SDF_WRITABLE;
s->n_chan = 2; s->n_chan = 2;
s->maxdata = 0xffff; s->maxdata = 0xffff;
s->insn_write = daqboard2000_ao_insn_write; s->insn_write = db2k_ao_insn_write;
s->range_table = &range_bipolar10; s->range_table = &range_bipolar10;
result = comedi_alloc_subdev_readback(s); result = comedi_alloc_subdev_readback(s);
...@@ -774,48 +762,46 @@ static int daqboard2000_auto_attach(struct comedi_device *dev, ...@@ -774,48 +762,46 @@ static int daqboard2000_auto_attach(struct comedi_device *dev,
return result; return result;
s = &dev->subdevices[2]; s = &dev->subdevices[2];
return subdev_8255_init(dev, s, daqboard2000_8255_cb, return subdev_8255_init(dev, s, db2k_8255_cb,
DB2K_REG_DIO_P2_EXP_IO_8_BIT); DB2K_REG_DIO_P2_EXP_IO_8_BIT);
} }
static void daqboard2000_detach(struct comedi_device *dev) static void db2k_detach(struct comedi_device *dev)
{ {
struct daqboard2000_private *devpriv = dev->private; struct db2k_private *devpriv = dev->private;
if (devpriv && devpriv->plx) if (devpriv && devpriv->plx)
iounmap(devpriv->plx); iounmap(devpriv->plx);
comedi_pci_detach(dev); comedi_pci_detach(dev);
} }
static struct comedi_driver daqboard2000_driver = { static struct comedi_driver db2k_driver = {
.driver_name = "daqboard2000", .driver_name = "daqboard2000",
.module = THIS_MODULE, .module = THIS_MODULE,
.auto_attach = daqboard2000_auto_attach, .auto_attach = db2k_auto_attach,
.detach = daqboard2000_detach, .detach = db2k_detach,
}; };
static int daqboard2000_pci_probe(struct pci_dev *dev, static int db2k_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
const struct pci_device_id *id)
{ {
return comedi_pci_auto_config(dev, &daqboard2000_driver, return comedi_pci_auto_config(dev, &db2k_driver, id->driver_data);
id->driver_data);
} }
static const struct pci_device_id daqboard2000_pci_table[] = { static const struct pci_device_id db2k_pci_table[] = {
{ PCI_DEVICE(PCI_VENDOR_ID_IOTECH, 0x0409) }, { PCI_DEVICE(PCI_VENDOR_ID_IOTECH, 0x0409) },
{ 0 } { 0 }
}; };
MODULE_DEVICE_TABLE(pci, daqboard2000_pci_table); MODULE_DEVICE_TABLE(pci, db2k_pci_table);
static struct pci_driver daqboard2000_pci_driver = { static struct pci_driver db2k_pci_driver = {
.name = "daqboard2000", .name = "daqboard2000",
.id_table = daqboard2000_pci_table, .id_table = db2k_pci_table,
.probe = daqboard2000_pci_probe, .probe = db2k_pci_probe,
.remove = comedi_pci_auto_unconfig, .remove = comedi_pci_auto_unconfig,
}; };
module_comedi_pci_driver(daqboard2000_driver, daqboard2000_pci_driver); module_comedi_pci_driver(db2k_driver, db2k_pci_driver);
MODULE_AUTHOR("Comedi http://www.comedi.org"); MODULE_AUTHOR("Comedi http://www.comedi.org");
MODULE_DESCRIPTION("Comedi low-level driver"); MODULE_DESCRIPTION("Comedi low-level driver");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
MODULE_FIRMWARE(DAQBOARD2000_FIRMWARE); MODULE_FIRMWARE(DB2K_FIRMWARE);
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment