aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/staging/iio/adc/mxs-lradc.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/staging/iio/adc/mxs-lradc.c b/drivers/staging/iio/adc/mxs-lradc.c
index 3f7715c9968b..47fc00a3f63b 100644
--- a/drivers/staging/iio/adc/mxs-lradc.c
+++ b/drivers/staging/iio/adc/mxs-lradc.c
@@ -915,11 +915,12 @@ static int mxs_lradc_read_raw(struct iio_dev *iio_dev,
915 case IIO_CHAN_INFO_OFFSET: 915 case IIO_CHAN_INFO_OFFSET:
916 if (chan->type == IIO_TEMP) { 916 if (chan->type == IIO_TEMP) {
917 /* The calculated value from the ADC is in Kelvin, we 917 /* The calculated value from the ADC is in Kelvin, we
918 * want Celsius for hwmon so the offset is 918 * want Celsius for hwmon so the offset is -273.15
919 * -272.15 * scale 919 * The offset is applied before scaling so it is
920 * actually -213.15 * 4 / 1.012 = -1079.644268
920 */ 921 */
921 *val = -1075; 922 *val = -1079;
922 *val2 = 691699; 923 *val2 = 644268;
923 924
924 return IIO_VAL_INT_PLUS_MICRO; 925 return IIO_VAL_INT_PLUS_MICRO;
925 } 926 }