linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Gregor Boirie <gregor.boirie@parrot.com>, linux-iio@vger.kernel.org
Cc: Hartmut Knaack <knaack.h@gmx.de>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Peter Meerwald <pmeerw@pmeerw.net>,
	Tomasz Duszynski <tduszyns@gmail.com>,
	Daniel Baluta <daniel.baluta@intel.com>,
	Krzysztof Kozlowski <k.kozlowski@samsung.com>,
	Mark Brown <broonie@kernel.org>, "Andrew F. Davis" <afd@ti.com>
Subject: Re: [PATCH v3 1/6] iio:pressure:ms5611: fix ms5607 temp compensation
Date: Sun, 21 Feb 2016 20:51:11 +0000	[thread overview]
Message-ID: <56CA233F.3080409@kernel.org> (raw)
In-Reply-To: <44529c257a18d7fb978476375e8dad2dc92bcb12.1455731233.git.gregor.boirie@parrot.com>

On 17/02/16 17:52, Gregor Boirie wrote:
> Computation of sens2 was wrong and is fixed by this patch, sens2 should be:
>     2 * (t - 2000)^2
> See page 8 of ms5607 datasheet here:
>     http://www.meas-spec.com/product/pressure/MS5607-02BA03.aspx
> 
> Signed-off-by: Gregor Boirie <gregor.boirie@parrot.com>
> Acked-by: Lucas De Marchi <lucas.demarchi@intel.com>
> Acked-by: Peter Meerwald-Stadler <pmeerw@pmeerw.net>
Hmm. We are late enough in the cycle now that I'm going to take this through
the togreg branch rather than fixes-togreg.  Partly this is to make my life
easier wrt to noise vs the rest of this series.

Applied to the togreg branch of iio.git - initially pushed out as testing
for the auto builders to play with it.

Thanks,

Jonathan
> ---
>  drivers/iio/pressure/ms5611_core.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/iio/pressure/ms5611_core.c b/drivers/iio/pressure/ms5611_core.c
> index c7885f0c..84ab8d2 100644
> --- a/drivers/iio/pressure/ms5611_core.c
> +++ b/drivers/iio/pressure/ms5611_core.c
> @@ -136,17 +136,17 @@ static int ms5607_temp_and_pressure_compensate(struct ms5611_chip_info *chip_inf
>  
>  	t = 2000 + ((chip_info->prom[6] * dt) >> 23);
>  	if (t < 2000) {
> -		s64 off2, sens2, t2;
> +		s64 off2, sens2, t2, tmp;
>  
>  		t2 = (dt * dt) >> 31;
> -		off2 = (61 * (t - 2000) * (t - 2000)) >> 4;
> -		sens2 = off2 << 1;
> +		tmp = (t - 2000) * (t - 2000);
> +		off2 = (61 * tmp) >> 4;
> +		sens2 = tmp << 1;
>  
>  		if (t < -1500) {
> -			s64 tmp = (t + 1500) * (t + 1500);
> -
> +			tmp = (t + 1500) * (t + 1500);
>  			off2 += 15 * tmp;
> -			sens2 += (8 * tmp);
> +			sens2 += 8 * tmp;
>  		}
>  
>  		t -= t2;
> 


  reply	other threads:[~2016-02-21 20:51 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-17 17:52 [PATCH v3 0/6] iio:pressure:ms5611: fix and enhancements Gregor Boirie
2016-02-17 17:52 ` [PATCH v3 1/6] iio:pressure:ms5611: fix ms5607 temp compensation Gregor Boirie
2016-02-21 20:51   ` Jonathan Cameron [this message]
2016-02-17 17:52 ` [PATCH v3 2/6] iio:pressure:ms5611: use probed device name Gregor Boirie
2016-02-21 20:52   ` Jonathan Cameron
2016-02-17 17:52 ` [PATCH v3 3/6] iio:pressure:ms5611: power regulator support Gregor Boirie
2016-02-21 20:53   ` Jonathan Cameron
2016-02-17 17:52 ` [PATCH v3 4/6] iio:pressure:ms5611: DT bindings documentation Gregor Boirie
2016-02-21 21:00   ` Jonathan Cameron
2016-02-17 17:52 ` [PATCH v3 5/6] iio:pressure:ms5611: oversampling rate support Gregor Boirie
2016-02-21 21:02   ` Jonathan Cameron
2016-02-17 17:52 ` [PATCH v3 6/6] iio:pressure:ms5611: continuous sampling support Gregor Boirie
2016-02-17 21:09   ` Jonathan Cameron
2016-02-18 10:18     ` Gregor Boirie

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=56CA233F.3080409@kernel.org \
    --to=jic23@kernel.org \
    --cc=afd@ti.com \
    --cc=broonie@kernel.org \
    --cc=daniel.baluta@intel.com \
    --cc=gregor.boirie@parrot.com \
    --cc=k.kozlowski@samsung.com \
    --cc=knaack.h@gmx.de \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=pmeerw@pmeerw.net \
    --cc=tduszyns@gmail.com \
    /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).