staging: comedi: adv_pci_dio: Support falling edge triggers
authorIan Abbott <abbotti@mev.co.uk>
Mon, 18 Jan 2021 14:43:59 +0000 (14:43 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 26 Jan 2021 17:48:11 +0000 (18:48 +0100)
commitb4783da2c18599bc6688f5027709712a9a1a5256
tree75c3aa8d26f2943d0879bd291b9ec9520283a030
parent2e0e629d0f62541d0f82f6e3f7a64aab8fb3e989
staging: comedi: adv_pci_dio: Support falling edge triggers

The interrupt support for Advantech PCI-1730 currrently supports only
rising edge inputs for the trigger sources.  Each of four interrupt
sources (each with its own Comedi subdevice) can be set to trigger on
either a rising edge or a falling edge.  Add support for choosing the
edge during set-up of the asynchronous command for the subdevice, using
the `CR_INVERT` bit of `scan_begin_arg` to indicate falling edge when
set, or rising edge when clear.  Also allow the `CR_EDGE` bit to be set,
but ignore it.  All other bits of `scan_begin_arg` must be zero.

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