staging: comedi: c6xdigio: introduce c6xdigio_get_encoder_bits()
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Mon, 10 Mar 2014 21:07:33 +0000 (14:07 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 17 Mar 2014 21:03:59 +0000 (14:03 -0700)
commitbea8052074691c70526ae6a555d25f111c0aad0a
tree7f76d2c9b8ed0398439288b6b13c9695122e52ed
parent721869e85594de3e94e4be900c734b02f6c3ecad
staging: comedi: c6xdigio: introduce c6xdigio_get_encoder_bits()

The 24-bit encoder value is read using 3-bits in the status register. The
data register is banged between each read of the status register to advance
the bits.

Introduce a helper function to handle this and remove the union encvaluetype
and struct encbitsbyte.

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