From: Jonathan Cameron <jic23@kernel.org>
To: Peter Meerwald-Stadler <pmeerw@pmeerw.net>
Cc: Akinobu Mita <akinobu.mita@gmail.com>,
linux-iio@vger.kernel.org, Hartmut Knaack <knaack.h@gmx.de>,
Lars-Peter Clausen <lars@metafoo.de>
Subject: Re: [PATCH] iio: pressure: mpl115: fix temperature offset sign
Date: Sat, 30 Jan 2016 16:08:46 +0000 [thread overview]
Message-ID: <56ACE00E.3080103@kernel.org> (raw)
In-Reply-To: <alpine.DEB.2.02.1601261333010.22166@pmeerw.net>
On 26/01/16 12:33, Peter Meerwald-Stadler wrote:
> On Sun, 24 Jan 2016, Jonathan Cameron wrote:
>
>> On 20/01/16 16:07, Akinobu Mita wrote:
>>> 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.
>
> Acked-by: Peter Meerwald-Stadler <pmeerw@pmeerw.net>
Applied to the fixes-togreg branch and marked for stable.
Thanks,
Jonathan
>
>>> Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
>>> Cc: Jonathan Cameron <jic23@kernel.org>
>>> Cc: Hartmut Knaack <knaack.h@gmx.de>
>>> Cc: Lars-Peter Clausen <lars@metafoo.de>
>>> Cc: Peter Meerwald <pmeerw@pmeerw.net>
>>> Cc: linux-iio@vger.kernel.org
>> Peter,
>>
>> I'd like your Ack on this given it is your driver. That way
>> I can be lazy and not cross check the datasheet myself.
>>
>> Jonathan
>>> ---
>>> 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 138344c..73f2f0c 100644
>>> --- a/drivers/iio/pressure/mpl115.c
>>> +++ b/drivers/iio/pressure/mpl115.c
>>> @@ -118,7 +118,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:
>>>
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-iio" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at http://vger.kernel.org/majordomo-info.html
>>
>
prev parent reply other threads:[~2016-01-30 16:08 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-20 16:07 [PATCH] iio: pressure: mpl115: fix temperature offset sign Akinobu Mita
2016-01-24 16:33 ` Jonathan Cameron
2016-01-26 12:33 ` Peter Meerwald-Stadler
2016-01-30 16:08 ` Jonathan Cameron [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=56ACE00E.3080103@kernel.org \
--to=jic23@kernel.org \
--cc=akinobu.mita@gmail.com \
--cc=knaack.h@gmx.de \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=pmeerw@pmeerw.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).