*/
struct cb_pcimdas_private {
/* base addresses */
+ unsigned long daqio;
unsigned long BADR3;
/* Used for AO readback */
/* convert n samples */
for (n = 0; n < insn->n; n++) {
/* trigger conversion */
- outw(0, dev->iobase + 0);
+ outw(0, devpriv->daqio + 0);
/* wait for conversion to end */
ret = comedi_timeout(dev, s, insn, cb_pcimdas_ai_eoc, 0);
return ret;
/* read data */
- data[n] = inw(dev->iobase + 0);
+ data[n] = inw(devpriv->daqio + 0);
}
/* return the number of samples read/written */
for (i = 0; i < insn->n; i++) {
switch (chan) {
case 0:
- outw(data[i] & 0x0FFF, dev->iobase + DAC0_OFFSET);
+ outw(data[i] & 0x0FFF, devpriv->daqio + DAC0_OFFSET);
break;
case 1:
- outw(data[i] & 0x0FFF, dev->iobase + DAC1_OFFSET);
+ outw(data[i] & 0x0FFF, devpriv->daqio + DAC1_OFFSET);
break;
default:
return -1;
struct pci_dev *pcidev = comedi_to_pci_dev(dev);
struct cb_pcimdas_private *devpriv;
struct comedi_subdevice *s;
- unsigned long iobase_8255;
int ret;
devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv));
if (ret)
return ret;
- dev->iobase = pci_resource_start(pcidev, 2);
+ devpriv->daqio = pci_resource_start(pcidev, 2);
devpriv->BADR3 = pci_resource_start(pcidev, 3);
- iobase_8255 = pci_resource_start(pcidev, 4);
+ dev->iobase = pci_resource_start(pcidev, 4);
ret = comedi_alloc_subdevices(dev, 3);
if (ret)
s = &dev->subdevices[2];
/* digital i/o subdevice */
- ret = subdev_8255_init(dev, s, NULL, iobase_8255);
+ ret = subdev_8255_init(dev, s, NULL, dev->iobase);
if (ret)
return ret;