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

staging: comedi: cb_das16_cs: the DAC16/16-AO only has 4 digital I/O

The PC-CARD DAS16/16-AO board only has 4 digital I/O channels. The other
boards supported by this driver have 8. Add the boardinfo to correctly
initialize the subdevice.
Signed-off-by: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: default avatarIan Abbott <abbotti@mev.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent c34f202b
...@@ -100,6 +100,7 @@ struct das16cs_board { ...@@ -100,6 +100,7 @@ struct das16cs_board {
const char *name; const char *name;
int device_id; int device_id;
unsigned int has_ao:1; unsigned int has_ao:1;
unsigned int has_4dio:1;
}; };
static const struct das16cs_board das16cs_boards[] = { static const struct das16cs_board das16cs_boards[] = {
...@@ -107,6 +108,7 @@ static const struct das16cs_board das16cs_boards[] = { ...@@ -107,6 +108,7 @@ static const struct das16cs_board das16cs_boards[] = {
.name = "PC-CARD DAS16/16-AO", .name = "PC-CARD DAS16/16-AO",
.device_id = 0x0039, .device_id = 0x0039,
.has_ao = 1, .has_ao = 1,
.has_4dio = 1,
}, { }, {
.name = "PCM-DAS16s/16", .name = "PCM-DAS16s/16",
.device_id = 0x4009, .device_id = 0x4009,
...@@ -407,11 +409,11 @@ static int das16cs_auto_attach(struct comedi_device *dev, ...@@ -407,11 +409,11 @@ static int das16cs_auto_attach(struct comedi_device *dev,
s->type = COMEDI_SUBD_UNUSED; s->type = COMEDI_SUBD_UNUSED;
} }
/* Digital I/O subdevice */
s = &dev->subdevices[2]; s = &dev->subdevices[2];
/* digital i/o subdevice */
s->type = COMEDI_SUBD_DIO; s->type = COMEDI_SUBD_DIO;
s->subdev_flags = SDF_READABLE | SDF_WRITABLE; s->subdev_flags = SDF_READABLE | SDF_WRITABLE;
s->n_chan = 8; s->n_chan = board->has_4dio ? 4 : 8;
s->maxdata = 1; s->maxdata = 1;
s->range_table = &range_digital; s->range_table = &range_digital;
s->insn_bits = das16cs_dio_insn_bits; s->insn_bits = das16cs_dio_insn_bits;
......
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