Commit a71f18d2 authored by Ian Abbott's avatar Ian Abbott Committed by Greg Kroah-Hartman

Staging: comedi: pcl818: Fix option handling for FIFO mode (hopefully!).

Signed-off-by: default avatarFrank Mori Hess <fmhess@users.sourceforge.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 6a2436e4
...@@ -1025,26 +1025,32 @@ static int pcl818_ai_cmd_mode(int mode, struct comedi_device * dev, ...@@ -1025,26 +1025,32 @@ static int pcl818_ai_cmd_mode(int mode, struct comedi_device * dev,
} }
#endif #endif
break; break;
case 0: /* IRQ */ case 0:
/* rt_printk("IRQ\n"); */ if (!devpriv->usefifo) {
if (mode == 1) { /* IRQ */
devpriv->ai_mode = INT_TYPE_AI1_INT; /* rt_printk("IRQ\n"); */
outb(0x83 | (dev->irq << 4), dev->iobase + PCL818_CONTROL); /* Pacer+IRQ */ if (mode == 1) {
} else { devpriv->ai_mode = INT_TYPE_AI1_INT;
devpriv->ai_mode = INT_TYPE_AI3_INT; /* Pacer+IRQ */
outb(0x82 | (dev->irq << 4), dev->iobase + PCL818_CONTROL); /* Ext trig+IRQ */ outb(0x83 | (dev->irq << 4), dev->iobase + PCL818_CONTROL);
}; } else {
break; devpriv->ai_mode = INT_TYPE_AI3_INT;
case -1: /* FIFO */ /* Ext trig+IRQ */
outb(1, dev->iobase + PCL818_FI_ENABLE); /* enable FIFO */ outb(0x82 | (dev->irq << 4), dev->iobase + PCL818_CONTROL);
if (mode == 1) { }
devpriv->ai_mode = INT_TYPE_AI1_FIFO;
outb(0x03, dev->iobase + PCL818_CONTROL); /* Pacer */
} else { } else {
devpriv->ai_mode = INT_TYPE_AI3_FIFO; /* FIFO */
outb(0x02, dev->iobase + PCL818_CONTROL); /* enable FIFO */
}; /* Ext trig */ outb(1, dev->iobase + PCL818_FI_ENABLE);
break; if (mode == 1) {
devpriv->ai_mode = INT_TYPE_AI1_FIFO;
/* Pacer */
outb(0x03, dev->iobase + PCL818_CONTROL);
} else {
devpriv->ai_mode = INT_TYPE_AI3_FIFO;
outb(0x02, dev->iobase + PCL818_CONTROL);
}
}
} }
start_pacer(dev, mode, divisor1, divisor2); start_pacer(dev, mode, divisor1, divisor2);
...@@ -1687,7 +1693,8 @@ static int pcl818_attach(struct comedi_device * dev, struct comedi_devconfig * i ...@@ -1687,7 +1693,8 @@ static int pcl818_attach(struct comedi_device * dev, struct comedi_devconfig * i
{ {
int ret; int ret;
unsigned long iobase; unsigned long iobase;
unsigned int irq, dma; unsigned int irq;
int dma;
unsigned long pages; unsigned long pages;
struct comedi_subdevice *s; struct comedi_subdevice *s;
......
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