#define CR_A_MODE(a) ((a)<<5)
#define CR_CW 0x80
-struct pcm3724_board {
- const char *name; /* driver name */
- int dio; /* num of DIO */
- int numofports; /* num of 8255 subdevices */
- unsigned int IRQbits; /* allowed interrupts */
- unsigned int io_range; /* len of IO space */
-};
-
/* used to track configured dios */
struct priv_pcm3724 {
int dio_1;
static int pcm3724_attach(struct comedi_device *dev,
struct comedi_devconfig *it)
{
- const struct pcm3724_board *board = comedi_board(dev);
struct comedi_subdevice *s;
unsigned long iobase;
unsigned int iorange;
- int ret, i, n_subdevices;
+ int ret, i;
+
+ dev->board_name = dev->driver->driver_name;
iobase = it->options[0];
- iorange = board->io_range;
+ iorange = PCM3724_SIZE;
ret = alloc_private(dev, sizeof(struct priv_pcm3724));
if (ret < 0)
((struct priv_pcm3724 *)(dev->private))->dio_2 = 0;
printk(KERN_INFO "comedi%d: pcm3724: board=%s, 0x%03lx ", dev->minor,
- board->name, iobase);
+ dev->board_name, iobase);
if (!iobase || !request_region(iobase, iorange, "pcm3724")) {
printk("I/O port conflict\n");
return -EIO;
}
dev->iobase = iobase;
- dev->board_name = board->name;
printk(KERN_INFO "\n");
- n_subdevices = board->numofports;
-
- ret = comedi_alloc_subdevices(dev, n_subdevices);
+ ret = comedi_alloc_subdevices(dev, 2);
if (ret)
return ret;
static void pcm3724_detach(struct comedi_device *dev)
{
- const struct pcm3724_board *board = comedi_board(dev);
struct comedi_subdevice *s;
int i;
}
}
if (dev->iobase)
- release_region(dev->iobase, board->io_range);
+ release_region(dev->iobase, PCM3724_SIZE);
}
-static const struct pcm3724_board boardtypes[] = {
- { "pcm3724", 48, 2, 0x00fc, PCM3724_SIZE, },
-};
-
static struct comedi_driver pcm3724_driver = {
.driver_name = "pcm3724",
.module = THIS_MODULE,
.attach = pcm3724_attach,
.detach = pcm3724_detach,
- .board_name = &boardtypes[0].name,
- .num_names = ARRAY_SIZE(boardtypes),
- .offset = sizeof(struct pcm3724_board),
};
module_comedi_driver(pcm3724_driver);