- /*
- * The insn data is a mask in data[0] and the new data
- * in data[1], each channel cooresponding to a bit.
- */
- for (i = 0; num_done < nchans && i < devpriv->ndevs; ++i) {
- struct bonded_device *bdev = devpriv->devs[i];
- /*
- * Grab the channel mask and data of only the bits corresponding
- * to this subdevice.. need to shift them to zero position of
- * course.
- */
- /* Bits corresponding to this subdev. */
- unsigned int subdev_mask = ((1 << bdev->nchans) - 1);
- unsigned int write_mask, data_bits;
-
- /* Argh, we have >= LSAMPL_BITS chans.. take all bits */
- if (bdev->nchans >= LSAMPL_BITS)
- subdev_mask = (unsigned int)(-1);
-
- write_mask = (data[0] >> num_done) & subdev_mask;
- data_bits = (data[1] >> num_done) & subdev_mask;
-
- /* Read/Write the new digital lines */
- if (comedi_dio_bitfield(bdev->dev, bdev->subdev, write_mask,
- &data_bits) != 2)
- return -EINVAL;