Merge 4.3-rc7 into staging-next
[firefly-linux-kernel-4.4.55.git] / drivers / staging / iio / adc / mxs-lradc.c
index 407d4a2c8eda0887af8e5c949d98657c69357747..d997d9c74ca824740a825cc5399c12be5d491875 100644 (file)
@@ -930,11 +930,12 @@ static int mxs_lradc_read_raw(struct iio_dev *iio_dev,
        case IIO_CHAN_INFO_OFFSET:
                if (chan->type == IIO_TEMP) {
                        /* The calculated value from the ADC is in Kelvin, we
-                        * want Celsius for hwmon so the offset is
-                        * -272.15 * scale
+                        * want Celsius for hwmon so the offset is -273.15
+                        * The offset is applied before scaling so it is
+                        * actually -213.15 * 4 / 1.012 = -1079.644268
                         */
-                       *val = -1075;
-                       *val2 = 691699;
+                       *val = -1079;
+                       *val2 = 644268;
 
                        return IIO_VAL_INT_PLUS_MICRO;
                }