devpriv->dma_runs_to_end--;
}
+static void pcl816_ai_clear_eoc(struct comedi_device *dev)
+{
+ /* writing any value clears the interrupt request */
+ outb(0, dev->iobase + PCL816_CLRINT);
+}
+
static unsigned int pcl816_ai_get_sample(struct comedi_device *dev,
struct comedi_subdevice *s)
{
unsigned int len;
if (!dev->attached || !devpriv->ai_cmd_running) {
- outb(0, dev->iobase + PCL816_CLRINT);
+ pcl816_ai_clear_eoc(dev);
return IRQ_HANDLED;
}
if (devpriv->ai_cmd_canceled) {
devpriv->ai_cmd_canceled = 0;
- outb(0, dev->iobase + PCL816_CLRINT);
+ pcl816_ai_clear_eoc(dev);
return IRQ_HANDLED;
}
transfer_from_dma_buf(dev, s, ptr, bufptr, len);
- outb(0, dev->iobase + PCL816_CLRINT);
+ pcl816_ai_clear_eoc(dev);
comedi_event(dev, s);
return IRQ_HANDLED;
outb(0, dev->iobase + PCL816_AD_LO);
pcl816_ai_get_sample(dev, s);
- /* clear INT request */
- outb(0, dev->iobase + PCL816_CLRINT);
+ pcl816_ai_clear_eoc(dev);
/* Stop A/D */
outb(0, dev->iobase + PCL816_CONTROL);
outb(range, dev->iobase + PCL816_RANGE);
for (i = 0; i < insn->n; i++) {
- /* clear INT (conversion end) flag */
- outb(0, dev->iobase + PCL816_CLRINT);
+ pcl816_ai_clear_eoc(dev);
/* start conversion */
outb(0, dev->iobase + PCL816_AD_LO);
data[i] = pcl816_ai_get_sample(dev, s);
}
- /* clear INT (conversion end) flag */
- outb(0, dev->iobase + PCL816_CLRINT);
+ pcl816_ai_clear_eoc(dev);
return ret ? ret : insn->n;
}
outb(0, dev->iobase + PCL816_CONTROL);
outb(0, dev->iobase + PCL816_MUX);
- outb(0, dev->iobase + PCL816_CLRINT);
+ pcl816_ai_clear_eoc(dev);
/* Stop pacer */
i8254_set_mode(timer_base, 0, 2, I8254_MODE0 | I8254_BINARY);