summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH Hartley Sweeten <hsweeten@visionengravers.com>2015-01-07 17:19:31 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-01-09 17:03:55 -0800
commitffe1cb9a3ed83c753183015b31dfb6fc148403f7 (patch)
treee3d73b27d3d248bcfc1ff7467ab6459cf65a5896
parent21f1801fcbb970ed46ad4cd90585cec3b69e23cc (diff)
staging: comedi: aio_iiro_16: introduce aio_iiro_enable_irq()
This board supports interrupts on change of state of the digital inputs. Introduce a helper function to enable/disable the interrupt. Use the new helper function to ensure that interrupts are initially disabled during the driver (*attach). 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.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/staging/comedi/drivers/aio_iiro_16.c b/drivers/staging/comedi/drivers/aio_iiro_16.c
index 8cd5f116e15b..f84fb7446994 100644
--- a/drivers/staging/comedi/drivers/aio_iiro_16.c
+++ b/drivers/staging/comedi/drivers/aio_iiro_16.c
@@ -34,6 +34,14 @@
#define AIO_IIRO_16_RELAY_8_15 0x04
#define AIO_IIRO_16_INPUT_8_15 0x05
+static void aio_iiro_enable_irq(struct comedi_device *dev, bool enable)
+{
+ if (enable)
+ inb(dev->iobase + AIO_IIRO_16_IRQ);
+ else
+ outb(0, dev->iobase + AIO_IIRO_16_IRQ);
+}
+
static int aio_iiro_16_do_insn_bits(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_insn *insn,
@@ -72,6 +80,8 @@ static int aio_iiro_16_attach(struct comedi_device *dev,
if (ret)
return ret;
+ aio_iiro_enable_irq(dev, false);
+
ret = comedi_alloc_subdevices(dev, 2);
if (ret)
return ret;