]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit25669e39bc66d660ecf234b4ca661d973d33e27d
tree063c144010de54b8627f19d2b96892bbebaf2ec0
parentbf0b7da0c9a0fe88255a64bc9051326d0654f418
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