Commit 848a7f7a authored by H Hartley Sweeten's avatar H Hartley Sweeten Committed by Greg Kroah-Hartman

staging: comedi: quatech_daqp_cs: fix daqp_ai_cancel()

Make sure interrupts are disabled and the event flags are cleared when
an analog input async command is canceled.

Remove the unnecessary calls to stop any running conversions in the
(*insn_read) and (*do_cmd) functions. The comedi core will only call
these functions if the subdevice is not busy (it has already been
canceled).
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 77e7c200
...@@ -171,19 +171,21 @@ static int daqp_clear_events(struct comedi_device *dev, int loops) ...@@ -171,19 +171,21 @@ static int daqp_clear_events(struct comedi_device *dev, int loops)
return -EBUSY; return -EBUSY;
} }
/* Cancel a running acquisition */ static int daqp_ai_cancel(struct comedi_device *dev,
struct comedi_subdevice *s)
static int daqp_ai_cancel(struct comedi_device *dev, struct comedi_subdevice *s)
{ {
struct daqp_private *devpriv = dev->private; struct daqp_private *devpriv = dev->private;
if (devpriv->stop) if (devpriv->stop)
return -EIO; return -EIO;
/*
* Stop any conversions, disable interrupts, and clear
* the status event flags.
*/
outb(DAQP_CMD_STOP, dev->iobase + DAQP_CMD_REG); outb(DAQP_CMD_STOP, dev->iobase + DAQP_CMD_REG);
outb(0, dev->iobase + DAQP_CTRL_REG);
/* flush any linguring data in FIFO - superfluous here */ inb(dev->iobase + DAQP_STATUS_REG);
/* outb(DAQP_CMD_RSTF, dev->iobase + DAQP_CMD_REG); */
return 0; return 0;
} }
...@@ -298,9 +300,6 @@ static int daqp_ai_insn_read(struct comedi_device *dev, ...@@ -298,9 +300,6 @@ static int daqp_ai_insn_read(struct comedi_device *dev,
if (devpriv->stop) if (devpriv->stop)
return -EIO; return -EIO;
/* Stop any running conversion */
daqp_ai_cancel(dev, s);
outb(0, dev->iobase + DAQP_AUX_REG); outb(0, dev->iobase + DAQP_AUX_REG);
/* Reset scan list queue */ /* Reset scan list queue */
...@@ -466,9 +465,6 @@ static int daqp_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s) ...@@ -466,9 +465,6 @@ static int daqp_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s)
if (devpriv->stop) if (devpriv->stop)
return -EIO; return -EIO;
/* Stop any running conversion */
daqp_ai_cancel(dev, s);
outb(0, dev->iobase + DAQP_AUX_REG); outb(0, dev->iobase + DAQP_AUX_REG);
/* Reset scan list queue */ /* Reset scan list queue */
......
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