spinlock_t spinlock;
} intr;
} dio;
- struct {
- /* the last unsigned int data written */
- unsigned int shadow_samples[8];
- } ao;
};
};
spinlock_t spinlock;
} asics[MAX_ASICS];
struct pcmmio_subdev_private *sprivs;
+ unsigned int ao_readback[8];
};
#define subpriv ((struct pcmmio_subdev_private *)s->private)
static int ao_rinsn(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data)
{
+ struct pcmmio_private *devpriv = dev->private;
int n;
+
for (n = 0; n < insn->n; n++) {
unsigned chan = CR_CHAN(insn->chanspec);
if (chan < s->n_chan)
- data[n] = subpriv->ao.shadow_samples[chan];
+ data[n] = devpriv->ao_readback[chan];
}
return n;
}
static int ao_winsn(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data)
{
+ struct pcmmio_private *devpriv = dev->private;
int n;
unsigned iobase = subpriv->iobase, iooffset = 0;
wait_dac_ready(iobase + iooffset);
/* save to shadow register for ao_rinsn */
- subpriv->ao.shadow_samples[chan] = data[n];
+ devpriv->ao_readback[chan] = data[n];
}
}
return n;