mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-14 08:36:12 -04:00
staging: comedi: das16: use comedi_subdevice 'readback'
Use the new comedi_subdevice 'readback' member and the core provided (*insn_read) for the readback of the analog output subdevice channels. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
800242553a
commit
551739b0d3
1 changed files with 9 additions and 2 deletions
|
|
@ -927,11 +927,13 @@ static int das16_ao_insn_write(struct comedi_device *dev,
|
|||
unsigned int *data)
|
||||
{
|
||||
unsigned int chan = CR_CHAN(insn->chanspec);
|
||||
unsigned int val;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < insn->n; i++) {
|
||||
val = data[i];
|
||||
unsigned int val = data[i];
|
||||
|
||||
s->readback[chan] = val;
|
||||
|
||||
val <<= 4;
|
||||
|
||||
outb(val & 0xff, dev->iobase + DAS16_AO_LSB_REG(chan));
|
||||
|
|
@ -1163,6 +1165,11 @@ static int das16_attach(struct comedi_device *dev, struct comedi_devconfig *it)
|
|||
s->maxdata = 0x0fff;
|
||||
s->range_table = devpriv->user_ao_range_table;
|
||||
s->insn_write = das16_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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue