Driver: das16m1
Description: CIO-DAS16/M1
Author: Frank Mori Hess <fmhess@users.sourceforge.net>
-Devices: [Measurement Computing] CIO-DAS16/M1 (cio-das16/m1)
+Devices: [Measurement Computing] CIO-DAS16/M1 (das16m1)
Status: works
This driver supports a single board - the CIO-DAS16/M1.
}
};
-struct das16m1_board {
- const char *name;
- unsigned int ai_speed;
-};
-
struct das16m1_private_struct {
unsigned int control_state;
volatile unsigned int adc_count; /* number of samples completed */
static int das16m1_cmd_test(struct comedi_device *dev,
struct comedi_subdevice *s, struct comedi_cmd *cmd)
{
- const struct das16m1_board *board = comedi_board(dev);
unsigned int err = 0, tmp, i;
/* Step 1 : check if triggers are trivially valid */
}
if (cmd->convert_src == TRIG_TIMER) {
- if (cmd->convert_arg < board->ai_speed) {
- cmd->convert_arg = board->ai_speed;
+ if (cmd->convert_arg < 1000) {
+ cmd->convert_arg = 1000;
err++;
}
}
static int das16m1_attach(struct comedi_device *dev,
struct comedi_devconfig *it)
{
- const struct das16m1_board *board = comedi_board(dev);
struct comedi_subdevice *s;
int ret;
unsigned int irq;
unsigned long iobase;
+ dev->board_name = dev->driver->driver_name;
+
iobase = it->options[0];
ret = alloc_private(dev, sizeof(struct das16m1_private_struct));
if (ret < 0)
return ret;
- dev->board_name = board->name;
-
- if (!request_region(iobase, DAS16M1_SIZE, dev->driver->driver_name)) {
+ if (!request_region(iobase, DAS16M1_SIZE, dev->board_name)) {
comedi_error(dev, "I/O port conflict\n");
return -EIO;
}
if (!request_region(iobase + DAS16M1_82C55, DAS16M1_SIZE2,
- dev->driver->driver_name)) {
+ dev->board_name)) {
release_region(iobase, DAS16M1_SIZE);
comedi_error(dev, "I/O port conflict\n");
return -EIO;
}
}
-static const struct das16m1_board das16m1_boards[] = {
- {
- .name = "cio-das16/m1", /* CIO-DAS16_M1.pdf */
- .ai_speed = 1000, /* 1MHz max speed */
- },
-};
-
static struct comedi_driver das16m1_driver = {
.driver_name = "das16m1",
.module = THIS_MODULE,
.attach = das16m1_attach,
.detach = das16m1_detach,
- .board_name = &das16m1_boards[0].name,
- .num_names = ARRAY_SIZE(das16m1_boards),
- .offset = sizeof(das16m1_boards[0]),
};
module_comedi_driver(das16m1_driver);