staging: comedi: adl_pci6208: split the digital i/o subdevice
authorH Hartley Sweeten <hartleys@visionengravers.com>
Thu, 9 Aug 2012 21:51:26 +0000 (14:51 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 14 Aug 2012 01:31:01 +0000 (18:31 -0700)
commit270809a80fb610b54de5ee792a607dc37a71195c
tree2cc70e65cac5200077b47e0428b63af5c5acedf4
parent0a1e6c1fdbdcdbbf9457bc812e145062d59a68c2
staging: comedi: adl_pci6208: split the digital i/o subdevice

The PCI-6208/6216 cards have 4 digital inputs and 4 digital outputs.
These are currently being handled by an 8 channel COMEDI_SUBD_DIO
subdevice in this driver. This causes the 4 digital outputs to
appear as channels 0 thru 3 and the 4 digital inputs to appear as
channels 4 thru 7. Userspace can only work out part thisby doing the
COMEDI_INSNLIST ioctl with the INSN_CONFIG_DIO_QUERY instruction
for each channel to determine the io direction.

Make things a bit cleaner for userspace by creating two subdevices
instead. One for the 4 digital inputs and one for the 4 digital
outputs. For both subdevices the channel number indicates the
actual digital input/output signal.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/comedi/drivers/adl_pci6208.c