The analog output channels of the PCI-1724U have output ranges set individually per channel, rather than being set for the whole subdevice, so set a range_table_list for the subdevice rather than a single range_table. This is mostly for the benefit of user-level as in fact the output ranges of each channel are partly set by per-channel hardware jumpers (to choose between voltage and current loop output) and partly by the offset and gain calibration subdevices. Signed-off-by: Ian Abbott <abbotti@xxxxxxxxx> Cc: Frank Mori Hess <fmh6jj@xxxxxxxxx> --- drivers/staging/comedi/drivers/adv_pci1724.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/staging/comedi/drivers/adv_pci1724.c b/drivers/staging/comedi/drivers/adv_pci1724.c index af64d59..1e2f27c 100644 --- a/drivers/staging/comedi/drivers/adv_pci1724.c +++ b/drivers/staging/comedi/drivers/adv_pci1724.c @@ -128,6 +128,11 @@ static const struct comedi_lrange ao_ranges_1724 = { 4, } }; +static const struct comedi_lrange *const ao_range_list_1724[NUM_AO_CHANNELS] = { + [0 ... NUM_AO_CHANNELS - 1] = &ao_ranges_1724, +}; + + static DEFINE_PCI_DEVICE_TABLE(adv_pci1724_pci_table) = { { PCI_DEVICE(PCI_VENDOR_ID_ADVANTECH, 0x1724) }, { 0 } @@ -201,7 +206,7 @@ static int setup_subdevices(struct comedi_device *dev) s->subdev_flags = SDF_READABLE | SDF_WRITABLE | SDF_GROUND; s->n_chan = NUM_AO_CHANNELS; s->maxdata = 0x3fff; - s->range_table = &ao_ranges_1724; + s->range_table_list = ao_range_list_1724; s->insn_read = ao_readback_insn; s->insn_write = ao_winsn; -- 1.8.1.2 _______________________________________________ devel mailing list devel@xxxxxxxxxxxxxxxxxxxxxx http://driverdev.linuxdriverproject.org/mailman/listinfo/devel