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

staging: comedi: rti800: save unmunged data for ao readback

The unmunged data should be saved for readback not the munged data.
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 c2dfc3a5
......@@ -231,11 +231,13 @@ static int rti800_ao_insn_write(struct comedi_device *dev,
unsigned int chan = CR_CHAN(insn->chanspec);
int reg_lo = chan ? RTI800_DAC1LO : RTI800_DAC0LO;
int reg_hi = chan ? RTI800_DAC1HI : RTI800_DAC0HI;
int val = devpriv->ao_readback[chan];
int i;
for (i = 0; i < insn->n; i++) {
val = data[i];
unsigned int val = data[i];
devpriv->ao_readback[chan] = val;
if (devpriv->dac_2comp[chan])
val ^= 0x800;
......@@ -243,8 +245,6 @@ static int rti800_ao_insn_write(struct comedi_device *dev,
outb((val >> 8) & 0xff, dev->iobase + reg_hi);
}
devpriv->ao_readback[chan] = val;
return insn->n;
}
......
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