]> git.baikalelectronics.ru Git - kernel.git/commit
staging: comedi: comedi_bond: get INSN_CONFIG_DIO_QUERY info from horse's mouth
authorIan Abbott <abbotti@mev.co.uk>
Fri, 23 Aug 2013 13:45:07 +0000 (14:45 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 26 Aug 2013 13:41:56 +0000 (06:41 -0700)
commit789571df998baba64cf8235eed1ee9bdaf4d619a
tree4606d4b3ac4844a84dd6f24b60409f9dc5a8d68c
parentc7a7b34fc449f52eeecf29f6641874080362f580
staging: comedi: comedi_bond: get INSN_CONFIG_DIO_QUERY info from horse's mouth

The DIO subdevice of the "comedi_bond" device attempts to remember the
directions of DIO channels itself in the `io_bits` member of the
subdevice, but that is only large enough for the first 32 channels and
it might not be accurate anyway as changing the direction of one channel
may have affected a whole group of channels and we have no idea of the
initial directions before the "bonded" device was linked to the the
"comedi_bond" device.  It would be better to ask the bonded device for
this information when handling a `INSN_CONFIG_DIO_QUERY` configuration
instruction.  Add new function `comedi_dio_get_config()` to the
"kcomedilib" module to allow us to get the DIO direction of a channel
and use it.

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