diff options
author | H Hartley Sweeten <hsweeten@visionengravers.com> | 2015-10-19 09:44:00 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-10-24 19:15:22 -0700 |
commit | ef7e20934ec906e7986566d45ea8ae652a64ba09 (patch) | |
tree | 30b4002c6a665c3a7da76cffcab1dc80dd6a6466 /drivers/staging/comedi | |
parent | f92738ca2fa4f8ca30424ac2b770e2c8a8a7b364 (diff) |
staging: comedi: cb_pcidas: fix cb_pcidas_ao_fifo_insn_write()
The comedi core expects (*insn_write) functions to write insn->n
data values to the hardware. Fix this function to work like the
core expects.
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>
Diffstat (limited to 'drivers/staging/comedi')
-rw-r--r-- | drivers/staging/comedi/drivers/cb_pcidas.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/staging/comedi/drivers/cb_pcidas.c b/drivers/staging/comedi/drivers/cb_pcidas.c index 1e43c1a759d1..9e82fd24255f 100644 --- a/drivers/staging/comedi/drivers/cb_pcidas.c +++ b/drivers/staging/comedi/drivers/cb_pcidas.c @@ -445,7 +445,9 @@ static int cb_pcidas_ao_fifo_insn_write(struct comedi_device *dev, struct cb_pcidas_private *devpriv = dev->private; unsigned int chan = CR_CHAN(insn->chanspec); unsigned int range = CR_RANGE(insn->chanspec); + unsigned int val = s->readback[chan]; unsigned long flags; + int i; /* clear dac fifo */ outw(0, devpriv->pcibar4 + PCIDAS_AO_FIFO_CLR_REG); @@ -459,11 +461,12 @@ static int cb_pcidas_ao_fifo_insn_write(struct comedi_device *dev, outw(devpriv->ao_ctrl, devpriv->pcibar1 + PCIDAS_AO_REG); spin_unlock_irqrestore(&dev->spinlock, flags); - /* remember value for readback */ - s->readback[chan] = data[0]; + for (i = 0; i < insn->n; i++) { + val = data[i]; + outw(val, devpriv->pcibar4 + PCIDAS_AO_FIFO_REG); + } - /* send data */ - outw(data[0], devpriv->pcibar4 + PCIDAS_AO_FIFO_REG); + s->readback[chan] = val; return insn->n; } |