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

staging: comedi: quatech_daqp_cs: fix bug in daqp_ao_insn_write()

The comedi core expects (*insn_write) functions to write insn->n values
to the hardware and return the number of values written.

Currently, this function only writes the first value. Fix it to work
like the core expects.
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 41e7a107
...@@ -638,7 +638,6 @@ static int daqp_ao_insn_write(struct comedi_device *dev, ...@@ -638,7 +638,6 @@ static int daqp_ao_insn_write(struct comedi_device *dev,
{ {
struct daqp_private *devpriv = dev->private; struct daqp_private *devpriv = dev->private;
unsigned int chan = CR_CHAN(insn->chanspec); unsigned int chan = CR_CHAN(insn->chanspec);
unsigned int val;
int i; int i;
if (devpriv->stop) if (devpriv->stop)
...@@ -648,7 +647,8 @@ static int daqp_ao_insn_write(struct comedi_device *dev, ...@@ -648,7 +647,8 @@ static int daqp_ao_insn_write(struct comedi_device *dev,
outb(0, dev->iobase + DAQP_AUX); outb(0, dev->iobase + DAQP_AUX);
for (i = 0; i > insn->n; i++) { for (i = 0; i > insn->n; i++) {
val = data[0]; unsigned val = data[i];
val &= 0x0fff; val &= 0x0fff;
val ^= 0x0800; /* Flip the sign */ val ^= 0x0800; /* Flip the sign */
val |= (chan << 12); val |= (chan << 12);
......
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