[3.16.y-ckt stable] Patch "iio: pressure: mpl115: fix temperature offset sign" has been added to the 3.16.y-ckt tree
Luis Henriques
luis.henriques at canonical.com
Thu Feb 25 18:33:03 UTC 2016
This is a note to let you know that I have just added a patch titled
iio: pressure: mpl115: fix temperature offset sign
to the linux-3.16.y-queue branch of the 3.16.y-ckt extended stable tree
which can be found at:
http://kernel.ubuntu.com/git/ubuntu/linux.git/log/?h=linux-3.16.y-queue
This patch is scheduled to be released in version 3.16.7-ckt25.
If you, or anyone else, feels it should not be added to this tree, please
reply to this email.
For more information about the 3.16.y-ckt tree, see
https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable
Thanks.
-Luis
---8<------------------------------------------------------------
>From f1da7f504ca80e6e5fcbccf1585037ffe83babb1 Mon Sep 17 00:00:00 2001
From: Akinobu Mita <akinobu.mita at gmail.com>
Date: Thu, 21 Jan 2016 01:07:31 +0900
Subject: iio: pressure: mpl115: fix temperature offset sign
commit 431386e783a3a6c8b7707bee32d18c353b8688b2 upstream.
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 <akinobu.mita at gmail.com>
Acked-by: Peter Meerwald-Stadler <pmeerw at pmeerw.net>
Signed-off-by: Jonathan Cameron <jic23 at kernel.org>
Signed-off-by: Luis Henriques <luis.henriques at canonical.com>
---
drivers/iio/pressure/mpl115.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/iio/pressure/mpl115.c b/drivers/iio/pressure/mpl115.c
index f5ecd6e19f5d..a0d7deeac62f 100644
--- a/drivers/iio/pressure/mpl115.c
+++ b/drivers/iio/pressure/mpl115.c
@@ -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:
More information about the kernel-team
mailing list