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

staging: comedi: me4000: remove struct me4000_cnt_info

The me4000_cnt_info in the boardinfo struct is used to indicate
that the board has an 8254 counter. Add a 'has_counter' field
to struct me4000_board and remove the struct me4000_cnt_info.
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 556e451d
...@@ -84,9 +84,7 @@ static const struct me4000_board me4000_boards[] = { ...@@ -84,9 +84,7 @@ static const struct me4000_board me4000_boards[] = {
.dio = { .dio = {
.count = 4, .count = 4,
}, },
.cnt = { .has_counter = 1,
.count = 3,
},
}, { }, {
.name = "ME-4660i", .name = "ME-4660i",
.device_id = 0x4661, .device_id = 0x4661,
...@@ -97,9 +95,7 @@ static const struct me4000_board me4000_boards[] = { ...@@ -97,9 +95,7 @@ static const struct me4000_board me4000_boards[] = {
.dio = { .dio = {
.count = 4, .count = 4,
}, },
.cnt = { .has_counter = 1,
.count = 3,
},
}, { }, {
.name = "ME-4660s", .name = "ME-4660s",
.device_id = 0x4662, .device_id = 0x4662,
...@@ -111,9 +107,7 @@ static const struct me4000_board me4000_boards[] = { ...@@ -111,9 +107,7 @@ static const struct me4000_board me4000_boards[] = {
.dio = { .dio = {
.count = 4, .count = 4,
}, },
.cnt = { .has_counter = 1,
.count = 3,
},
}, { }, {
.name = "ME-4660is", .name = "ME-4660is",
.device_id = 0x4663, .device_id = 0x4663,
...@@ -125,9 +119,7 @@ static const struct me4000_board me4000_boards[] = { ...@@ -125,9 +119,7 @@ static const struct me4000_board me4000_boards[] = {
.dio = { .dio = {
.count = 4, .count = 4,
}, },
.cnt = { .has_counter = 1,
.count = 3,
},
}, { }, {
.name = "ME-4670", .name = "ME-4670",
.device_id = 0x4670, .device_id = 0x4670,
...@@ -142,9 +134,7 @@ static const struct me4000_board me4000_boards[] = { ...@@ -142,9 +134,7 @@ static const struct me4000_board me4000_boards[] = {
.dio = { .dio = {
.count = 4, .count = 4,
}, },
.cnt = { .has_counter = 1,
.count = 3,
},
}, { }, {
.name = "ME-4670i", .name = "ME-4670i",
.device_id = 0x4671, .device_id = 0x4671,
...@@ -159,9 +149,7 @@ static const struct me4000_board me4000_boards[] = { ...@@ -159,9 +149,7 @@ static const struct me4000_board me4000_boards[] = {
.dio = { .dio = {
.count = 4, .count = 4,
}, },
.cnt = { .has_counter = 1,
.count = 3,
},
}, { }, {
.name = "ME-4670s", .name = "ME-4670s",
.device_id = 0x4672, .device_id = 0x4672,
...@@ -177,9 +165,7 @@ static const struct me4000_board me4000_boards[] = { ...@@ -177,9 +165,7 @@ static const struct me4000_board me4000_boards[] = {
.dio = { .dio = {
.count = 4, .count = 4,
}, },
.cnt = { .has_counter = 1,
.count = 3,
},
}, { }, {
.name = "ME-4670is", .name = "ME-4670is",
.device_id = 0x4673, .device_id = 0x4673,
...@@ -195,9 +181,7 @@ static const struct me4000_board me4000_boards[] = { ...@@ -195,9 +181,7 @@ static const struct me4000_board me4000_boards[] = {
.dio = { .dio = {
.count = 4, .count = 4,
}, },
.cnt = { .has_counter = 1,
.count = 3,
},
}, { }, {
.name = "ME-4680", .name = "ME-4680",
.device_id = 0x4680, .device_id = 0x4680,
...@@ -213,9 +197,7 @@ static const struct me4000_board me4000_boards[] = { ...@@ -213,9 +197,7 @@ static const struct me4000_board me4000_boards[] = {
.dio = { .dio = {
.count = 4, .count = 4,
}, },
.cnt = { .has_counter = 1,
.count = 3,
},
}, { }, {
.name = "ME-4680i", .name = "ME-4680i",
.device_id = 0x4681, .device_id = 0x4681,
...@@ -231,9 +213,7 @@ static const struct me4000_board me4000_boards[] = { ...@@ -231,9 +213,7 @@ static const struct me4000_board me4000_boards[] = {
.dio = { .dio = {
.count = 4, .count = 4,
}, },
.cnt = { .has_counter = 1,
.count = 3,
},
}, { }, {
.name = "ME-4680s", .name = "ME-4680s",
.device_id = 0x4682, .device_id = 0x4682,
...@@ -250,9 +230,7 @@ static const struct me4000_board me4000_boards[] = { ...@@ -250,9 +230,7 @@ static const struct me4000_board me4000_boards[] = {
.dio = { .dio = {
.count = 4, .count = 4,
}, },
.cnt = { .has_counter = 1,
.count = 3,
},
}, { }, {
.name = "ME-4680is", .name = "ME-4680is",
.device_id = 0x4683, .device_id = 0x4683,
...@@ -269,9 +247,7 @@ static const struct me4000_board me4000_boards[] = { ...@@ -269,9 +247,7 @@ static const struct me4000_board me4000_boards[] = {
.dio = { .dio = {
.count = 4, .count = 4,
}, },
.cnt = { .has_counter = 1,
.count = 3,
},
}, },
}; };
...@@ -2290,10 +2266,10 @@ static int me4000_attach(struct comedi_device *dev, struct comedi_devconfig *it) ...@@ -2290,10 +2266,10 @@ static int me4000_attach(struct comedi_device *dev, struct comedi_devconfig *it)
s = &dev->subdevices[3]; s = &dev->subdevices[3];
if (thisboard->cnt.count) { if (thisboard->has_counter) {
s->type = COMEDI_SUBD_COUNTER; s->type = COMEDI_SUBD_COUNTER;
s->subdev_flags = SDF_READABLE | SDF_WRITABLE; s->subdev_flags = SDF_READABLE | SDF_WRITABLE;
s->n_chan = thisboard->cnt.count; s->n_chan = 3;
s->maxdata = 0xFFFF; /* 16 bit counters */ s->maxdata = 0xFFFF; /* 16 bit counters */
s->insn_read = me4000_cnt_insn_read; s->insn_read = me4000_cnt_insn_read;
s->insn_write = me4000_cnt_insn_write; s->insn_write = me4000_cnt_insn_write;
......
...@@ -272,17 +272,13 @@ struct me4000_dio_info { ...@@ -272,17 +272,13 @@ struct me4000_dio_info {
int count; int count;
}; };
struct me4000_cnt_info {
int count;
};
struct me4000_board { struct me4000_board {
const char *name; const char *name;
unsigned short device_id; unsigned short device_id;
struct me4000_ao_info ao; struct me4000_ao_info ao;
struct me4000_ai_info ai; struct me4000_ai_info ai;
struct me4000_dio_info dio; struct me4000_dio_info dio;
struct me4000_cnt_info cnt; int has_counter;
}; };
#define thisboard ((const struct me4000_board *)dev->board_ptr) #define thisboard ((const struct me4000_board *)dev->board_ptr)
......
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