mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-14 14:42:34 -04:00
staging: comedi: ii_pci20kc: save unmunged data for ao readback
The unmunged data should be saved for readback not the munged data. 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:
committed by
Greg Kroah-Hartman
parent
42c7b55cce
commit
c3c17d2ead
@@ -165,12 +165,14 @@ static int ii20k_ao_insn_write(struct comedi_device *dev,
|
||||
struct ii20k_ao_private *ao_spriv = s->private;
|
||||
void __iomem *iobase = ii20k_module_iobase(dev, s);
|
||||
unsigned int chan = CR_CHAN(insn->chanspec);
|
||||
unsigned int val = ao_spriv->last_data[chan];
|
||||
unsigned int val;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < insn->n; i++) {
|
||||
val = data[i];
|
||||
|
||||
ao_spriv->last_data[chan] = val;
|
||||
|
||||
/* munge data */
|
||||
val += ((s->maxdata + 1) >> 1);
|
||||
val &= s->maxdata;
|
||||
@@ -180,8 +182,6 @@ static int ii20k_ao_insn_write(struct comedi_device *dev,
|
||||
writeb(0x00, iobase + II20K_AO_STRB_REG(chan));
|
||||
}
|
||||
|
||||
ao_spriv->last_data[chan] = val;
|
||||
|
||||
return insn->n;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user