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

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
Loading
Loading
Loading
Loading
+0 −4
Original line number Diff line number Diff line
@@ -112,7 +112,6 @@ static int apci3120_reset(struct comedi_device *dev)
	devpriv->ctrl = 0;
	outw(devpriv->ctrl, dev->iobase + APCI3120_CTRL_REG);

	apci3120_ai_reset_fifo(dev);
	inw(dev->iobase + APCI3120_STATUS_REG);

	return 0;
@@ -143,7 +142,6 @@ static int apci3120_cancel(struct comedi_device *dev,
	devpriv->mode = 0;
	outb(devpriv->mode, dev->iobase + APCI3120_MODE_REG);

	apci3120_ai_reset_fifo(dev);
	inw(dev->iobase + APCI3120_STATUS_REG);
	devpriv->ui_DmaActualBuffer = 0;

@@ -382,8 +380,6 @@ static int apci3120_ai_cmd(struct comedi_device *dev,
	outl(APCI3120_CLEAR_WRITE_TC_INT,
	     devpriv->amcc + APCI3120_AMCC_OP_REG_INTCSR);

	apci3120_ai_reset_fifo(dev);

	devpriv->ui_DmaActualBuffer = 0;

	/* load chanlist for command scan */
+2 −2
Original line number Diff line number Diff line
@@ -305,6 +305,8 @@ static void apci3120_set_chanlist(struct comedi_device *dev,

		outw(val, dev->iobase + APCI3120_CHANLIST_REG);
	}

	apci3120_ai_reset_fifo(dev);
}

#include "addi-data/hwdrv_apci3120.c"
@@ -352,8 +354,6 @@ static int apci3120_ai_insn_read(struct comedi_device *dev,
	/* fixed conversion time of 10 us */
	divisor = apci3120_ns_to_timer(dev, 0, 10000, CMDF_ROUND_NEAREST);

	apci3120_ai_reset_fifo(dev);

	for (i = 0; i < insn->n; i++) {
		/* trigger conversion */
		apci3120_timer_write(dev, 0, divisor);