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

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

This member in the boardinfo is redundant. All the 8112 style boards
have > 8 analog input channels (16 actually). We can use that information
instead and remove the extra boardinfo.
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 95bee441
...@@ -142,7 +142,6 @@ static const int i8253_osc_base = 500; /* 2 Mhz */ ...@@ -142,7 +142,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; unsigned int is_pcl711b:1;
unsigned int is_8112:1;
int n_aichan; int n_aichan;
int n_aochan; int n_aochan;
int maxirq; int maxirq;
...@@ -164,14 +163,12 @@ static const struct pcl711_board boardtypes[] = { ...@@ -164,14 +163,12 @@ static const struct pcl711_board boardtypes[] = {
.ai_range_type = &range_pcl711b_ai, .ai_range_type = &range_pcl711b_ai,
}, { }, {
.name = "acl8112hg", .name = "acl8112hg",
.is_8112 = 1,
.n_aichan = 16, .n_aichan = 16,
.n_aochan = 2, .n_aochan = 2,
.maxirq = 15, .maxirq = 15,
.ai_range_type = &range_acl8112hg_ai, .ai_range_type = &range_acl8112hg_ai,
}, { }, {
.name = "acl8112dg", .name = "acl8112dg",
.is_8112 = 1,
.n_aichan = 16, .n_aichan = 16,
.n_aochan = 2, .n_aochan = 2,
.maxirq = 15, .maxirq = 15,
...@@ -239,9 +236,9 @@ static irqreturn_t pcl711_interrupt(int irq, void *d) ...@@ -239,9 +236,9 @@ static irqreturn_t pcl711_interrupt(int irq, void *d)
} }
static void pcl711_set_changain(struct comedi_device *dev, static void pcl711_set_changain(struct comedi_device *dev,
struct comedi_subdevice *s,
unsigned int chanspec) unsigned int chanspec)
{ {
const struct pcl711_board *board = comedi_board(dev);
unsigned int chan = CR_CHAN(chanspec); unsigned int chan = CR_CHAN(chanspec);
unsigned int range = CR_RANGE(chanspec); unsigned int range = CR_RANGE(chanspec);
unsigned int aref = CR_AREF(chanspec); unsigned int aref = CR_AREF(chanspec);
...@@ -249,7 +246,7 @@ static void pcl711_set_changain(struct comedi_device *dev, ...@@ -249,7 +246,7 @@ static void pcl711_set_changain(struct comedi_device *dev,
outb(range, dev->iobase + PCL711_GAIN); outb(range, dev->iobase + PCL711_GAIN);
if (board->is_8112) { if (s->n_chan > 8) {
/* Select the correct MPC508A chip */ /* Select the correct MPC508A chip */
if (aref == AREF_DIFF) { if (aref == AREF_DIFF) {
chan &= 0x7; chan &= 0x7;
...@@ -286,7 +283,7 @@ static int pcl711_ai_insn_read(struct comedi_device *dev, ...@@ -286,7 +283,7 @@ static int pcl711_ai_insn_read(struct comedi_device *dev,
int ret; int ret;
int i; int i;
pcl711_set_changain(dev, insn->chanspec); pcl711_set_changain(dev, s, insn->chanspec);
pcl711_ai_set_mode(dev, PCL711_MODE_SOFTTRIG); pcl711_ai_set_mode(dev, PCL711_MODE_SOFTTRIG);
...@@ -381,7 +378,7 @@ static int pcl711_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s) ...@@ -381,7 +378,7 @@ static int pcl711_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s)
int timer1, timer2; int timer1, timer2;
struct comedi_cmd *cmd = &s->async->cmd; struct comedi_cmd *cmd = &s->async->cmd;
pcl711_set_changain(dev, cmd->chanlist[0]); pcl711_set_changain(dev, s, cmd->chanlist[0]);
if (cmd->scan_begin_src == TRIG_TIMER) { if (cmd->scan_begin_src == TRIG_TIMER) {
/* /*
...@@ -527,7 +524,7 @@ static int pcl711_attach(struct comedi_device *dev, struct comedi_devconfig *it) ...@@ -527,7 +524,7 @@ static int pcl711_attach(struct comedi_device *dev, struct comedi_devconfig *it)
s = &dev->subdevices[0]; s = &dev->subdevices[0];
s->type = COMEDI_SUBD_AI; s->type = COMEDI_SUBD_AI;
s->subdev_flags = SDF_READABLE | SDF_GROUND; s->subdev_flags = SDF_READABLE | SDF_GROUND;
if (board->is_8112) if (board->n_aichan > 8)
s->subdev_flags |= SDF_DIFF; s->subdev_flags |= SDF_DIFF;
s->n_chan = board->n_aichan; s->n_chan = board->n_aichan;
s->maxdata = 0xfff; s->maxdata = 0xfff;
......
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