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

staging: comedi: icp_multi: remove n_aichand from boardinfo

The analog inputs for this board always support differential
inputs and the number of channels is half the normal analog
input number.

Remove the n_aichand field from the boardinfo and fix the code
accordingly.
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 281ecb06
...@@ -130,7 +130,6 @@ struct boardtype { ...@@ -130,7 +130,6 @@ struct boardtype {
int iorange; /* I/O range len */ int iorange; /* I/O range len */
char have_irq; /* 1=card support IRQ */ char have_irq; /* 1=card support IRQ */
char cardtype; /* 0=ICP Multi */ char cardtype; /* 0=ICP Multi */
int n_aichand; /* num of A/D chans in diff mode */
int ai_maxdata; /* resolution of A/D */ int ai_maxdata; /* resolution of A/D */
int ao_maxdata; /* resolution of D/A */ int ao_maxdata; /* resolution of D/A */
const struct comedi_lrange *rangelist_ai; /* rangelist for A/D */ const struct comedi_lrange *rangelist_ai; /* rangelist for A/D */
...@@ -643,7 +642,7 @@ static int check_channel_list(struct comedi_device *dev, ...@@ -643,7 +642,7 @@ static int check_channel_list(struct comedi_device *dev,
for (i = 0; i < n_chan; i++) { for (i = 0; i < n_chan; i++) {
/* Check that channel number is < maximum */ /* Check that channel number is < maximum */
if (CR_AREF(chanlist[i]) == AREF_DIFF) { if (CR_AREF(chanlist[i]) == AREF_DIFF) {
if (CR_CHAN(chanlist[i]) > this_board->n_aichand) { if (CR_CHAN(chanlist[i]) > (s->nchan / 2)) {
comedi_error(dev, comedi_error(dev,
"Incorrect differential ai ch-nr"); "Incorrect differential ai ch-nr");
return 0; return 0;
...@@ -804,9 +803,7 @@ static int icp_multi_attach(struct comedi_device *dev, ...@@ -804,9 +803,7 @@ static int icp_multi_attach(struct comedi_device *dev,
s = &dev->subdevices[subdev]; s = &dev->subdevices[subdev];
dev->read_subdev = s; dev->read_subdev = s;
s->type = COMEDI_SUBD_AI; s->type = COMEDI_SUBD_AI;
s->subdev_flags = SDF_READABLE | SDF_COMMON | SDF_GROUND; s->subdev_flags = SDF_READABLE | SDF_COMMON | SDF_GROUND | SDF_DIFF;
if (this_board->n_aichand)
s->subdev_flags |= SDF_DIFF;
s->n_chan = 16; s->n_chan = 16;
s->maxdata = this_board->ai_maxdata; s->maxdata = this_board->ai_maxdata;
s->len_chanlist = 16; s->len_chanlist = 16;
...@@ -886,7 +883,6 @@ static const struct boardtype boardtypes[] = { ...@@ -886,7 +883,6 @@ static const struct boardtype boardtypes[] = {
.iorange = IORANGE_ICP_MULTI, .iorange = IORANGE_ICP_MULTI,
.have_irq = 1, .have_irq = 1,
.cardtype = TYPE_ICP_MULTI, .cardtype = TYPE_ICP_MULTI,
.n_aichand = 8,
.ai_maxdata = 0x0fff, .ai_maxdata = 0x0fff,
.ao_maxdata = 0x0fff, .ao_maxdata = 0x0fff,
.rangelist_ai = &range_analog, .rangelist_ai = &range_analog,
......
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