iio: adc: spmi-vadc: Fix overflow in output value normalization
authorIvan T. Ivanov <ivan.ivanov@linaro.org>
Fri, 17 Apr 2015 14:51:08 +0000 (17:51 +0300)
committerJonathan Cameron <jic23@kernel.org>
Sat, 18 Apr 2015 16:40:04 +0000 (17:40 +0100)
commit937125aca00e0478c4024afe58bc620a7bbe2a93
tree7ceaa11e4a3e80d4e773b9a4a4cdf3cafc5000a9
parentd0716b0ea4ce11a13477163c14b26e180922ba51
iio: adc: spmi-vadc: Fix overflow in output value normalization

With 'dx' equal to 0.625V and 15 bit ADC, calculations overflow
when difference against GND is ~20% of the ADC range. Fix this.

Signed-off-by: Ivan T. Ivanov <ivan.ivanov@linaro.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
drivers/iio/adc/qcom-spmi-vadc.c