unsigned int ai_pg;
void *ao;
unsigned int ao_nbits;
- void *do_;
unsigned int i8255_offset;
unsigned int i8254_offset;
return insn->n;
}
-static int das16_do_wbits(struct comedi_device *dev, struct comedi_subdevice *s,
- struct comedi_insn *insn, unsigned int *data)
+static int das16_do_insn_bits(struct comedi_device *dev,
+ struct comedi_subdevice *s,
+ struct comedi_insn *insn,
+ unsigned int *data)
{
- unsigned int wbits;
-
- /* only set bits that have been masked */
- data[0] &= 0xf;
- wbits = s->state;
- /* zero bits that have been masked */
- wbits &= ~data[0];
- /* set masked bits */
- wbits |= data[0] & data[1];
- s->state = wbits;
- data[1] = wbits;
+ unsigned int mask = data[0];
+ unsigned int bits = data[1];
- outb(s->state, dev->iobase + DAS16_DIO);
+ if (mask) {
+ s->state &= ~mask;
+ s->state |= (bits & mask);
+
+ outb(s->state, dev->iobase + DAS16_DIO);
+ }
+
+ data[1] = s->state;
return insn->n;
}
s->range_table = &range_digital;
s->insn_bits = das16_di_insn_bits;
+ /* Digital Output subdevice */
s = &dev->subdevices[3];
- /* do */
- if (board->do_) {
- s->type = COMEDI_SUBD_DO;
- s->subdev_flags = SDF_WRITABLE | SDF_READABLE;
- s->n_chan = 4;
- s->maxdata = 1;
- s->range_table = &range_digital;
- s->insn_bits = board->do_;
- /* initialize digital output lines */
- outb(s->state, dev->iobase + DAS16_DIO);
- } else {
- s->type = COMEDI_SUBD_UNUSED;
- }
+ s->type = COMEDI_SUBD_DO;
+ s->subdev_flags = SDF_WRITABLE;
+ s->n_chan = 4;
+ s->maxdata = 1;
+ s->range_table = &range_digital;
+ s->insn_bits = das16_do_insn_bits;
+
+ /* initialize digital output lines */
+ outb(s->state, dev->iobase + DAS16_DIO);
s = &dev->subdevices[4];
/* 8255 */
.ai_pg = das16_pg_none,
.ao = das16_ao_winsn,
.ao_nbits = 12,
- .do_ = das16_do_wbits,
.i8255_offset = 0x10,
.i8254_offset = 0x0c,
.size = 0x14,
.ai_pg = das16_pg_none,
.ao = das16_ao_winsn,
.ao_nbits = 12,
- .do_ = das16_do_wbits,
.i8255_offset = 0x10,
.i8254_offset = 0x0c,
.size = 0x14,
.ai_pg = das16_pg_none,
.ao = das16_ao_winsn,
.ao_nbits = 12,
- .do_ = das16_do_wbits,
.i8255_offset = 0x10,
.i8254_offset = 0x0c,
.size = 0x14,
.ai_pg = das16_pg_none,
.ao = das16_ao_winsn,
.ao_nbits = 12,
- .do_ = das16_do_wbits,
.i8255_offset = 0x10,
.i8254_offset = 0x0c,
.size = 0x14,
.ai_pg = das16_pg_none,
.ao = das16_ao_winsn,
.ao_nbits = 12,
- .do_ = das16_do_wbits,
.i8255_offset = 0x10,
.i8254_offset = 0x0c,
.size = 0x14,
.ai_speed = 7692,
.ai_pg = das16_pg_16jr,
.ao = NULL,
- .do_ = das16_do_wbits,
.i8255_offset = 0,
.i8254_offset = 0x0c,
.size = 0x10,
.ai_speed = 3300,
.ai_pg = das16_pg_16jr,
.ao = NULL,
- .do_ = das16_do_wbits,
.i8255_offset = 0,
.i8254_offset = 0x0c,
.size = 0x10,
.ai_speed = 10000,
.ai_pg = das16_pg_16jr_16,
.ao = NULL,
- .do_ = das16_do_wbits,
.i8255_offset = 0,
.i8254_offset = 0x0c,
.size = 0x10,
.ai_speed = 10000,
.ai_pg = das16_pg_16jr_16,
.ao = NULL,
- .do_ = das16_do_wbits,
.i8255_offset = 0,
.i8254_offset = 0x0c,
.size = 0x10,
.ai_speed = 20000,
.ai_pg = das16_pg_none,
.ao = NULL,
- .do_ = das16_do_wbits,
.i8255_offset = 0x400,
.i8254_offset = 0x0c,
.size = 0x408,
.ai_speed = 10000,
.ai_pg = das16_pg_none,
.ao = NULL,
- .do_ = das16_do_wbits,
.i8255_offset = 0x400,
.i8254_offset = 0x0c,
.size = 0x408,
.ai_speed = 10000,
.ai_pg = das16_pg_1601,
.ao = NULL,
- .do_ = das16_do_wbits,
.i8255_offset = 0x0,
.i8254_offset = 0x0c,
.size = 0x408,
.ai_speed = 10000,
.ai_pg = das16_pg_1602,
.ao = NULL,
- .do_ = das16_do_wbits,
.i8255_offset = 0x0,
.i8254_offset = 0x0c,
.size = 0x408,
.ai_pg = das16_pg_1601,
.ao = das16_ao_winsn,
.ao_nbits = 12,
- .do_ = das16_do_wbits,
.i8255_offset = 0x400,
.i8254_offset = 0x0c,
.size = 0x408,
.ai_pg = das16_pg_1602,
.ao = das16_ao_winsn,
.ao_nbits = 12,
- .do_ = das16_do_wbits,
.i8255_offset = 0x400,
.i8254_offset = 0x0c,
.size = 0x408,
.ai_speed = 6250,
.ai_pg = das16_pg_1601,
.ao = NULL,
- .do_ = das16_do_wbits,
.i8255_offset = 0,
.i8254_offset = 0x0c,
.size = 0x408,
.ai_speed = 6250,
.ai_pg = das16_pg_1602,
.ao = NULL,
- .do_ = das16_do_wbits,
.i8255_offset = 0,
.i8254_offset = 0x0c,
.size = 0x408,
.ai_speed = 10000,
.ai_pg = das16_pg_1602,
.ao = NULL,
- .do_ = das16_do_wbits,
.i8255_offset = 0,
.i8254_offset = 0x0c,
.size = 0x408,
.ai_pg = das16_pg_1601,
.ao = das16_ao_winsn,
.ao_nbits = 12,
- .do_ = das16_do_wbits,
.i8255_offset = 0x400,
.i8254_offset = 0x0c,
.size = 0x408,
.ai_pg = das16_pg_1602,
.ao = das16_ao_winsn,
.ao_nbits = 12,
- .do_ = das16_do_wbits,
.i8255_offset = 0x400,
.i8254_offset = 0x0c,
.size = 0x408,
.ai_pg = das16_pg_1602,
.ao = das16_ao_winsn,
.ao_nbits = 12,
- .do_ = das16_do_wbits,
.i8255_offset = 0x400,
.i8254_offset = 0x0c,
.size = 0x408,
.ai_speed = 3030,
.ai_pg = das16_pg_16jr,
.ao = NULL,
- .do_ = das16_do_wbits,
.i8255_offset = 0,
.i8254_offset = 0x0c,
.size = 0x14,