[PATCH 07/13] staging: comedi: pcmuio: make sure input channels stay inputs
H Hartley Sweeten
hsweeten at visionengravers.com
Wed Jul 24 18:48:01 UTC 2013
When updating the output channels make sure the channels configured as
inputs stay inputs.
Signed-off-by: H Hartley Sweeten <hsweeten at visionengravers.com>
Cc: Ian Abbott <abbotti at mev.co.uk>
Cc: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
---
drivers/staging/comedi/drivers/pcmuio.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/drivers/staging/comedi/drivers/pcmuio.c b/drivers/staging/comedi/drivers/pcmuio.c
index 076a08a..5b0ade2 100644
--- a/drivers/staging/comedi/drivers/pcmuio.c
+++ b/drivers/staging/comedi/drivers/pcmuio.c
@@ -215,8 +215,14 @@ static int pcmuio_dio_insn_bits(struct comedi_device *dev,
s->state &= ~mask;
s->state |= (mask & bits);
- /* invert the state and update the channels */
+ /*
+ * Invert the state and update the channels.
+ *
+ * The s->io_bits mask makes sure inputs are '0' so
+ * that the output pins stay in a high-z state.
+ */
val = s->state ^ ((0x1 << s->n_chan) - 1);
+ val &= s->io_bits;
pcmuio_write(dev, val, asic, 0, port);
}
--
1.8.3.2
More information about the devel
mailing list