};
struct pcmda12_private {
- unsigned int ao_readback[8];
int simultaneous_xfer_mode;
};
{
struct pcmda12_private *devpriv = dev->private;
unsigned int chan = CR_CHAN(insn->chanspec);
- unsigned int val = devpriv->ao_readback[chan];
+ unsigned int val = s->readback[chan];
unsigned long ioreg = dev->iobase + (chan * 2);
int i;
if (!devpriv->simultaneous_xfer_mode)
inb(ioreg);
}
- devpriv->ao_readback[chan] = val;
+ s->readback[chan] = val;
return insn->n;
}
unsigned int *data)
{
struct pcmda12_private *devpriv = dev->private;
- unsigned int chan = CR_CHAN(insn->chanspec);
- int i;
/*
* Initiate simultaneaous xfer mode by reading one of the
if (devpriv->simultaneous_xfer_mode)
inb(dev->iobase);
- for (i = 0; i < insn->n; i++)
- data[i] = devpriv->ao_readback[chan];
-
- return insn->n;
+ return comedi_readback_insn_read(dev, s, insn, data);
}
static void pcmda12_ao_reset(struct comedi_device *dev,
s->insn_write = pcmda12_ao_insn_write;
s->insn_read = pcmda12_ao_insn_read;
+ ret = comedi_alloc_subdev_readback(s);
+ if (ret)
+ return ret;
+
pcmda12_ao_reset(dev, s);
return 0;