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>
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;
writeb(0x00, iobase + II20K_AO_STRB_REG(chan));
}
- ao_spriv->last_data[chan] = val;
-
return insn->n;
}