From: H Hartley Sweeten Date: Wed, 12 Jun 2013 23:15:27 +0000 (-0700) Subject: staging: comedi: addi_apci_3xxx: refactor the ttl digital i/o support X-Git-Tag: omap-for-v3.11/fixes-for-merge-window~76^2~130 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=da6578abd7c7535e59cae5eb0c54f5cd13902a6d;p=pandora-kernel.git staging: comedi: addi_apci_3xxx: refactor the ttl digital i/o support Currently, the subdevice functions used to configure and read/write the ttl digital i/o ports is way over to complicated. The (*insn_config) function also abuses the comedi API by overriding the instruction command passed in data[0]. Fix the ttl digital i/o support to work like the comedi core expects. The (*insn_config) function supports the three instructions common for COMEDI_SUBD_DIO subdevices: INSN_CONFIG_DIO_INPUT - configure the specified channel as input INSN_CONFIG_DIO_OUTPUT - configure the specified channel as output INSN_CONFIG_DIO_QUERY - returns the status of the specified channel Port 0 (channels 0-7) is always input Port 1 (channels 8-15) is always output Port 2 (channels 9-23) are programmable i/o (all channels are input or output) The (*insn_bits) function allows writing to the output channels and returns the state of all channels. The (*insn_read) and (*insn_write) functions are not required. The comedi core will emulate them using the (*insn_bits) function. Signed-off-by: H Hartley Sweeten Reviewed-by: Ian Abbott Signed-off-by: Greg Kroah-Hartman --- Reading git-diff-tree failed