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

staging: comedi: pcl818: introduce pcl818_ai_soft_trig()

Introduce a helper function to start a software triggered analog input
conversion.
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 9fd3effa
...@@ -406,6 +406,11 @@ static void pcl818_ai_clear_eoc(struct comedi_device *dev) ...@@ -406,6 +406,11 @@ static void pcl818_ai_clear_eoc(struct comedi_device *dev)
outb(0, dev->iobase + PCL818_CLRINT); outb(0, dev->iobase + PCL818_CLRINT);
} }
static void pcl818_ai_soft_trig(struct comedi_device *dev)
{
/* writing any value triggers a software conversion */
outb(0, dev->iobase + PCL818_AD_LO);
}
static unsigned int pcl818_ai_get_fifo_sample(struct comedi_device *dev, static unsigned int pcl818_ai_get_fifo_sample(struct comedi_device *dev,
struct comedi_subdevice *s, struct comedi_subdevice *s,
...@@ -915,7 +920,7 @@ static int pcl818_ai_cancel(struct comedi_device *dev, ...@@ -915,7 +920,7 @@ static int pcl818_ai_cancel(struct comedi_device *dev,
dev->iobase + PCL818_CONTROL); /* Stop A/D */ dev->iobase + PCL818_CONTROL); /* Stop A/D */
udelay(1); udelay(1);
pcl818_start_pacer(dev, false); pcl818_start_pacer(dev, false);
outb(0, dev->iobase + PCL818_AD_LO); pcl818_ai_soft_trig(dev);
pcl818_ai_get_sample(dev, s, NULL); pcl818_ai_get_sample(dev, s, NULL);
outb(0, dev->iobase + PCL818_CONTROL); /* Stop A/D */ outb(0, dev->iobase + PCL818_CONTROL); /* Stop A/D */
pcl818_ai_clear_eoc(dev); pcl818_ai_clear_eoc(dev);
...@@ -951,8 +956,7 @@ static int pcl818_ai_insn_read(struct comedi_device *dev, ...@@ -951,8 +956,7 @@ static int pcl818_ai_insn_read(struct comedi_device *dev,
for (i = 0; i < insn->n; i++) { for (i = 0; i < insn->n; i++) {
pcl818_ai_clear_eoc(dev); pcl818_ai_clear_eoc(dev);
/* start conversion */ pcl818_ai_soft_trig(dev);
outb(0, dev->iobase + PCL818_AD_LO);
ret = comedi_timeout(dev, s, insn, pcl818_ai_eoc, 0); ret = comedi_timeout(dev, s, insn, pcl818_ai_eoc, 0);
if (ret) if (ret)
......
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