Commit 898f5191 authored by H Hartley Sweeten's avatar H Hartley Sweeten Committed by Greg Kroah-Hartman

staging: comedi: me4000: remove struct me4000_dio_info

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: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent eedf4299
......@@ -71,9 +71,7 @@ static const struct me4000_board me4000_boards[] = {
.ai = {
.count = 16,
},
.dio = {
.count = 4,
},
.dio_nchan = 32,
}, {
.name = "ME-4660",
.device_id = 0x4660,
......@@ -81,9 +79,7 @@ static const struct me4000_board me4000_boards[] = {
.count = 32,
.diff_count = 16,
},
.dio = {
.count = 4,
},
.dio_nchan = 32,
.has_counter = 1,
}, {
.name = "ME-4660i",
......@@ -92,9 +88,7 @@ static const struct me4000_board me4000_boards[] = {
.count = 32,
.diff_count = 16,
},
.dio = {
.count = 4,
},
.dio_nchan = 32,
.has_counter = 1,
}, {
.name = "ME-4660s",
......@@ -104,9 +98,7 @@ static const struct me4000_board me4000_boards[] = {
.sh_count = 8,
.diff_count = 16,
},
.dio = {
.count = 4,
},
.dio_nchan = 32,
.has_counter = 1,
}, {
.name = "ME-4660is",
......@@ -116,9 +108,7 @@ static const struct me4000_board me4000_boards[] = {
.sh_count = 8,
.diff_count = 16,
},
.dio = {
.count = 4,
},
.dio_nchan = 32,
.has_counter = 1,
}, {
.name = "ME-4670",
......@@ -131,9 +121,7 @@ static const struct me4000_board me4000_boards[] = {
.diff_count = 16,
.ex_trig_analog = 1,
},
.dio = {
.count = 4,
},
.dio_nchan = 32,
.has_counter = 1,
}, {
.name = "ME-4670i",
......@@ -146,9 +134,7 @@ static const struct me4000_board me4000_boards[] = {
.diff_count = 16,
.ex_trig_analog = 1,
},
.dio = {
.count = 4,
},
.dio_nchan = 32,
.has_counter = 1,
}, {
.name = "ME-4670s",
......@@ -162,9 +148,7 @@ static const struct me4000_board me4000_boards[] = {
.diff_count = 16,
.ex_trig_analog = 1,
},
.dio = {
.count = 4,
},
.dio_nchan = 32,
.has_counter = 1,
}, {
.name = "ME-4670is",
......@@ -178,9 +162,7 @@ static const struct me4000_board me4000_boards[] = {
.diff_count = 16,
.ex_trig_analog = 1,
},
.dio = {
.count = 4,
},
.dio_nchan = 32,
.has_counter = 1,
}, {
.name = "ME-4680",
......@@ -194,9 +176,7 @@ static const struct me4000_board me4000_boards[] = {
.diff_count = 16,
.ex_trig_analog = 1,
},
.dio = {
.count = 4,
},
.dio_nchan = 32,
.has_counter = 1,
}, {
.name = "ME-4680i",
......@@ -210,9 +190,7 @@ static const struct me4000_board me4000_boards[] = {
.diff_count = 16,
.ex_trig_analog = 1,
},
.dio = {
.count = 4,
},
.dio_nchan = 32,
.has_counter = 1,
}, {
.name = "ME-4680s",
......@@ -227,9 +205,7 @@ static const struct me4000_board me4000_boards[] = {
.diff_count = 16,
.ex_trig_analog = 1,
},
.dio = {
.count = 4,
},
.dio_nchan = 32,
.has_counter = 1,
}, {
.name = "ME-4680is",
......@@ -244,9 +220,7 @@ static const struct me4000_board me4000_boards[] = {
.diff_count = 16,
.ex_trig_analog = 1,
},
.dio = {
.count = 4,
},
.dio_nchan = 32,
.has_counter = 1,
},
};
......@@ -2239,10 +2213,10 @@ static int me4000_attach(struct comedi_device *dev, struct comedi_devconfig *it)
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;
......
......@@ -268,16 +268,12 @@ struct me4000_ai_info {
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;
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment