c6xdigio_write_data(dev, 0x00, 0x80);
- return val ^ 0x800000;
+ return val;
}
static int c6xdigio_pwm_insn_write(struct comedi_device *dev,
unsigned int *data)
{
unsigned int chan = CR_CHAN(insn->chanspec);
- int n;
+ unsigned int val;
+ int i;
- for (n = 0; n < insn->n; n++)
- data[n] = (c6xdigio_encoder_read(dev, chan) & 0xffffff);
+ for (i = 0; i < insn->n; i++) {
+ val = c6xdigio_encoder_read(dev, chan);
+
+ /* munge two's complement value to offset binary */
+ data[i] = comedi_offset_munge(s, val);
+ }
- return n;
+ return insn->n;
}
static void c6xdigio_init(struct comedi_device *dev)