]> git.karo-electronics.de Git - karo-tx-linux.git/commit
staging: comedi: addi_apci_3501: fix digital output 'insn_bits' function
authorH Hartley Sweeten <hartleys@visionengravers.com>
Tue, 6 Nov 2012 16:59:32 +0000 (09:59 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 13 Nov 2012 19:21:36 +0000 (11:21 -0800)
commit141dcc33c037b7e520ba305caaafbbb39db9e962
tree22565391d80d73eb1155442372badb2d027529f7
parent272b6b04e7fcc3b045050ffc595a4655425b0c24
staging: comedi: addi_apci_3501: fix digital output 'insn_bits' function

This driver does not follow the comedi API. The digital output 'insn_bits'
function is passed a mask value in data[0] indicating which output bits in
data[1] are changing. The function is then supposed to update the outputs
accordingly and then return the current state of the outputs in data[1].

Currently this driver uses the 'insn_write' function to update either a
single output channel or all the channels and the 'insn_bits' function to
read the state of either a single channel or all the channels.

Fix the 'insn_bits' function so it works like the comedi core expects. The
core can then use the function to emulate the 'insn_read' and 'insn_write'
functions for individual channels.

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/addi-data/hwdrv_apci3501.c
drivers/staging/comedi/drivers/addi_apci_3501.c