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

staging: comedi: me4000: remove struct me4000_ao_info

The me4000_ao_info in the boardinfo struct is used to indicate
the number of analog output channels and a couple other details
about them. Remove the extra struct and absorb the data into the
boardinfo struct.
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 6ba8dfef
...@@ -103,9 +103,7 @@ static const struct me4000_board me4000_boards[] = { ...@@ -103,9 +103,7 @@ static const struct me4000_board me4000_boards[] = {
}, { }, {
.name = "ME-4670", .name = "ME-4670",
.device_id = 0x4670, .device_id = 0x4670,
.ao = { .ao_nchan = 4,
.count = 4,
},
.ai_nchan = 32, .ai_nchan = 32,
.ai_diff_nchan = 16, .ai_diff_nchan = 16,
.ex_trig_analog = 1, .ex_trig_analog = 1,
...@@ -114,9 +112,7 @@ static const struct me4000_board me4000_boards[] = { ...@@ -114,9 +112,7 @@ static const struct me4000_board me4000_boards[] = {
}, { }, {
.name = "ME-4670i", .name = "ME-4670i",
.device_id = 0x4671, .device_id = 0x4671,
.ao = { .ao_nchan = 4,
.count = 4,
},
.ai_nchan = 32, .ai_nchan = 32,
.ai_diff_nchan = 16, .ai_diff_nchan = 16,
.ex_trig_analog = 1, .ex_trig_analog = 1,
...@@ -125,9 +121,7 @@ static const struct me4000_board me4000_boards[] = { ...@@ -125,9 +121,7 @@ static const struct me4000_board me4000_boards[] = {
}, { }, {
.name = "ME-4670s", .name = "ME-4670s",
.device_id = 0x4672, .device_id = 0x4672,
.ao = { .ao_nchan = 4,
.count = 4,
},
.ai_nchan = 32, .ai_nchan = 32,
.ai_diff_nchan = 16, .ai_diff_nchan = 16,
.ai_sh_nchan = 8, .ai_sh_nchan = 8,
...@@ -137,9 +131,7 @@ static const struct me4000_board me4000_boards[] = { ...@@ -137,9 +131,7 @@ static const struct me4000_board me4000_boards[] = {
}, { }, {
.name = "ME-4670is", .name = "ME-4670is",
.device_id = 0x4673, .device_id = 0x4673,
.ao = { .ao_nchan = 4,
.count = 4,
},
.ai_nchan = 32, .ai_nchan = 32,
.ai_diff_nchan = 16, .ai_diff_nchan = 16,
.ai_sh_nchan = 8, .ai_sh_nchan = 8,
...@@ -149,10 +141,8 @@ static const struct me4000_board me4000_boards[] = { ...@@ -149,10 +141,8 @@ static const struct me4000_board me4000_boards[] = {
}, { }, {
.name = "ME-4680", .name = "ME-4680",
.device_id = 0x4680, .device_id = 0x4680,
.ao = { .ao_nchan = 4,
.count = 4, .ao_fifo = 4,
.fifo_count = 4,
},
.ai_nchan = 32, .ai_nchan = 32,
.ai_diff_nchan = 16, .ai_diff_nchan = 16,
.ex_trig_analog = 1, .ex_trig_analog = 1,
...@@ -161,10 +151,8 @@ static const struct me4000_board me4000_boards[] = { ...@@ -161,10 +151,8 @@ static const struct me4000_board me4000_boards[] = {
}, { }, {
.name = "ME-4680i", .name = "ME-4680i",
.device_id = 0x4681, .device_id = 0x4681,
.ao = { .ao_nchan = 4,
.count = 4, .ao_fifo = 4,
.fifo_count = 4,
},
.ai_nchan = 32, .ai_nchan = 32,
.ai_diff_nchan = 16, .ai_diff_nchan = 16,
.ex_trig_analog = 1, .ex_trig_analog = 1,
...@@ -173,10 +161,8 @@ static const struct me4000_board me4000_boards[] = { ...@@ -173,10 +161,8 @@ static const struct me4000_board me4000_boards[] = {
}, { }, {
.name = "ME-4680s", .name = "ME-4680s",
.device_id = 0x4682, .device_id = 0x4682,
.ao = { .ao_nchan = 4,
.count = 4, .ao_fifo = 4,
.fifo_count = 4,
},
.ai_nchan = 32, .ai_nchan = 32,
.ai_diff_nchan = 16, .ai_diff_nchan = 16,
.ai_sh_nchan = 8, .ai_sh_nchan = 8,
...@@ -186,10 +172,8 @@ static const struct me4000_board me4000_boards[] = { ...@@ -186,10 +172,8 @@ static const struct me4000_board me4000_boards[] = {
}, { }, {
.name = "ME-4680is", .name = "ME-4680is",
.device_id = 0x4683, .device_id = 0x4683,
.ao = { .ao_nchan = 4,
.count = 4, .ao_fifo = 4,
.fifo_count = 4,
},
.ai_nchan = 32, .ai_nchan = 32,
.ai_diff_nchan = 16, .ai_diff_nchan = 16,
.ai_sh_nchan = 8, .ai_sh_nchan = 8,
...@@ -463,7 +447,7 @@ static int init_ao_context(struct comedi_device *dev) ...@@ -463,7 +447,7 @@ static int init_ao_context(struct comedi_device *dev)
{ {
int i; int i;
for (i = 0; i < thisboard->ao.count; i++) { for (i = 0; i < thisboard->ao_nchan; i++) {
/* spin_lock_init(&info->ao_context[i].use_lock); */ /* spin_lock_init(&info->ao_context[i].use_lock); */
info->ao_context[i].irq = info->irq; info->ao_context[i].irq = info->irq;
...@@ -1689,7 +1673,7 @@ static int me4000_ao_insn_write(struct comedi_device *dev, ...@@ -1689,7 +1673,7 @@ static int me4000_ao_insn_write(struct comedi_device *dev,
return -EINVAL; return -EINVAL;
} }
if (chan >= thisboard->ao.count) { if (chan >= thisboard->ao_nchan) {
printk(KERN_ERR printk(KERN_ERR
"comedi%d: me4000: me4000_ao_insn_write(): " "comedi%d: me4000: me4000_ao_insn_write(): "
"Invalid channel %d\n", dev->minor, insn->n); "Invalid channel %d\n", dev->minor, insn->n);
...@@ -2169,10 +2153,10 @@ static int me4000_attach(struct comedi_device *dev, struct comedi_devconfig *it) ...@@ -2169,10 +2153,10 @@ static int me4000_attach(struct comedi_device *dev, struct comedi_devconfig *it)
s = &dev->subdevices[1]; s = &dev->subdevices[1];
if (thisboard->ao.count) { if (thisboard->ao_nchan) {
s->type = COMEDI_SUBD_AO; s->type = COMEDI_SUBD_AO;
s->subdev_flags = SDF_WRITEABLE | SDF_COMMON | SDF_GROUND; s->subdev_flags = SDF_WRITEABLE | SDF_COMMON | SDF_GROUND;
s->n_chan = thisboard->ao.count; s->n_chan = thisboard->ao_nchan;
s->maxdata = 0xFFFF; /* 16 bit DAC */ s->maxdata = 0xFFFF; /* 16 bit DAC */
s->range_table = &me4000_ao_range; s->range_table = &me4000_ao_range;
s->insn_write = me4000_ao_insn_write; s->insn_write = me4000_ao_insn_write;
......
...@@ -256,15 +256,11 @@ ...@@ -256,15 +256,11 @@
Information about the hardware capabilities Information about the hardware capabilities
===========================================================================*/ ===========================================================================*/
struct me4000_ao_info {
int count;
int fifo_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; int ao_nchan;
int ao_fifo;
int ai_nchan; int ai_nchan;
int ai_diff_nchan; int ai_diff_nchan;
int ai_sh_nchan; int ai_sh_nchan;
......
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