summaryrefslogtreecommitdiffstats
path: root/drivers/staging/comedi
diff options
context:
space:
mode:
authorIan Abbott <abbotti@mev.co.uk>2021-03-01 16:57:53 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-03-10 09:25:31 +0100
commit46ffba0622f7171208fa2ec9d9d4ddc51c9ae1b4 (patch)
tree6c12698d20062426a6eac1ea7ec28882c2f42ef9 /drivers/staging/comedi
parent7a3f3a7005cba9cfc1a0d50978f3eb7f3094e02f (diff)
downloadlinux-stable-46ffba0622f7171208fa2ec9d9d4ddc51c9ae1b4.tar.gz
linux-stable-46ffba0622f7171208fa2ec9d9d4ddc51c9ae1b4.tar.bz2
linux-stable-46ffba0622f7171208fa2ec9d9d4ddc51c9ae1b4.zip
staging: comedi: dt2814: Don't wait for conversion in interrupt handler
When the interrupt handler decides the final sample has been acquired, it turns off the timer enable (ENB) bit in the Command register. That triggers another A/D conversion. The interrupt handler currently waits for that to finish and then reads the resulting, unwanted sample. Since the functions for handling Comedi read instructions and for setting up asynchronous commands now call `dt2814_ai_clear()` to wait for and discard any spurious A/D conversion, let's remove that code from the interrupt handler. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Link: https://lore.kernel.org/r/20210301165757.243065-3-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/dt2814.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/drivers/staging/comedi/drivers/dt2814.c b/drivers/staging/comedi/drivers/dt2814.c
index 7e73aa094eea..8a70b7ba30f4 100644
--- a/drivers/staging/comedi/drivers/dt2814.c
+++ b/drivers/staging/comedi/drivers/dt2814.c
@@ -238,21 +238,13 @@ static irqreturn_t dt2814_interrupt(int irq, void *d)
inb(dev->iobase + DT2814_DATA);
if (!(--devpriv->ntrig)) {
- int i;
-
outb(0, dev->iobase + DT2814_CSR);
/*
- * note: turning off timed mode triggers another
- * sample.
+ * Note: turning off timed mode triggers another
+ * sample. This will be mopped up by the calls to
+ * dt2814_ai_clear().
*/
- for (i = 0; i < DT2814_TIMEOUT; i++) {
- if (inb(dev->iobase + DT2814_CSR) & DT2814_FINISH)
- break;
- }
- inb(dev->iobase + DT2814_DATA);
- inb(dev->iobase + DT2814_DATA);
-
s->async->events |= COMEDI_CB_EOA;
}
comedi_handle_events(dev, s);