]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commit
staging: comedi: pcmuio: fix pcmuio_dio_insn_bits()
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Thu, 5 Dec 2013 23:54:08 +0000 (16:54 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 6 Dec 2013 21:10:02 +0000 (13:10 -0800)
commitbeecd01b720f3d907a5eacfc142090cf06326836
treef59cec27107475e14009c678e4f599a7faa5e756
parent063b590413b5d132d542358e7975fe4955bfeb96
staging: comedi: pcmuio: fix pcmuio_dio_insn_bits()

This dio subdevice (*insn_bits) function does not follow the "norm"
for comedi drivers. It also _appears_ to return the incorrect state
of the channels.

Use the comedi_dio_update_state() helper to handle the boilerplate
for updating the output channel state. Due to the hardware we then
need to invert the state and mask the input channels before updating
the outputs.

Then read the hardware and invert the result to get the current true
state of the dio 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/pcmuio.c