linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: <Victor.Duicu@microchip.com>
To: <conor@kernel.org>
Cc: <dlechner@baylibre.com>, <nuno.sa@analog.com>,
	<linux-iio@vger.kernel.org>, <devicetree@vger.kernel.org>,
	<robh@kernel.org>, <jic23@kernel.org>, <krzk+dt@kernel.org>,
	<andy@kernel.org>, <linux-kernel@vger.kernel.org>,
	<Marius.Cristea@microchip.com>, <conor+dt@kernel.org>
Subject: Re: [PATCH v2 1/2] dt-bindings: iio: temperature: add support for MCP998X
Date: Tue, 10 Jun 2025 13:29:01 +0000	[thread overview]
Message-ID: <c5de1b615c40cd4d4380cf5f340bda3da23f4069.camel@microchip.com> (raw)
In-Reply-To: <20250606-unfeeling-legacy-c7eab453b062@spud>

On Fri, 2025-06-06 at 16:15 +0100, Conor Dooley wrote:
> Jonathan,
> 
> On Mon, Jun 02, 2025 at 02:48:52PM +0000,
> Victor.Duicu@microchip.com wrote:
> > On Fri, 2025-05-30 at 16:55 +0100, Conor Dooley wrote:
> > > On Thu, May 29, 2025 at 01:13:38PM -0500, David Lechner wrote:
> > > > On 5/29/25 4:36 AM, victor.duicu@microchip.com wrote:
> > > > > From: Victor Duicu <victor.duicu@microchip.com>
> > > > > +  microchip,recd12:
> > > > > +    description:
> > > > > +      Enable resistance error correction for external
> > > > > channels 1
> > > > > and 2.
> > > > > +      Omit this tag to disable REC for channels 1 and 2.
> > > > > +    type: boolean
> > > > > +
> > > > > +  microchip,recd34:
> > > > > +    description:
> > > > > +      Enable resistance error correction for external
> > > > > channels 3
> > > > > and 4.
> > > > > +      Omit this tag to disable REC for channels 3 and 4.
> > > 
> > > Why are these two devicetree properties, rather than runtime
> > > controls?
> > 
> > The parasitic resistance added to the series resistance is
> > dependent
> > only on the circuit. 
> > It is possible for the chip and the transistor to be at some
> > distance
> > from each other. The manufacturer can approximate the error added
> > and
> > decide if resistance error correction should be applied.
> 
> I don't think I buy this line of argument. The property is not
> describing the hardware, it's literally being used as a toggle for
> some
> software feature. It'd be more acceptable if it indicated that the
> chip
> and transistor were distant, leaving software to make a decision on
> what
> that meant. One user (say bsd) might want decide that the driver
> should
> always enable it, but another (say linux) might expose it as a
> control
> to userspace defaulting based the dt property.
> Additionally, the name of the property is pretty awful, and does not
> even hint at what it's doing - and there's no mention of why channel
> 1/2
> and 3/4 are bound together.
> 
You are correct that the parameters recd12 and recd34 do not directly
describe the hardware, but they control a software feature of the chip
itself. Resistance error correction is capable of counterbalancing
the parasitic resistance added to the external diodes, which can be
significant.

The manufacturer knows where the chip and diode are and can decide if
correction is necessary. The user does not have that insight.

I can change the name of the parameter to something like
resistance_err_correction and mention in the description which channels
are affected.


> > The user cannot influence the parasitic resistance nor calculate
> > it.
> 
> I don't think that's super relevant here, since the property has
> nothing
> to do with influencing or calculating the value. I meant deciding
> whether
> or not the correction is applied, just as the dt property you propose
> does now.
> 
> Cheers,
> Conor.

Kind Regards,
Victor Duicu

  reply	other threads:[~2025-06-10 13:29 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-29  9:36 [PATCH v2 0/2] add support for MCP998X victor.duicu
2025-05-29  9:36 ` [PATCH v2 1/2] dt-bindings: iio: temperature: " victor.duicu
2025-05-29 18:13   ` David Lechner
2025-05-30 15:55     ` Conor Dooley
2025-06-02 14:48       ` Victor.Duicu
2025-06-06 15:15         ` Conor Dooley
2025-06-10 13:29           ` Victor.Duicu [this message]
2025-06-10 15:17             ` Conor Dooley
2025-05-29  9:36 ` [PATCH v2 2/2] " victor.duicu
2025-05-29 18:36   ` Andy Shevchenko
2025-05-30  4:39   ` kernel test robot
2025-05-30 16:53   ` Jonathan Cameron
2025-06-02 14:49     ` Victor.Duicu
2025-06-07 17:28       ` 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=c5de1b615c40cd4d4380cf5f340bda3da23f4069.camel@microchip.com \
    --to=victor.duicu@microchip.com \
    --cc=Marius.Cristea@microchip.com \
    --cc=andy@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=conor@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dlechner@baylibre.com \
    --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;
as well as URLs for NNTP newsgroup(s).