aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorH Hartley Sweeten <hsweeten@visionengravers.com>2015-09-24 17:52:08 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-09-29 03:32:22 +0200
commit8e0768b184f361a30c640b7571d602f408744c13 (patch)
treeb4aed0f3d92fb59f2bab84217c3fb0e5894479cf /scripts
parentstaging: comedi: rtd520: convert DAC register defines to macros (diff)
staging: comedi: rtd520: fix rtd_ao_winsn()
The "comedi range and offset conversions" in this function is incorrect. According to the hardware manual, the DAC registers are defined as: | D15 | D14-D03 | D02 | | D01 | D00 | | Sign | 12-bit data | (see manual) | The extended 'Sign' bit is only used for bipolar ranges to indicate negative 12-bit data values. The current code actually flips the sign for all bipolar data values instead of just munging the value to 2's complement and extending the sign bit. Fix the function to correctly munge the comedi offset binary values into 2's complement and extended the sign when bipolar ranges are specified. For aesthetics, rename this function and tidy it up a bit. Save the readback value after the conversion is complete. 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>
Diffstat (limited to 'scripts')
0 files changed, 0 insertions, 0 deletions