unsigned int ai_speed; /* max conversion speed in nanosec */
unsigned int ai_pg;
unsigned int has_ao:1;
+ unsigned int has_8255:1;
unsigned int i8255_offset;
.ai_speed = 15000,
.ai_pg = das16_pg_none,
.has_ao = 1,
+ .has_8255 = 1,
.i8255_offset = 0x10,
.size = 0x14,
.id = 0x00,
.ai_speed = 15000,
.ai_pg = das16_pg_none,
.has_ao = 1,
+ .has_8255 = 1,
.i8255_offset = 0x10,
.size = 0x14,
.id = 0x00,
.ai_speed = 8500,
.ai_pg = das16_pg_none,
.has_ao = 1,
+ .has_8255 = 1,
.i8255_offset = 0x10,
.size = 0x14,
.id = 0x00,
.ai_speed = 20000,
.ai_pg = das16_pg_none,
.has_ao = 1,
+ .has_8255 = 1,
.i8255_offset = 0x10,
.size = 0x14,
.id = 0x80,
.ai_speed = 10000,
.ai_pg = das16_pg_none,
.has_ao = 1,
+ .has_8255 = 1,
.i8255_offset = 0x10,
.size = 0x14,
.id = 0x80,
.ai_maxdata = 0x0fff,
.ai_speed = 7692,
.ai_pg = das16_pg_16jr,
- .i8255_offset = 0,
.size = 0x10,
.id = 0x00,
}, {
.ai_maxdata = 0x0fff,
.ai_speed = 3300,
.ai_pg = das16_pg_16jr,
- .i8255_offset = 0,
.size = 0x10,
.id = 0x00,
}, {
.ai_maxdata = 0xffff,
.ai_speed = 10000,
.ai_pg = das16_pg_16jr_16,
- .i8255_offset = 0,
.size = 0x10,
.id = 0x00,
}, {
.ai_maxdata = 0xffff,
.ai_speed = 10000,
.ai_pg = das16_pg_16jr_16,
- .i8255_offset = 0,
.size = 0x10,
.id = 0x00,
}, {
.ai_maxdata = 0x0fff,
.ai_speed = 20000,
.ai_pg = das16_pg_none,
+ .has_8255 = 1,
.i8255_offset = 0x400,
.size = 0x408,
.id = 0x20,
.ai_maxdata = 0x0fff,
.ai_speed = 10000,
.ai_pg = das16_pg_none,
+ .has_8255 = 1,
.i8255_offset = 0x400,
.size = 0x408,
.id = 0x20,
.ai_maxdata = 0x0fff,
.ai_speed = 10000,
.ai_pg = das16_pg_1601,
- .i8255_offset = 0x0,
.size = 0x408,
.id = 0xc0,
}, {
.ai_maxdata = 0x0fff,
.ai_speed = 10000,
.ai_pg = das16_pg_1602,
- .i8255_offset = 0x0,
.size = 0x408,
.id = 0xc0,
}, {
.ai_speed = 10000,
.ai_pg = das16_pg_1601,
.has_ao = 1,
+ .has_8255 = 1,
.i8255_offset = 0x400,
.size = 0x408,
.id = 0xc0,
.ai_speed = 10000,
.ai_pg = das16_pg_1602,
.has_ao = 1,
+ .has_8255 = 1,
.i8255_offset = 0x400,
.size = 0x408,
.id = 0xc0,
.ai_maxdata = 0x0fff,
.ai_speed = 6250,
.ai_pg = das16_pg_1601,
- .i8255_offset = 0,
.size = 0x408,
.id = 0xc0,
}, {
.ai_maxdata = 0x0fff,
.ai_speed = 6250,
.ai_pg = das16_pg_1602,
- .i8255_offset = 0,
.size = 0x408,
.id = 0xc0,
}, {
.ai_maxdata = 0xffff,
.ai_speed = 10000,
.ai_pg = das16_pg_1602,
- .i8255_offset = 0,
.size = 0x408,
.id = 0xc0,
}, {
.ai_speed = 6250,
.ai_pg = das16_pg_1601,
.has_ao = 1,
+ .has_8255 = 1,
.i8255_offset = 0x400,
.size = 0x408,
.id = 0xc0,
.ai_speed = 10000,
.ai_pg = das16_pg_1602,
.has_ao = 1,
+ .has_8255 = 1,
.i8255_offset = 0x400,
.size = 0x408,
.id = 0xc0,
.ai_speed = 10000,
.ai_pg = das16_pg_1602,
.has_ao = 1,
+ .has_8255 = 1,
.i8255_offset = 0x400,
.size = 0x408,
.id = 0xc0,
.ai_maxdata = 0x0fff,
.ai_speed = 3030,
.ai_pg = das16_pg_16jr,
- .i8255_offset = 0,
.size = 0x14,
.id = 0xf0,
},
user_ao_range->flags = UNIT_volt;
}
- ret = comedi_alloc_subdevices(dev, 5);
+ ret = comedi_alloc_subdevices(dev, 4 + board->has_8255);
if (ret)
return ret;
/* initialize digital output lines */
outb(s->state, dev->iobase + DAS16_DIO);
- s = &dev->subdevices[4];
- /* 8255 */
- if (board->i8255_offset != 0) {
- subdev_8255_init(dev, s, NULL, (dev->iobase +
- board->i8255_offset));
- } else {
- s->type = COMEDI_SUBD_UNUSED;
+ /* 8255 Digital I/O subdevice */
+ if (board->has_8255) {
+ s = &dev->subdevices[4];
+ ret = subdev_8255_init(dev, s, NULL,
+ dev->iobase + board->i8255_offset);
+ if (ret)
+ return ret;
}
das16_reset(dev);