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

staging: comedi: pcl711: remove 'is_pcl711b' from boardinfo

This member in the board info is used to indicate if the board is
a PCL711B. This board uses bits in the mode register to select the
IRQ used for interrupts. These bits do nothing on the other boards
supported by this driver.

Remove the 'is_pcl711b' variable from the boardinfo. Also, remove
the 'mode' variable from the private data and just calculate the
mode bits when needed.
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 54f0db98
...@@ -141,7 +141,6 @@ static const int i8253_osc_base = 500; /* 2 Mhz */ ...@@ -141,7 +141,6 @@ static const int i8253_osc_base = 500; /* 2 Mhz */
struct pcl711_board { struct pcl711_board {
const char *name; const char *name;
unsigned int is_pcl711b:1;
int n_aichan; int n_aichan;
int n_aochan; int n_aochan;
int maxirq; int maxirq;
...@@ -156,7 +155,6 @@ static const struct pcl711_board boardtypes[] = { ...@@ -156,7 +155,6 @@ static const struct pcl711_board boardtypes[] = {
.ai_range_type = &range_bipolar5, .ai_range_type = &range_bipolar5,
}, { }, {
.name = "pcl711b", .name = "pcl711b",
.is_pcl711b = 1,
.n_aichan = 8, .n_aichan = 8,
.n_aochan = 1, .n_aochan = 1,
.maxirq = 7, .maxirq = 7,
...@@ -182,7 +180,6 @@ struct pcl711_private { ...@@ -182,7 +180,6 @@ struct pcl711_private {
int adchan; int adchan;
int ntrig; int ntrig;
int aip[8]; int aip[8];
int mode;
unsigned int ao_readback[2]; unsigned int ao_readback[2];
unsigned int divisor1; unsigned int divisor1;
unsigned int divisor2; unsigned int divisor2;
...@@ -190,10 +187,16 @@ struct pcl711_private { ...@@ -190,10 +187,16 @@ struct pcl711_private {
static void pcl711_ai_set_mode(struct comedi_device *dev, unsigned int mode) static void pcl711_ai_set_mode(struct comedi_device *dev, unsigned int mode)
{ {
struct pcl711_private *devpriv = dev->private; /*
* The pcl711b board uses bits in the mode register to select the
* interrupt. The other boards supported by this driver all use
* jumpers on the board.
*
* Enables the interrupt when needed on the pcl711b board. These
* bits do nothing on the other boards.
*/
if (mode == PCL711_MODE_EXT_IRQ || mode == PCL711_MODE_PACER_IRQ) if (mode == PCL711_MODE_EXT_IRQ || mode == PCL711_MODE_PACER_IRQ)
mode |= devpriv->mode; mode |= PCL711_MODE_IRQ(dev->irq);
outb(mode, dev->iobase + PCL711_MODE_REG); outb(mode, dev->iobase + PCL711_MODE_REG);
} }
...@@ -504,16 +507,8 @@ static int pcl711_attach(struct comedi_device *dev, struct comedi_devconfig *it) ...@@ -504,16 +507,8 @@ static int pcl711_attach(struct comedi_device *dev, struct comedi_devconfig *it)
if (it->options[1] && it->options[1] <= board->maxirq) { if (it->options[1] && it->options[1] <= board->maxirq) {
ret = request_irq(it->options[1], pcl711_interrupt, 0, ret = request_irq(it->options[1], pcl711_interrupt, 0,
dev->board_name, dev); dev->board_name, dev);
if (ret == 0) { if (ret == 0)
dev->irq = it->options[1]; dev->irq = it->options[1];
/*
* The PCL711b needs the irq number in the
* mode register.
*/
if (board->is_pcl711b)
devpriv->mode = PCL711_MODE_IRQ(dev->irq);
}
} }
ret = comedi_alloc_subdevices(dev, 4); ret = comedi_alloc_subdevices(dev, 4);
......
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