staging: comedi: adl_pci6208: save raw data for analog output readback
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Wed, 18 Sep 2013 18:47:26 +0000 (11:47 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 25 Sep 2013 22:45:42 +0000 (15:45 -0700)
commit20fb170b293218ef66ce885df3a77903e3d11572
tree7904cba4b8933194881bde208c4a218b789f01b6
parente2aad1d5716c5f7fa5deb4a96e6b6a4e9f24e78b
staging: comedi: adl_pci6208: save raw data for analog output readback

This driver munges the raw data from the comedi core into its two's
complement form before writing it to the hardware. The last value
written to the hardware is saved in the private data for readback.

Since the comedi core always expects the data to be in offset binary
coding, make sure to save the un-munged value for readback.

Also, prefetch the current readback value before attempting to update
the hardware. This ensures that the readback value is correct if no
values are actually written.

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/adl_pci6208.c