int adchan;
int ai_speed;
const struct comedi_lrange *adrange;
- int dachan;
- int dabits;
unsigned int ai_is_16bit:1;
+ unsigned int has_ao:1;
};
static const struct dt3k_boardtype dt3k_boardtypes[] = {
.adchan = 16,
.adrange = &range_dt3000_ai,
.ai_speed = 3000,
- .dachan = 2,
- .dabits = 12,
+ .has_ao = 1,
},
[BOARD_DT3001_PGL] = {
.name = "dt3001-pgl",
.adchan = 16,
.adrange = &range_dt3000_ai_pgl,
.ai_speed = 3000,
- .dachan = 2,
- .dabits = 12,
+ .has_ao = 1,
},
[BOARD_DT3002] = {
.name = "dt3002",
.adchan = 64,
.adrange = &range_dt3000_ai,
.ai_speed = 3000,
- .dachan = 2,
- .dabits = 12,
+ .has_ao = 1,
},
[BOARD_DT3003_PGL] = {
.name = "dt3003-pgl",
.adchan = 64,
.adrange = &range_dt3000_ai_pgl,
.ai_speed = 3000,
- .dachan = 2,
- .dabits = 12,
+ .has_ao = 1,
},
[BOARD_DT3004] = {
.name = "dt3004",
.adchan = 16,
.adrange = &range_dt3000_ai,
.ai_speed = 10000,
- .dachan = 2,
- .dabits = 12,
.ai_is_16bit = 1,
+ .has_ao = 1,
},
[BOARD_DT3005] = {
.name = "dt3005", /* a.k.a. 3004-200 */
.adchan = 16,
.adrange = &range_dt3000_ai,
.ai_speed = 5000,
- .dachan = 2,
- .dabits = 12,
.ai_is_16bit = 1,
+ .has_ao = 1,
},
};
s->cancel = dt3k_ai_cancel;
}
+ /* Analog Output subdevice */
s = &dev->subdevices[1];
- /* ao subsystem */
- s->type = COMEDI_SUBD_AO;
- s->subdev_flags = SDF_WRITABLE;
- s->n_chan = 2;
- s->maxdata = (1 << board->dabits) - 1;
- s->len_chanlist = 1;
- s->range_table = &range_bipolar10;
- s->insn_write = dt3k_ao_insn_write;
-
- ret = comedi_alloc_subdev_readback(s);
- if (ret)
- return ret;
+ if (board->has_ao) {
+ s->type = COMEDI_SUBD_AO;
+ s->subdev_flags = SDF_WRITABLE;
+ s->n_chan = 2;
+ s->maxdata = 0x0fff;
+ s->range_table = &range_bipolar10;
+ s->insn_write = dt3k_ao_insn_write;
+
+ ret = comedi_alloc_subdev_readback(s);
+ if (ret)
+ return ret;
+
+ } else {
+ s->type = COMEDI_SUBD_UNUSED;
+ }
s = &dev->subdevices[2];
/* dio subsystem */