Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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;
+5 −0
Original line number Diff line number Diff line
@@ -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;
	}