]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/staging/iio/adc/mxs-lradc.c
Merge tag 'iio-for-4.5a' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio...
[karo-tx-linux.git] / drivers / staging / iio / adc / mxs-lradc.c
index 1f25027b7b61f845ca915a32e8195af01c1ed25c..5f1375c465e614390ca6ebacca245122d2d4cf34 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;
                }