Skip to contentSkip to conversation

patch "iio: pressure: mpl115: fix temperature offset sign" added to staging-linus

PATCH [email protected] 1 participant 1 message Feb 1, 2016

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

iio: pressure: mpl115: fix temperature offset sign

to my staging git tree which can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git
in the staging-linus branch.

The patch will show up in the next release of the linux-next tree (usually sometime within the next 24 hours during the week.)

The patch will hopefully also be merged in Linus's tree for the next -rc kernel release.

If you have any questions about this process, please let me know.

Quoted 1 line

From 431386e783a3a6c8b7707bee32d18c353b8688b2 Mon Sep 17 00:00:00 2001

From: Akinobu Mita <[email protected]>
Date: Thu, 21 Jan 2016 01:07:31 +0900
Subject: 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.

---
 drivers/iio/pressure/mpl115.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/pressure/mpl115.c +1 -1
index f5ecd6e19f5d..a0d7deeac62f 100644
@@ -117,7 +117,7 @@ static int mpl115_read_raw(struct iio_dev *indio_dev,
 		*val = ret >> 6;
 		return IIO_VAL_INT;
 	case IIO_CHAN_INFO_OFFSET:
-		*val = 605;
+		*val = -605;
 		*val2 = 750000;
 		return IIO_VAL_INT_PLUS_MICRO;
 	case IIO_CHAN_INFO_SCALE:
Signature · 1 line
2.7.0