Linux IIO development
 help / color / mirror / Atom feed
From: David Lechner <dlechner@baylibre.com>
To: Victor.Duicu@microchip.com, robh@kernel.org, krzk+dt@kernel.org,
	jic23@kernel.org, nuno.sa@analog.com, conor+dt@kernel.org,
	andy@kernel.org
Cc: Marius.Cristea@microchip.com, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org
Subject: Re: [PATCH v3 1/2] dt-bindings: iio: temperature: add support for MCP998X
Date: Tue, 29 Jul 2025 11:27:20 -0500	[thread overview]
Message-ID: <791e34a5-8670-48a2-9c26-782a7682f7cc@baylibre.com> (raw)
In-Reply-To: <d6c318bed4a2e61ffaac556ba1073e91c1307902.camel@microchip.com>

On 7/28/25 8:01 AM, Victor.Duicu@microchip.com wrote:
> Hi everyone,
> 
> I am writing this message to ask your opinions regarding the placement
> of temperature range property from the MCP998X/XD family in the
> devicetree.
> 
> The reason why I am bringing back this topic is due to a limitation of
> the chips. When the moving average filter is enabled, the old readings
> are kept and new readings are added to the average. This is a problem
> when changing the range of temperatures. The raw temperature values
> change based on the range so the mixed values will give erroneous
> results during averaging.
> 
> One possible workaround for this behavior is to set the temperature
> range before runtime, to not allow the user to change it.

It looks like it is just a an average of the last 8 samples at most.
So if there isn't a way to reset the chip memory that holds those 8
samples, we could just read 8 samples and throw away the values before
giving data to userspace any time we start sampling.

Even without changing the temperature range, we would still have old
values and possibly the same issue of stale data possibly influencing
the measurements any time we stop sampling and start again. So I'm not
seeing that this temperature range setting should be a special case.
It still sounds like something better suited to be set at runtime.

> 
> Initially, in the first patch, I have placed the property
> microchip,extended-temp-range in the devicetree.
> At that point I mistakenly did not include Conor, Krzysztof and Rob in
> the discussion and I would like to ask for comments.
> 

  reply	other threads:[~2025-07-29 16:27 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-13 13:02 [PATCH v3 0/2] add support for MCP998X victor.duicu
2025-06-13 13:02 ` [PATCH v3 1/2] dt-bindings: iio: temperature: " victor.duicu
2025-06-13 14:40   ` Conor Dooley
2025-06-23 13:07     ` Victor.Duicu
2025-07-28 13:01   ` Victor.Duicu
2025-07-29 16:27     ` David Lechner [this message]
2025-06-13 13:02 ` [PATCH v3 2/2] " victor.duicu
2025-06-13 21:50   ` Andy Shevchenko
2025-06-19  7:22     ` Victor.Duicu
2025-06-19  8:29       ` Andy Shevchenko
2025-06-21 17:19         ` Jonathan Cameron
2025-06-23  6:45           ` Andy Shevchenko
2025-06-14 13:18   ` Jonathan Cameron
2025-06-14 13:27     ` 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=791e34a5-8670-48a2-9c26-782a7682f7cc@baylibre.com \
    --to=dlechner@baylibre.com \
    --cc=Marius.Cristea@microchip.com \
    --cc=Victor.Duicu@microchip.com \
    --cc=andy@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=jic23@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nuno.sa@analog.com \
    --cc=robh@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