The me4000_dio_info in the boardinfo struct is used to indicate
the number of 8 bit dio ports the the board has. Add a 'dio_nchan'
field to struct me4000_board and remove the struct me4000_dio_info.
The 'dio_nchan' value can then be used directly in the attach of
the board when setting the subdevice number of channels.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
.ai = {
.count = 16,
},
- .dio = {
- .count = 4,
- },
+ .dio_nchan = 32,
}, {
.name = "ME-4660",
.device_id = 0x4660,
.count = 32,
.diff_count = 16,
},
- .dio = {
- .count = 4,
- },
+ .dio_nchan = 32,
.has_counter = 1,
}, {
.name = "ME-4660i",
.count = 32,
.diff_count = 16,
},
- .dio = {
- .count = 4,
- },
+ .dio_nchan = 32,
.has_counter = 1,
}, {
.name = "ME-4660s",
.sh_count = 8,
.diff_count = 16,
},
- .dio = {
- .count = 4,
- },
+ .dio_nchan = 32,
.has_counter = 1,
}, {
.name = "ME-4660is",
.sh_count = 8,
.diff_count = 16,
},
- .dio = {
- .count = 4,
- },
+ .dio_nchan = 32,
.has_counter = 1,
}, {
.name = "ME-4670",
.diff_count = 16,
.ex_trig_analog = 1,
},
- .dio = {
- .count = 4,
- },
+ .dio_nchan = 32,
.has_counter = 1,
}, {
.name = "ME-4670i",
.diff_count = 16,
.ex_trig_analog = 1,
},
- .dio = {
- .count = 4,
- },
+ .dio_nchan = 32,
.has_counter = 1,
}, {
.name = "ME-4670s",
.diff_count = 16,
.ex_trig_analog = 1,
},
- .dio = {
- .count = 4,
- },
+ .dio_nchan = 32,
.has_counter = 1,
}, {
.name = "ME-4670is",
.diff_count = 16,
.ex_trig_analog = 1,
},
- .dio = {
- .count = 4,
- },
+ .dio_nchan = 32,
.has_counter = 1,
}, {
.name = "ME-4680",
.diff_count = 16,
.ex_trig_analog = 1,
},
- .dio = {
- .count = 4,
- },
+ .dio_nchan = 32,
.has_counter = 1,
}, {
.name = "ME-4680i",
.diff_count = 16,
.ex_trig_analog = 1,
},
- .dio = {
- .count = 4,
- },
+ .dio_nchan = 32,
.has_counter = 1,
}, {
.name = "ME-4680s",
.diff_count = 16,
.ex_trig_analog = 1,
},
- .dio = {
- .count = 4,
- },
+ .dio_nchan = 32,
.has_counter = 1,
}, {
.name = "ME-4680is",
.diff_count = 16,
.ex_trig_analog = 1,
},
- .dio = {
- .count = 4,
- },
+ .dio_nchan = 32,
.has_counter = 1,
},
};
s = &dev->subdevices[2];
- if (thisboard->dio.count) {
+ if (thisboard->dio_nchan) {
s->type = COMEDI_SUBD_DIO;
s->subdev_flags = SDF_READABLE | SDF_WRITABLE;
- s->n_chan = thisboard->dio.count * 8;
+ s->n_chan = thisboard->dio_nchan;
s->maxdata = 1;
s->range_table = &range_digital;
s->insn_bits = me4000_dio_insn_bits;
int ex_trig_analog;
};
-struct me4000_dio_info {
- int count;
-};
-
struct me4000_board {
const char *name;
unsigned short device_id;
struct me4000_ao_info ao;
struct me4000_ai_info ai;
- struct me4000_dio_info dio;
+ int dio_nchan;
int has_counter;
};