From: H Hartley Sweeten Date: Tue, 4 Nov 2014 17:54:54 +0000 (-0700) Subject: staging: comedi: addi_apci_3120: reset fifo after programming chanlist X-Git-Tag: v3.19-rc1~66^2~285 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=15e920fb1581c531f8d139534fa58d964d4e8b45;p=karo-tx-linux.git 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: H Hartley Sweeten Reviewed-by: Ian Abbott Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci3120.c b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci3120.c index 54c85837160e..95a1b7dad397 100644 --- a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci3120.c +++ b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci3120.c @@ -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 */ diff --git a/drivers/staging/comedi/drivers/addi_apci_3120.c b/drivers/staging/comedi/drivers/addi_apci_3120.c index 044d2c42bcd5..77499b473bb4 100644 --- a/drivers/staging/comedi/drivers/addi_apci_3120.c +++ b/drivers/staging/comedi/drivers/addi_apci_3120.c @@ -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);