#define PCL711_DO_LO 13
#define PCL711_DO_HI 14
-static comedi_lrange range_pcl711b_ai = { 5, {
+static const comedi_lrange range_pcl711b_ai = { 5, {
BIP_RANGE( 5 ),
BIP_RANGE( 2.5 ),
BIP_RANGE( 1.25 ),
BIP_RANGE( 0.625 ),
BIP_RANGE( 0.3125 )
}};
-static comedi_lrange range_acl8112hg_ai = { 12, {
+static const comedi_lrange range_acl8112hg_ai = { 12, {
BIP_RANGE( 5 ),
BIP_RANGE( 0.5 ),
BIP_RANGE( 0.05 ),
BIP_RANGE( 0.1 ),
BIP_RANGE( 0.01 )
}};
-static comedi_lrange range_acl8112dg_ai = { 9, {
+static const comedi_lrange range_acl8112dg_ai = { 9, {
BIP_RANGE( 5 ),
BIP_RANGE( 2.5 ),
BIP_RANGE( 1.25 ),
BIP_RANGE( 10 )
}};
-typedef int bool;
-
/*
* flags
*/
#define PCL711_TIMEOUT 100
#define PCL711_DRDY 0x10
-static int i8253_osc_base = 500; /* 2 Mhz */
+static const int i8253_osc_base = 500; /* 2 Mhz */
typedef struct {
- char *name;
+ const char *name;
int is_pcl711b;
int is_8112;
int is_dg;
int n_aichan;
int n_aochan;
int maxirq;
- comedi_lrange * ai_range_type;
+ const comedi_lrange * ai_range_type;
} boardtype;
-static boardtype boardtypes[] =
+static const boardtype boardtypes[] =
{
{"pcl711", 0, 0, 0, 5, 8, 1, 0, &range_bipolar5},
{"pcl711b", 1, 0, 0, 5, 8, 1, 7, &range_pcl711b_ai},
{"acl8112dg", 0, 1, 1, 9, 16, 2, 15, &range_acl8112dg_ai},
};
#define n_boardtypes (sizeof(boardtypes)/sizeof(boardtype))
-#define this_board ((boardtype *)dev->board_ptr)
+#define this_board ((const boardtype *)dev->board_ptr)
static int pcl711_attach(comedi_device *dev,comedi_devconfig *it);
static int pcl711_detach(comedi_device *dev);
module: THIS_MODULE,
attach: pcl711_attach,
detach: pcl711_detach,
- board_name: boardtypes,
+ board_name: &boardtypes[0].name,
num_names: n_boardtypes,
offset: sizeof(boardtype),
};
#define devpriv ((pcl711_private *)dev->private)
-static irqreturn_t pcl711_interrupt(int irq, void *d, struct pt_regs *regs)
+static irqreturn_t pcl711_interrupt(int irq, void *d PT_REGS_ARG)
{
int lo, hi;
int data;
int chan_register;
outb(CR_RANGE(chan), dev->iobase + PCL711_GAIN);
-
+
chan_register=CR_CHAN(chan);
if (this_board->is_8112) {
}
rt_printk("comedi%d: pcl711: A/D timeout\n", dev->minor);
return -ETIME;
-
+
ok:
lo = inb(dev->iobase + PCL711_AD_LO);
s = dev->subdevices + 0;
/* AI subdevice */
s->type = COMEDI_SUBD_AI;
- s->subdev_flags = SDF_READABLE|SDF_GROUND;
+ s->subdev_flags = SDF_READABLE | SDF_GROUND;
s->n_chan = this_board->n_aichan;
s->maxdata = 0xfff;
s->len_chanlist = 1;
s->range_table = this_board->ai_range_type;
s->insn_read = pcl711_ai_insn;
if(irq){
+ dev->read_subdev = s;
+ s->subdev_flags |= SDF_CMD_READ;
s->do_cmdtest = pcl711_ai_cmdtest;
s->do_cmd = pcl711_ai_cmd;
}