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

staging: comedi: pcl818: absorb pcl818_ai_mode13dma_int()

Absorb this function into pcl818_ai_cmd_mode() and simplify the code.
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 5af366ff
...@@ -677,22 +677,6 @@ static irqreturn_t pcl818_interrupt(int irq, void *d) ...@@ -677,22 +677,6 @@ static irqreturn_t pcl818_interrupt(int irq, void *d)
return IRQ_HANDLED; return IRQ_HANDLED;
} }
static void pcl818_ai_mode13dma_int(int mode, struct comedi_device *dev,
struct comedi_subdevice *s)
{
unsigned int ctrl = 0;
pcl818_ai_setup_dma(dev, s);
ctrl |= PCL818_CTRL_INTE | PCL818_CTRL_IRQ(dev->irq) | PCL818_CTRL_DMAE;
if (mode == 1)
ctrl |= PCL818_CTRL_PACER_TRIG;
else
ctrl |= PCL818_CTRL_EXT_TRIG;
outb(ctrl, dev->iobase + PCL818_CTRL_REG);
}
static int pcl818_ai_cmd_mode(int mode, struct comedi_device *dev, static int pcl818_ai_cmd_mode(int mode, struct comedi_device *dev,
struct comedi_subdevice *s) struct comedi_subdevice *s)
{ {
...@@ -722,28 +706,23 @@ static int pcl818_ai_cmd_mode(int mode, struct comedi_device *dev, ...@@ -722,28 +706,23 @@ static int pcl818_ai_cmd_mode(int mode, struct comedi_device *dev,
outb(0, dev->iobase + PCL818_CNTENABLE); /* enable pacer */ outb(0, dev->iobase + PCL818_CNTENABLE); /* enable pacer */
switch (devpriv->dma) { if (mode == 1)
case 1: /* DMA */ ctrl |= PCL818_CTRL_PACER_TRIG;
case 3: else
pcl818_ai_mode13dma_int(mode, dev, s); ctrl |= PCL818_CTRL_EXT_TRIG;
break;
case 0: if (devpriv->dma) {
if (!devpriv->usefifo) { pcl818_ai_setup_dma(dev, s);
ctrl |= PCL818_CTRL_INTE | PCL818_CTRL_IRQ(dev->irq);
if (mode == 1) ctrl |= PCL818_CTRL_INTE | PCL818_CTRL_IRQ(dev->irq) |
ctrl |= PCL818_CTRL_PACER_TRIG; PCL818_CTRL_DMAE;
else } else if (devpriv->usefifo) {
ctrl |= PCL818_CTRL_EXT_TRIG; /* enable FIFO */
} else { outb(1, dev->iobase + PCL818_FI_ENABLE);
/* enable FIFO */ } else {
outb(1, dev->iobase + PCL818_FI_ENABLE); ctrl |= PCL818_CTRL_INTE | PCL818_CTRL_IRQ(dev->irq);
if (mode == 1)
ctrl |= PCL818_CTRL_PACER_TRIG;
else
ctrl |= PCL818_CTRL_EXT_TRIG;
}
outb(ctrl, dev->iobase + PCL818_CTRL_REG);
} }
outb(ctrl, dev->iobase + PCL818_CTRL_REG);
pcl818_start_pacer(dev, mode == 1); pcl818_start_pacer(dev, mode == 1);
......
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