const char *name;
enum vmk80xx_model model;
const struct comedi_lrange *range;
- __u8 ai_chans;
- __le16 ai_bits;
+ int ai_nchans;
+ unsigned int ai_maxdata;
__u8 ao_chans;
__u8 di_chans;
__le16 cnt_bits;
.name = "K8055 (VM110)",
.model = VMK8055_MODEL,
.range = &vmk8055_range,
- .ai_chans = 2,
- .ai_bits = 8,
+ .ai_nchans = 2,
+ .ai_maxdata = 0x00ff,
.ao_chans = 2,
.di_chans = 6,
.cnt_bits = 16,
.name = "K8061 (VM140)",
.model = VMK8061_MODEL,
.range = &vmk8061_range,
- .ai_chans = 8,
- .ai_bits = 10,
+ .ai_nchans = 8,
+ .ai_maxdata = 0x03ff,
.ao_chans = 8,
.di_chans = 8,
.cnt_bits = 0,
return 0;
}
-static int vmk80xx_ai_rinsn(struct comedi_device *dev,
- struct comedi_subdevice *s,
- struct comedi_insn *insn, unsigned int *data)
+static int vmk80xx_ai_insn_read(struct comedi_device *dev,
+ struct comedi_subdevice *s,
+ struct comedi_insn *insn,
+ unsigned int *data)
{
struct vmk80xx_private *devpriv = dev->private;
int chan;
/* Analog input subdevice */
s = &dev->subdevices[0];
- s->type = COMEDI_SUBD_AI;
- s->subdev_flags = SDF_READABLE | SDF_GROUND;
- s->n_chan = boardinfo->ai_chans;
- s->maxdata = (1 << boardinfo->ai_bits) - 1;
- s->range_table = boardinfo->range;
- s->insn_read = vmk80xx_ai_rinsn;
+ s->type = COMEDI_SUBD_AI;
+ s->subdev_flags = SDF_READABLE | SDF_GROUND;
+ s->n_chan = boardinfo->ai_nchans;
+ s->maxdata = boardinfo->ai_maxdata;
+ s->range_table = boardinfo->range;
+ s->insn_read = vmk80xx_ai_insn_read;
/* Analog output subdevice */
s = &dev->subdevices[1];