staging: comedi: addi_apci_2200: fix digital output 'insn_bits' function
authorH Hartley Sweeten <hartleys@visionengravers.com>
Tue, 6 Nov 2012 17:07:04 +0000 (10:07 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 13 Nov 2012 19:21:38 +0000 (11:21 -0800)
commit8ded30de45e1ea5979396eaa8241e7ee1e57ff3e
treebf6d556826faa4435ec62337e0cf796258ede970
parentbf83f6d85ef94bbecdc3453a0302ac46693aa917
staging: comedi: addi_apci_2200: 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 or all the output channels. And it uses the 'insn_bits' function
to read either a single or all the output channel states.

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_apci2200.c
drivers/staging/comedi/drivers/addi_apci_2200.c