staging: comedi: ni_65xx: refactor edge detection configuration
authorIan Abbott <abbotti@mev.co.uk>
Wed, 23 Jul 2014 09:41:19 +0000 (10:41 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 24 Jul 2014 22:01:24 +0000 (15:01 -0700)
commita5e7d93da17715aacbad64951a49aadb06071a4d
tree0a9af51926b0a38c6fbfe7aa62940fbc7230994a
parentde35c94178d6315f6def773a2137bc82a840f3d8
staging: comedi: ni_65xx: refactor edge detection configuration

Refactor the code that updates the rising and falling edge detection
registers into new function `ni_65xx_update_edge_detection()`.  This
updates the rising and falling edge detection registers for up to 32
channels starting at an arbitrary channel.  Call it from the code that
handles the `INSN_CONFIG_CHANGE_NOTIFY` instruction, which is limited to
the first 32 channels.

(For the purposes of edge detection, the channels are in the natural
port order of the board, 8 channels per port.  In practice, this is all
the digital I/O channels (if any), followed by all the digital input
channels (if any), followed by all the digital output channels (if any).

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/comedi/drivers/ni_65xx.c