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

staging: comedi: addi_apci_3120: reset fifo after programming chanlist

The APCI-3120 documentation says that the FIFO should be reset after the
chanlist sequence is programmed.

Reset the FIFO after programming the chanlist and remove the extra FIFO
resets in the driver.
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 502ccab2
...@@ -112,7 +112,6 @@ static int apci3120_reset(struct comedi_device *dev) ...@@ -112,7 +112,6 @@ static int apci3120_reset(struct comedi_device *dev)
devpriv->ctrl = 0; devpriv->ctrl = 0;
outw(devpriv->ctrl, dev->iobase + APCI3120_CTRL_REG); outw(devpriv->ctrl, dev->iobase + APCI3120_CTRL_REG);
apci3120_ai_reset_fifo(dev);
inw(dev->iobase + APCI3120_STATUS_REG); inw(dev->iobase + APCI3120_STATUS_REG);
return 0; return 0;
...@@ -143,7 +142,6 @@ static int apci3120_cancel(struct comedi_device *dev, ...@@ -143,7 +142,6 @@ static int apci3120_cancel(struct comedi_device *dev,
devpriv->mode = 0; devpriv->mode = 0;
outb(devpriv->mode, dev->iobase + APCI3120_MODE_REG); outb(devpriv->mode, dev->iobase + APCI3120_MODE_REG);
apci3120_ai_reset_fifo(dev);
inw(dev->iobase + APCI3120_STATUS_REG); inw(dev->iobase + APCI3120_STATUS_REG);
devpriv->ui_DmaActualBuffer = 0; devpriv->ui_DmaActualBuffer = 0;
...@@ -382,8 +380,6 @@ static int apci3120_ai_cmd(struct comedi_device *dev, ...@@ -382,8 +380,6 @@ static int apci3120_ai_cmd(struct comedi_device *dev,
outl(APCI3120_CLEAR_WRITE_TC_INT, outl(APCI3120_CLEAR_WRITE_TC_INT,
devpriv->amcc + APCI3120_AMCC_OP_REG_INTCSR); devpriv->amcc + APCI3120_AMCC_OP_REG_INTCSR);
apci3120_ai_reset_fifo(dev);
devpriv->ui_DmaActualBuffer = 0; devpriv->ui_DmaActualBuffer = 0;
/* load chanlist for command scan */ /* load chanlist for command scan */
......
...@@ -305,6 +305,8 @@ static void apci3120_set_chanlist(struct comedi_device *dev, ...@@ -305,6 +305,8 @@ static void apci3120_set_chanlist(struct comedi_device *dev,
outw(val, dev->iobase + APCI3120_CHANLIST_REG); outw(val, dev->iobase + APCI3120_CHANLIST_REG);
} }
apci3120_ai_reset_fifo(dev);
} }
#include "addi-data/hwdrv_apci3120.c" #include "addi-data/hwdrv_apci3120.c"
...@@ -352,8 +354,6 @@ static int apci3120_ai_insn_read(struct comedi_device *dev, ...@@ -352,8 +354,6 @@ static int apci3120_ai_insn_read(struct comedi_device *dev,
/* fixed conversion time of 10 us */ /* fixed conversion time of 10 us */
divisor = apci3120_ns_to_timer(dev, 0, 10000, CMDF_ROUND_NEAREST); divisor = apci3120_ns_to_timer(dev, 0, 10000, CMDF_ROUND_NEAREST);
apci3120_ai_reset_fifo(dev);
for (i = 0; i < insn->n; i++) { for (i = 0; i < insn->n; i++) {
/* trigger conversion */ /* trigger conversion */
apci3120_timer_write(dev, 0, divisor); apci3120_timer_write(dev, 0, divisor);
......
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