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

staging: comedi: me_daq: cleanup the boardinfo

Rename the boardinfo variables so they are a bit more concise.

Remove the unnecessary comments in the boardinfo.

Add some whitespace to make the code more readable.
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 20482c78
...@@ -172,39 +172,34 @@ static const struct comedi_lrange me2600_ao_range = { ...@@ -172,39 +172,34 @@ static const struct comedi_lrange me2600_ao_range = {
} }
}; };
/* Board specification structure */
struct me_board { struct me_board {
const char *name; /* driver name */ const char *name;
int device_id; int device_id;
int ao_channel_nbr; /* DA config */ int ao_chans;
int ao_resolution; int ao_bits;
const struct comedi_lrange *ao_range_list; const struct comedi_lrange *ao_range;
int ai_channel_nbr; /* AD config */ int ai_chans;
int ai_resolution; int ai_bits;
const struct comedi_lrange *ai_range_list; const struct comedi_lrange *ai_range;
}; };
static const struct me_board me_boards[] = { static const struct me_board me_boards[] = {
{ {
.name = "me-2600i", .name = "me-2600i",
.device_id = ME2600_DEVICE_ID, .device_id = ME2600_DEVICE_ID,
/* Analog Output */ .ao_chans = 4,
.ao_channel_nbr = 4, .ao_bits = 12,
.ao_resolution = 12, .ao_range = &me2600_ao_range,
.ao_range_list = &me2600_ao_range, .ai_chans = 16,
.ai_channel_nbr = 16, .ai_bits = 12,
/* Analog Input */ .ai_range = &me2600_ai_range,
.ai_resolution = 12, }, {
.ai_range_list = &me2600_ai_range, .name = "me-2000i",
}, .device_id = ME2000_DEVICE_ID,
{ .ai_chans = 16,
.name = "me-2000i", .ai_bits = 12,
.device_id = ME2000_DEVICE_ID, .ai_range = &me2000_ai_range,
.ai_channel_nbr = 16, }
/* Analog Input */
.ai_resolution = 12,
.ai_range_list = &me2000_ai_range,
}
}; };
/* Private data structure */ /* Private data structure */
...@@ -712,23 +707,23 @@ static int me_attach_pci(struct comedi_device *dev, struct pci_dev *pcidev) ...@@ -712,23 +707,23 @@ static int me_attach_pci(struct comedi_device *dev, struct pci_dev *pcidev)
s = &dev->subdevices[0]; s = &dev->subdevices[0];
s->type = COMEDI_SUBD_AI; s->type = COMEDI_SUBD_AI;
s->subdev_flags = SDF_READABLE | SDF_COMMON | SDF_CMD_READ; s->subdev_flags = SDF_READABLE | SDF_COMMON | SDF_CMD_READ;
s->n_chan = board->ai_channel_nbr; s->n_chan = board->ai_chans;
s->maxdata = (1 << board->ai_resolution) - 1; s->maxdata = (1 << board->ai_bits) - 1;
s->len_chanlist = board->ai_channel_nbr; s->len_chanlist = board->ai_chans;
s->range_table = board->ai_range_list; s->range_table = board->ai_range;
s->cancel = me_ai_cancel; s->cancel = me_ai_cancel;
s->insn_read = me_ai_insn_read; s->insn_read = me_ai_insn_read;
s->do_cmdtest = me_ai_do_cmd_test; s->do_cmdtest = me_ai_do_cmd_test;
s->do_cmd = me_ai_do_cmd; s->do_cmd = me_ai_do_cmd;
s = &dev->subdevices[1]; s = &dev->subdevices[1];
if (board->ao_channel_nbr) { if (board->ao_chans) {
s->type = COMEDI_SUBD_AO; s->type = COMEDI_SUBD_AO;
s->subdev_flags = SDF_WRITEABLE | SDF_COMMON; s->subdev_flags = SDF_WRITEABLE | SDF_COMMON;
s->n_chan = board->ao_channel_nbr; s->n_chan = board->ao_chans;
s->maxdata = (1 << board->ao_resolution) - 1; s->maxdata = (1 << board->ao_bits) - 1;
s->len_chanlist = board->ao_channel_nbr; s->len_chanlist = board->ao_chans;
s->range_table = board->ao_range_list; s->range_table = board->ao_range;
s->insn_read = me_ao_insn_read; s->insn_read = me_ao_insn_read;
s->insn_write = me_ao_insn_write; s->insn_write = me_ao_insn_write;
} else { } else {
......
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