linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andy Shevchenko <andy.shevchenko@gmail.com>
To: Crt Mori <cmo@melexis.com>
Cc: Jonathan Cameron <jic23@kernel.org>,
	linux-iio <linux-iio@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v4 2/4] iio:temperature:mlx90632: Adding extended calibration option
Date: Sat, 8 Aug 2020 23:03:51 +0300	[thread overview]
Message-ID: <CAHp75VfWk7pCy4Osv0uY0UH4yFS=PRGbE1CNCakuRFTE33SDJg@mail.gmail.com> (raw)
In-Reply-To: <20200808121026.1300375-3-cmo@melexis.com>

On Sat, Aug 8, 2020 at 3:11 PM Crt Mori <cmo@melexis.com> wrote:
>
> For some time the market wants medical grade accuracy in medical range,
> while still retaining the declared accuracy outside of the medical range
> within the same sensor. That is why we created extended calibration
> which is automatically switched to when object temperature is too high.
>
> This patch also introduces the object_ambient_temperature variable which
> is needed for more accurate calculation of the object infra-red
> footprint as sensor's ambient temperature might be totally different
> than what the ambient temperature is at object and that is why we can
> have some more errors which can be eliminated. Currently this temperature
> is fixed at 25, but the interface to adjust it by user (with external
> sensor or just IR measurement of the other object which acts as ambient),
> will be introduced in another commit.

The kernel doc patch should go before this patch.

...

> +       *ambient_new_raw = (s16)read_tmp;

> +       *ambient_old_raw = (s16)read_tmp;

Sorry, did I miss your answer about these castings all over the patch?

...

> +       ret = regmap_read(regmap, MLX90632_RAM_1(17), &read_tmp);
> +       ret = regmap_read(regmap, MLX90632_RAM_2(17), &read_tmp);
> +       ret = regmap_read(regmap, MLX90632_RAM_1(18), &read_tmp);
> +       ret = regmap_read(regmap, MLX90632_RAM_2(18), &read_tmp);
> +       ret = regmap_read(regmap, MLX90632_RAM_1(19), &read_tmp);
> +       ret = regmap_read(regmap, MLX90632_RAM_2(19), &read_tmp);

What so special about these magic 17, 18, 19? Can you provide definitions?

...

> +       int tries = 4;

> +       while (tries-- > 0) {
> +               ret = mlx90632_perform_measurement(data);
> +               if (ret < 0)
> +                       goto read_unlock;
> +
> +               if (ret == 19)
> +                       break;
> +       }
> +       if (tries < 0) {
> +               ret = -ETIMEDOUT;
> +               goto read_unlock;
> +       }

Please avoid ping-pong type of changes in the same series (similar way
as for kernel doc), which means don't introduce something you are
going to change later on. Patch to move to do {} while () should go
before this one.

-- 
With Best Regards,
Andy Shevchenko

  reply	other threads:[~2020-08-08 20:04 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-08 12:10 [PATCH v4 0/4] iio: temperature: mlx90632: Add extended calibration calculations Crt Mori
2020-08-08 12:10 ` [PATCH v4 1/4] iio:temperature:mlx90632: Reduce number of equal calulcations Crt Mori
2020-08-08 19:58   ` Andy Shevchenko
2020-08-08 12:10 ` [PATCH v4 2/4] iio:temperature:mlx90632: Adding extended calibration option Crt Mori
2020-08-08 20:03   ` Andy Shevchenko [this message]
2020-08-08 21:57     ` Crt Mori
2020-08-09 13:32       ` Jonathan Cameron
2020-08-09 21:05         ` Crt Mori
2020-08-11  7:53           ` Crt Mori
2020-08-16  9:09             ` Jonathan Cameron
2020-08-08 12:10 ` [PATCH v4 3/4] iio:temperature:mlx90632: Add kerneldoc to the internal struct Crt Mori
2020-08-08 19:54   ` Andy Shevchenko
2020-08-08 12:10 ` [PATCH v4 4/4] iio:temperature:mlx90632: Convert polling while loops to do-while Crt Mori
2020-08-08 19:56 ` [PATCH v4 0/4] iio: temperature: mlx90632: Add extended calibration calculations Andy Shevchenko
2020-08-08 20:04 ` Andy Shevchenko
2020-08-08 20:06 ` Andy Shevchenko

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='CAHp75VfWk7pCy4Osv0uY0UH4yFS=PRGbE1CNCakuRFTE33SDJg@mail.gmail.com' \
    --to=andy.shevchenko@gmail.com \
    --cc=cmo@melexis.com \
    --cc=jic23@kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /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).