]> rtime.felk.cvut.cz Git - mf6xx.git/blobdiff - src/comedi/mf614_simple_driver/kernel/mf614.c
Minor changes in example drivers.
[mf6xx.git] / src / comedi / mf614_simple_driver / kernel / mf614.c
index 4af0b97cc7f8c1b0fae3fea8f8c40ec1124e730e..79b546a543d846bdadf22abe17c9350b0df8995a 100644 (file)
@@ -268,9 +268,11 @@ static int mf614_do_insn_bits(struct comedi_device *dev,
                return -EINVAL;
        }
 
+       /* The insn data is a mask in data[0] and the new data
+       * in data[1], each channel cooresponding to a bit. */
        if(data[0]) {
-               s->state &= ~data[0];
-               s->state |= data[0] & data[1];
+               s->state &= ~data[0]; // Get old value
+               s->state |= data[0] & data[1]; // Write new value to it
 
                iowrite8(s->state, devpriv->BAR0_io + DOUT_reg);
        }