summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH Hartley Sweeten <hsweeten@visionengravers.com>2015-01-07 17:19:30 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-01-09 17:03:55 -0800
commit21f1801fcbb970ed46ad4cd90585cec3b69e23cc (patch)
tree379ed6513d8b5580b87c5063e0a8af6eaa6a76f1
parent9cdb432c6d64e967a03513de258273d01b8b1852 (diff)
staging: comedi: aio_iiro_16: read intial state of the digital outputs
The relay registers are readable. Read them during the attach to get the initial state of the digital outputs. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/staging/comedi/drivers/aio_iiro_16.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/staging/comedi/drivers/aio_iiro_16.c b/drivers/staging/comedi/drivers/aio_iiro_16.c
index 96ea174dd7db..8cd5f116e15b 100644
--- a/drivers/staging/comedi/drivers/aio_iiro_16.c
+++ b/drivers/staging/comedi/drivers/aio_iiro_16.c
@@ -85,6 +85,10 @@ static int aio_iiro_16_attach(struct comedi_device *dev,
s->range_table = &range_digital;
s->insn_bits = aio_iiro_16_do_insn_bits;
+ /* get the initial state of the relays */
+ s->state = inb(dev->iobase + AIO_IIRO_16_RELAY_0_7) |
+ (inb(dev->iobase + AIO_IIRO_16_RELAY_8_15) << 8);
+
/* Digital Input subdevice */
s = &dev->subdevices[1];
s->type = COMEDI_SUBD_DI;