staging: comedi: hwdrv_apci1500: introduce z8536_read()
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Wed, 3 Dec 2014 18:25:32 +0000 (11:25 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 10 Jan 2015 00:54:34 +0000 (16:54 -0800)
commit54c3ef46572015e05537526304b0d22095821a7f
tree17b34de7a2f31f783abef560a9cbdea8863050b3
parentb7392d2247cfe6771f95d256374f1a8e6a6f48d6
staging: comedi: hwdrv_apci1500: introduce z8536_read()

The Z8536 CIO registers are indirectly read by writing the register offset to
the control register then reading the control register to get the value.

Introduce a helper function to read the Z8536 CIO registers.

The registers are read from "normal" code and in the interrupt handler,
spinlock the sequence to protect the indirect register access.

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/addi-data/hwdrv_apci1500.c