struct pcl711_board {
const char *name;
unsigned int is_pcl711b:1;
- unsigned int is_8112:1;
int n_aichan;
int n_aochan;
int maxirq;
.ai_range_type = &range_pcl711b_ai,
}, {
.name = "acl8112hg",
- .is_8112 = 1,
.n_aichan = 16,
.n_aochan = 2,
.maxirq = 15,
.ai_range_type = &range_acl8112hg_ai,
}, {
.name = "acl8112dg",
- .is_8112 = 1,
.n_aichan = 16,
.n_aochan = 2,
.maxirq = 15,
}
static void pcl711_set_changain(struct comedi_device *dev,
+ struct comedi_subdevice *s,
unsigned int chanspec)
{
- const struct pcl711_board *board = comedi_board(dev);
unsigned int chan = CR_CHAN(chanspec);
unsigned int range = CR_RANGE(chanspec);
unsigned int aref = CR_AREF(chanspec);
outb(range, dev->iobase + PCL711_GAIN);
- if (board->is_8112) {
+ if (s->n_chan > 8) {
/* Select the correct MPC508A chip */
if (aref == AREF_DIFF) {
chan &= 0x7;
int ret;
int i;
- pcl711_set_changain(dev, insn->chanspec);
+ pcl711_set_changain(dev, s, insn->chanspec);
pcl711_ai_set_mode(dev, PCL711_MODE_SOFTTRIG);
int timer1, timer2;
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) {
/*
s = &dev->subdevices[0];
s->type = COMEDI_SUBD_AI;
s->subdev_flags = SDF_READABLE | SDF_GROUND;
- if (board->is_8112)
+ if (board->n_aichan > 8)
s->subdev_flags |= SDF_DIFF;
s->n_chan = board->n_aichan;
s->maxdata = 0xfff;