Skip to content

Commit 431386e

Browse files
mitajic23
authored andcommitted
iio: pressure: mpl115: fix temperature offset sign
According to the datasheet, the resolusion of temperature sensor is -5.35 counts/C. Temperature ADC is 472 counts at 25C. (https://www.sparkfun.com/datasheets/Sensors/Pressure/MPL115A1.pdf NOTE: This is older revision, but this information is removed from the latest datasheet from nxp somehow) Temp [C] = (Tadc - 472) / -5.35 + 25 = (Tadc - 605.750000) * -0.186915888 So the correct offset is -605.750000. Signed-off-by: Akinobu Mita <[email protected]> Acked-by: Peter Meerwald-Stadler <[email protected]> Cc: <[email protected]> Signed-off-by: Jonathan Cameron <[email protected]>
1 parent d81dac3 commit 431386e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/iio/pressure/mpl115.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ static int mpl115_read_raw(struct iio_dev *indio_dev,
117117
*val = ret >> 6;
118118
return IIO_VAL_INT;
119119
case IIO_CHAN_INFO_OFFSET:
120-
*val = 605;
120+
*val = -605;
121121
*val2 = 750000;
122122
return IIO_VAL_INT_PLUS_MICRO;
123123
case IIO_CHAN_INFO_SCALE:

0 commit comments

Comments
 (0)