Re: [PATCH v1 1/2] dt-bindings: iio: temperature: add support for MCP998X
From: Victor.Duicu
Date: Thu Apr 17 2025 - 07:41:05 EST
On Tue, 2025-04-15 at 18:52 +0100, Jonathan Cameron wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you
> know the content is safe
>
> On Tue, 15 Apr 2025 16:26:22 +0300
> <victor.duicu@xxxxxxxxxxxxx> wrote:
>
> > From: Victor Duicu <victor.duicu@xxxxxxxxxxxxx>
> >
> > This is the devicetree schema for Microchip MCP998X/33 and
> > MCP998XD/33D Multichannel Automotive Temperature Monitor Family.
> Hi Victor,
>
Hi Jonathan,
> Please state briefly here in what way the parts are incompatible
> as a justification for no fallback compatibles. Quite a bit
> of that will become apparent when you enforce validity of parameters
> as suggested below.
>
I am a bit confused, could you elaborate a bit on this point? Are you
asking if the chips mcp9982, 83, 84 etc. are compatible among each
other?
> Various comments inline.
> >
> > Signed-off-by: Victor Duicu <victor.duicu@xxxxxxxxxxxxx>
> > ---
>
...
>
> > +
> > + microchip,extended-temp-range:
> > + description: |
> > + Set the chip to work in the extended temperature range -64
> > degrees C to 191.875 degrees C.
> > + Omit this tag to set the default range 0 degrees C to
> > 127.875 degrees C
> > + type: boolean
>
> I'm curious. Why does this belong in the DT binding?
>
Regarding microchip,extended-temp-range, my perspective is that the
user knows beforehand which specific range of temperatures he needs.
For example, if the device to be measured is a freezer, the user would
be interested in temperatures below 0 degrees C. If we monitor a CPU,
the user would be interested in temperatures above 0 degrees C.
> > +
> > + microchip,beta-channel1:
> > + description: |
> > + The beta compensation factor for external channel 1 can be
> > set
> > + by the user, or can be set automatically by the chip.
> > + If one wants to enable beta autodetection, omit this tag.
> > + Please consult the documentation if one wants to set a
> > specific beta.
> > + If anti-parallel diode operation is enabled, the default
> > value is set
> > + and can't be changed.
> > + type: boolean
>
> Why is this a hardware thing that belongs in dt? Enforce the
> constraint
> in the schema rather than text.
>
With respect to the beta parameter, it is directly affected by the
hardware part used. For example a CPU diode would require a different
beta (that could be known by the manufacturer of the device and not
know by the final user) as opposed to a diode connected transistor
(that could be easily measured by the end user).
However, I remain open to the idea of moving temperature range and
channel betas to user space if you think it is better that way.
Kind regards,
Victor Duicu
...
> >
>