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

staging: comedi: adv_pci1710: ai (*cancel) should not enable software trigger

The (*cancel) operation should do just that. Remove the setting of the SW bit
which enables the software trigger.

For aesthetics, rename the function so it has namespace associated with the
driver and add a couple comments.
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 d3e8ab48
...@@ -365,16 +365,19 @@ static int pci171x_ai_insn_read(struct comedi_device *dev, ...@@ -365,16 +365,19 @@ static int pci171x_ai_insn_read(struct comedi_device *dev,
return ret ? ret : insn->n; return ret ? ret : insn->n;
} }
static int pci171x_ai_cancel(struct comedi_device *dev, static int pci1710_ai_cancel(struct comedi_device *dev,
struct comedi_subdevice *s) struct comedi_subdevice *s)
{ {
struct pci1710_private *devpriv = dev->private; struct pci1710_private *devpriv = dev->private;
devpriv->ctrl &= PCI171X_CTRL_CNT0; /* disable A/D triggers and interrupt sources */
devpriv->ctrl |= PCI171X_CTRL_SW; devpriv->ctrl &= PCI171X_CTRL_CNT0; /* preserve counter 0 clk src */
/* reset any operations */
outw(devpriv->ctrl, dev->iobase + PCI171X_CTRL_REG); outw(devpriv->ctrl, dev->iobase + PCI171X_CTRL_REG);
/* disable pacer */
comedi_8254_pacer_enable(dev->pacer, 1, 2, false); comedi_8254_pacer_enable(dev->pacer, 1, 2, false);
/* clear A/D FIFO and any pending interrutps */
outb(0, dev->iobase + PCI171X_CLRFIFO_REG); outb(0, dev->iobase + PCI171X_CLRFIFO_REG);
outb(0, dev->iobase + PCI171X_CLRINT_REG); outb(0, dev->iobase + PCI171X_CLRINT_REG);
...@@ -806,7 +809,7 @@ static int pci1710_auto_attach(struct comedi_device *dev, ...@@ -806,7 +809,7 @@ static int pci1710_auto_attach(struct comedi_device *dev,
s->len_chanlist = s->n_chan; s->len_chanlist = s->n_chan;
s->do_cmdtest = pci171x_ai_cmdtest; s->do_cmdtest = pci171x_ai_cmdtest;
s->do_cmd = pci171x_ai_cmd; s->do_cmd = pci171x_ai_cmd;
s->cancel = pci171x_ai_cancel; s->cancel = pci1710_ai_cancel;
} }
/* find the value needed to adjust for unipolar gain codes */ /* find the value needed to adjust for unipolar gain codes */
......
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