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

staging: comedi: addi_apci_3120: provide analog output 'readback'

Use the comedi_subdevice 'readback' member and the core provided (*insn_read)
function to provide radback of the analog output channels.
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 6174801d
......@@ -1924,6 +1924,8 @@ static int apci3120_ao_insn_write(struct comedi_device *dev,
outw(APCI3120_AO_MUX(chan) | APCI3120_AO_DATA(val),
dev->iobase + APCI3120_AO_REG(chan));
s->readback[chan] = val;
}
return insn->n;
......
......@@ -195,6 +195,11 @@ static int apci3120_auto_attach(struct comedi_device *dev,
s->maxdata = 0x3fff;
s->range_table = &range_bipolar10;
s->insn_write = apci3120_ao_insn_write;
s->insn_read = comedi_readback_insn_read;
ret = comedi_alloc_subdev_readback(s);
if (ret)
return ret;
} else {
s->type = COMEDI_SUBD_UNUSED;
}
......
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