staging: comedi: adv_pci_dio: Add interrupt handling for PCI-1730
authorBernd Harries <bha@gmx.de>
Mon, 18 Jan 2021 14:43:58 +0000 (14:43 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 26 Jan 2021 17:48:10 +0000 (18:48 +0100)
commit2e0e629d0f62541d0f82f6e3f7a64aab8fb3e989
tree063c144010de54b8627f19d2b96892bbebaf2ec0
parent115dbad485a72205c4b122fe43d8274c5ef68153
staging: comedi: adv_pci_dio: Add interrupt handling for PCI-1730

On the Advantech PCI-1730, four digital inputs (DI0, DI1, IDI0 and IDI1)
can be used as external interrupt sources.  Each input can be programmed
to latch an interrupt bit on either a rising edge or a falling edge (but
not both).

Add a new Comedi subdevice for each interrupt source, supporting the
asynchronous command interface.  Subdevices 5, 6, 7 and 8 are for
interrupt sources DI0, DI1, IDI0 and IDI1.  They each write the state of
16 digital inputs to the subdevice's data buffer each time the
corresponding interrupt occurs.  (For DI0 and DI1, use the 16
non-isolated digital inputs.  For IDI0 and IDI1, use the 16 isolated
digital inputs.)

Currently, only rising edge triggers are supported.  Support could be
added for the PCI-1733 and PCI-1736.

Signed-off-by: Bernd Harries <bha@gmx.de>
Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Link: https://lore.kernel.org/r/20210118144359.378730-2-abbotti@mev.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/comedi/drivers/adv_pci_dio.c