From: Jonathan Cameron <jic23@kernel.org>
To: Akinobu Mita <akinobu.mita@gmail.com>, linux-iio@vger.kernel.org
Cc: Hartmut Knaack <knaack.h@gmx.de>,
Lars-Peter Clausen <lars@metafoo.de>,
Peter Meerwald <pmeerw@pmeerw.net>
Subject: Re: [PATCH] iio: pressure: mpl115: fix temperature offset sign
Date: Sun, 24 Jan 2016 16:33:14 +0000 [thread overview]
Message-ID: <56A4FCCA.80500@kernel.org> (raw)
In-Reply-To: <1453306051-8817-1-git-send-email-akinobu.mita@gmail.com>
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.
>
> 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:
>
next prev parent reply other threads:[~2016-01-24 16:33 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 [this message]
2016-01-26 12:33 ` Peter Meerwald-Stadler
2016-01-30 16:08 ` Jonathan Cameron
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=56A4FCCA.80500@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).