From: Victor Duicu <victor.duicu@microchip.com>
This is the devicetree schema for Microchip MCP998X/33 and
MCP998XD/33D Multichannel Automotive Temperature Monitor Family.
Signed-off-by: Victor Duicu <victor.duicu@microchip.com>
---
.../iio/temperature/microchip,mcp9982.yaml | 182 ++++++++++++++++++
1 file changed, 182 insertions(+)
create mode 100644 Documentation/devicetree/bindings/iio/temperature/microchip,mcp9982.yaml
diff --git a/Documentation/devicetree/bindings/iio/temperature/microchip,mcp9982.yaml b/Documentation/devicetree/bindings/iio/temperature/microchip,mcp9982.yaml
new file mode 100644
index 000000000000..8cbf897d1278
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/temperature/microchip,mcp9982.yaml
@@ -0,0 +1,182 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/temperature/microchip,mcp9982.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Microchip MCP998X/33 and MCP998XD/33D Multichannel Automotive Temperature Monitor Family
+
+maintainers:
+ - Victor Duicu <victor.duicu@microchip.com>
+
+description: |
+ The MCP998X/33 and MCP998XD/33D family is a high-accuracy 2-wire multichannel
+ automotive temperature monitor.
+ The datasheet can be found here:
+ https://ww1.microchip.com/downloads/aemDocuments/documents/MSLD/ProductDocuments/DataSheets/MCP998X-Family-Data-Sheet-DS20006827.pdf
+
+properties:
+ compatible:
+ enum:
+ - microchip,mcp9933
+ - microchip,mcp9933D
+ - microchip,mcp9982
+ - microchip,mcp9982D
+ - microchip,mcp9983
+ - microchip,mcp9983D
+ - microchip,mcp9984
+ - microchip,mcp9984D
+ - microchip,mcp9985
+ - microchip,mcp9985D
+
+ reg:
+ maxItems: 1
+
+ interrupts:
+ maxItems: 2
+
+ interrupt-names:
+ description: |
+ ALERT1 indicates a HIGH or LOW limit was exceeded.
+ ALERT2 indicates a THERM limit was exceeded.
+ items:
+ - const: ALERT1
+ - const: ALERT2
+
+ "#address-cells":
+ const: 1
+
+ "#size-cells":
+ const: 0
+
+ microchip,temp-hysteresis:
+ description: |
+ Value of temperature limit hysteresis.
+ Omit this tag to set the default value.
+ $ref: /schemas/types.yaml#/definitions/uint32
+
+ 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
+
+ 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
+
+ microchip,beta-channel2:
+ description: |
+ The beta compensation factor for external channel 2 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
+
+ microchip,apdd-state:
+ description: |
+ Enable anti-parallel diode mode operation.
+ Omit this tag to disable anti-parallel diode mode by default.
+ type: boolean
+
+ microchip,recd12:
+ description: |
+ Enable resistance error correction for external channels 1 and 2.
+ Not all chips support resistance error correction on external
+ channels 1 and 2, please consult the documentation.
+ Omit this tag to disable REC for channels 1 and 2 by default.
+ type: boolean
+
+ microchip,recd34:
+ description: |
+ Enable resistance error correction for external channels 3 and 4.
+ Not all chips support resistance error correction on external
+ channels 3 and 4, please consult the documentation.
+ Omit this tag to disable REC for channels 3 and 4 by default.
+ type: boolean
+
+ label:
+ description: Unique name to identify which device this is.
+
+ vdd-supply: true
+
+patternProperties:
+ "^channel@[1-4]+$":
+ description: |
+ Represents the external temperature channels to which a remote diode is
+ connected.
+ type: object
+
+ properties:
+ reg:
+ items:
+ minimum: 1
+ maximum: 4
+
+ microchip,ideality-factor:
+ description: |
+ Each channel has an ideality factor.
+ Beta compensation and resistance error correction automatically correct
+ for most ideality error. So ideality factor does not need to be adjusted in general.
+ Omit this tag in order to set the default value.
+ Please consult the documentation if one wants to set a specific ideality value.
+ $ref: /schemas/types.yaml#/definitions/uint32
+
+ label:
+ description: Unique name to identify which channel this is.
+
+ required:
+ - reg
+
+ unevaluatedProperties: false
+
+required:
+ - compatible
+ - reg
+ - vdd-supply
+
+additionalProperties: false
+
+examples:
+ - |
+ i2c {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ temperature-sensor@4c {
+ compatible = "microchip,mcp9985";
+ reg = <0x4c>;
+
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ label = "temperature-sensor";
+
+ microchip,temp-hysteresis = <10>;
+ microchip,extended-temp-range;
+ microchip,apdd-state;
+ microchip,recd12;
+ microchip,recd34;
+ vdd-supply = <&vdd>;
+
+ channel@1{
+ reg = <0x1>;
+ label = "CPU Temperature";
+ };
+
+ channel@2{
+ reg = <0x2>;
+ label = "GPU Temperature";
+ };
+ };
+ };
+
+...
--
2.45.2
On 15/04/2025 15:26, victor.duicu@microchip.com wrote:
> From: Victor Duicu <victor.duicu@microchip.com>
>
> This is the devicetree schema for Microchip MCP998X/33 and
> MCP998XD/33D Multichannel Automotive Temperature Monitor Family.
>
> Signed-off-by: Victor Duicu <victor.duicu@microchip.com>
<form letter>
Please use scripts/get_maintainers.pl to get a list of necessary people
and lists to CC. It might happen, that command when run on an older
kernel, gives you outdated entries. Therefore please be sure you base
your patches on recent Linux kernel.
Tools like b4 or scripts/get_maintainer.pl provide you proper list of
people, so fix your workflow. Tools might also fail if you work on some
ancient tree (don't, instead use mainline) or work on fork of kernel
(don't, instead use mainline). Just use b4 and everything should be
fine, although remember about `b4 prep --auto-to-cc` if you added new
patches to the patchset.
You missed at least devicetree list (maybe more), so this won't be
tested by automated tooling. Performing review on untested code might be
a waste of time.
Please kindly resend and include all necessary To/Cc entries.
</form letter>
> ---
> .../iio/temperature/microchip,mcp9982.yaml | 182 ++++++++++++++++++
> 1 file changed, 182 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/iio/temperature/microchip,mcp9982.yaml
>
> diff --git a/Documentation/devicetree/bindings/iio/temperature/microchip,mcp9982.yaml b/Documentation/devicetree/bindings/iio/temperature/microchip,mcp9982.yaml
> new file mode 100644
> index 000000000000..8cbf897d1278
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/iio/temperature/microchip,mcp9982.yaml
> @@ -0,0 +1,182 @@
> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/iio/temperature/microchip,mcp9982.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Microchip MCP998X/33 and MCP998XD/33D Multichannel Automotive Temperature Monitor Family
Wrap according to coding style document.
> +
> +maintainers:
> + - Victor Duicu <victor.duicu@microchip.com>
> +
> +description: |
> + The MCP998X/33 and MCP998XD/33D family is a high-accuracy 2-wire multichannel
> + automotive temperature monitor.
> + The datasheet can be found here:
> + https://ww1.microchip.com/downloads/aemDocuments/documents/MSLD/ProductDocuments/DataSheets/MCP998X-Family-Data-Sheet-DS20006827.pdf
> +
> +properties:
> + compatible:
> + enum:
> + - microchip,mcp9933
> + - microchip,mcp9933D
> + - microchip,mcp9982
> + - microchip,mcp9982D
> + - microchip,mcp9983
> + - microchip,mcp9983D
> + - microchip,mcp9984
> + - microchip,mcp9984D
> + - microchip,mcp9985
> + - microchip,mcp9985D
> +
> + reg:
> + maxItems: 1
> +
> + interrupts:
> + maxItems: 2
> +
> + interrupt-names:
> + description: |
> + ALERT1 indicates a HIGH or LOW limit was exceeded.
> + ALERT2 indicates a THERM limit was exceeded.
> + items:
> + - const: ALERT1
alert1
> + - const: ALERT2
alert2
> +
> + "#address-cells":
> + const: 1
> +
> + "#size-cells":
> + const: 0
> +
> + microchip,temp-hysteresis:
> + description: |
> + Value of temperature limit hysteresis.
> + Omit this tag to set the default value.
> + $ref: /schemas/types.yaml#/definitions/uint32
temperature is in specific units, see property units in dtschema.
> +
> + microchip,extended-temp-range:
> + description: |
Do not need '|' unless you need to preserve formatting.
> + Set the chip to work in the extended temperature range -64 degrees C to 191.875 degrees C.
does not look wrapped.
> + Omit this tag to set the default range 0 degrees C to 127.875 degrees C
> + type: boolean
Why is this a property of the board? I imagine someone might want
different accuracy during runtime.
> +
> + 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
> +
> + microchip,beta-channel2:
> + description: |
> + The beta compensation factor for external channel 2 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
> +
> + microchip,apdd-state:
> + description: |
> + Enable anti-parallel diode mode operation.
> + Omit this tag to disable anti-parallel diode mode by default.
> + type: boolean
> +
> + microchip,recd12:
> + description: |
> + Enable resistance error correction for external channels 1 and 2.
> + Not all chips support resistance error correction on external
> + channels 1 and 2, please consult the documentation.
> + Omit this tag to disable REC for channels 1 and 2 by default.
> + type: boolean
> +
> + microchip,recd34:
> + description: |
> + Enable resistance error correction for external channels 3 and 4.
> + Not all chips support resistance error correction on external
Then this should be restricted per compatible in allOf:if:then:.
> + channels 3 and 4, please consult the documentation.
> + Omit this tag to disable REC for channels 3 and 4 by default.
> + type: boolean
> +
> + label:
> + description: Unique name to identify which device this is.
> +
> + vdd-supply: true
> +
> +patternProperties:
> + "^channel@[1-4]+$":
4 or 44? Drop +
> + description: |
Do not need '|' unless you need to preserve formatting.
> + Represents the external temperature channels to which a remote diode is
> + connected.
> + type: object
> +
> + properties:
> + reg:
> + items:
> + minimum: 1
> + maximum: 4
> +
> + microchip,ideality-factor:
> + description: |
> + Each channel has an ideality factor.
> + Beta compensation and resistance error correction automatically correct
> + for most ideality error. So ideality factor does not need to be adjusted in general.
> + Omit this tag in order to set the default value.
default: X
> + Please consult the documentation if one wants to set a specific ideality value.
> + $ref: /schemas/types.yaml#/definitions/uint32
> +
> + label:
> + description: Unique name to identify which channel this is.
> +
> + required:
> + - reg
> +
> + unevaluatedProperties: false
additionalProperties or reference appropriate schema for subnode.
> +
> +required:
> + - compatible
> + - reg
> + - vdd-supply
> +
> +additionalProperties: false
> +
> +examples:
> + - |
> + i2c {
> + #address-cells = <1>;
> + #size-cells = <0>;
> +
> + temperature-sensor@4c {
> + compatible = "microchip,mcp9985";
> + reg = <0x4c>;
> +
> + #address-cells = <1>;
> + #size-cells = <0>;
> +
> + label = "temperature-sensor";
> +
> + microchip,temp-hysteresis = <10>;
> + microchip,extended-temp-range;
> + microchip,apdd-state;
> + microchip,recd12;
> + microchip,recd34;
> + vdd-supply = <&vdd>;
> +
> + channel@1{
Missing spaces. Please see DTS coding style or any DTS style.
Best regards,
Krzysztof
On Tue, 15 Apr 2025 16:26:22 +0300
<victor.duicu@microchip.com> wrote:
> From: Victor Duicu <victor.duicu@microchip.com>
>
> This is the devicetree schema for Microchip MCP998X/33 and
> MCP998XD/33D Multichannel Automotive Temperature Monitor Family.
Hi Victor,
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.
Various comments inline.
>
> Signed-off-by: Victor Duicu <victor.duicu@microchip.com>
> ---
> .../iio/temperature/microchip,mcp9982.yaml | 182 ++++++++++++++++++
> 1 file changed, 182 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/iio/temperature/microchip,mcp9982.yaml
>
> diff --git a/Documentation/devicetree/bindings/iio/temperature/microchip,mcp9982.yaml b/Documentation/devicetree/bindings/iio/temperature/microchip,mcp9982.yaml
> new file mode 100644
> index 000000000000..8cbf897d1278
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/iio/temperature/microchip,mcp9982.yaml
> @@ -0,0 +1,182 @@
> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/iio/temperature/microchip,mcp9982.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Microchip MCP998X/33 and MCP998XD/33D Multichannel Automotive Temperature Monitor Family
> +
> +maintainers:
> + - Victor Duicu <victor.duicu@microchip.com>
> +
> +description: |
> + The MCP998X/33 and MCP998XD/33D family is a high-accuracy 2-wire multichannel
> + automotive temperature monitor.
> + The datasheet can be found here:
> + https://ww1.microchip.com/downloads/aemDocuments/documents/MSLD/ProductDocuments/DataSheets/MCP998X-Family-Data-Sheet-DS20006827.pdf
> +
> +properties:
> + compatible:
> + enum:
> + - microchip,mcp9933
> + - microchip,mcp9933D
> + - microchip,mcp9982
> + - microchip,mcp9982D
> + - microchip,mcp9983
> + - microchip,mcp9983D
> + - microchip,mcp9984
> + - microchip,mcp9984D
> + - microchip,mcp9985
> + - microchip,mcp9985D
> +
> + reg:
> + maxItems: 1
> +
> + interrupts:
> + maxItems: 2
> +
> + interrupt-names:
> + description: |
> + ALERT1 indicates a HIGH or LOW limit was exceeded.
> + ALERT2 indicates a THERM limit was exceeded.
> + items:
> + - const: ALERT1
> + - const: ALERT2
> +
> + "#address-cells":
> + const: 1
> +
> + "#size-cells":
> + const: 0
> +
> + microchip,temp-hysteresis:
> + description: |
> + Value of temperature limit hysteresis.
> + Omit this tag to set the default value.
> + $ref: /schemas/types.yaml#/definitions/uint32
Can we just make this a userspace thing using appropriate _hysteresis ABI element?
> +
> + 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?
> +
> + 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.
> +
> + microchip,beta-channel2:
> + description: |
> + The beta compensation factor for external channel 2 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
> +
> + microchip,apdd-state:
> + description: |
> + Enable anti-parallel diode mode operation.
> + Omit this tag to disable anti-parallel diode mode by default.
This one is unusual. Maybe a little more description (I looked it up
and am fine with why this is in DT)
> + type: boolean
> +
> + microchip,recd12:
> + description: |
No need for | on paragraphs where formatting doesn't need to be maintained.
> + Enable resistance error correction for external channels 1 and 2.
> + Not all chips support resistance error correction on external
> + channels 1 and 2, please consult the documentation.
Enforce it in the schema, no need to say that chips don't support it
in text. Look at the various allOf statements with compatible matches
in other bindings for how to do that.
> + Omit this tag to disable REC for channels 1 and 2 by default.
> + type: boolean
> +
> + microchip,recd34:
> + description: |
> + Enable resistance error correction for external channels 3 and 4.
> + Not all chips support resistance error correction on external
> + channels 3 and 4, please consult the documentation.
> + Omit this tag to disable REC for channels 3 and 4 by default.
> + type: boolean
> +
> + label:
> + description: Unique name to identify which device this is.
> +
> + vdd-supply: true
> +
> +patternProperties:
> + "^channel@[1-4]+$":
> + description: |
> + Represents the external temperature channels to which a remote diode is
> + connected.
> + type: object
> +
> + properties:
> + reg:
> + items:
> + minimum: 1
> + maximum: 4
> +
> + microchip,ideality-factor:
> + description: |
> + Each channel has an ideality factor.
> + Beta compensation and resistance error correction automatically correct
> + for most ideality error. So ideality factor does not need to be adjusted in general.
wrap at 80 chars. Also try to avoid explicit formatting where it isn't needed.
> + Omit this tag in order to set the default value.
> + Please consult the documentation if one wants to set a specific ideality value.
> + $ref: /schemas/types.yaml#/definitions/uint32
> +
> + label:
> + description: Unique name to identify which channel this is.
> +
> + required:
> + - reg
> +
> + unevaluatedProperties: false
> +
> +required:
> + - compatible
> + - reg
> + - vdd-supply
> +
> +additionalProperties: false
> +
> +examples:
> + - |
> + i2c {
> + #address-cells = <1>;
> + #size-cells = <0>;
> +
> + temperature-sensor@4c {
> + compatible = "microchip,mcp9985";
> + reg = <0x4c>;
> +
> + #address-cells = <1>;
> + #size-cells = <0>;
> +
> + label = "temperature-sensor";
> +
> + microchip,temp-hysteresis = <10>;
> + microchip,extended-temp-range;
> + microchip,apdd-state;
> + microchip,recd12;
> + microchip,recd34;
> + vdd-supply = <&vdd>;
> +
> + channel@1{
> + reg = <0x1>;
> + label = "CPU Temperature";
> + };
> +
> + channel@2{
> + reg = <0x2>;
> + label = "GPU Temperature";
> + };
> + };
> + };
> +
> +...
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@microchip.com> wrote: > > > From: Victor Duicu <victor.duicu@microchip.com> > > > > 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@microchip.com> > > --- > ... > > > + > > + 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 ... > > >
On Thu, 17 Apr 2025 11:40:53 +0000 <Victor.Duicu@microchip.com> wrote: > 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@microchip.com> wrote: > > > > > From: Victor Duicu <victor.duicu@microchip.com> > > > > > > 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? yes. It makes it easier for binding review to just have statement in the patch description of how they are different in ways the driver needs to know about. Can be simple things like 'only some devices have X' or they have differing numbers of channels. > > > > Various comments inline. > > > > > > Signed-off-by: Victor Duicu <victor.duicu@microchip.com> > > > --- > > > ... > > > > > + > > > + 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. Maybe - though also easy to control from userspace by making the offset writeable. > > > > + > > > + 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. For the betas I was more curious about why the dt needs to distinguish between a manual setting and autodetection. When is autodetection a bad idea for example? Jonathan > > Kind regards, > Victor Duicu > ... > > > > > >
© 2016 - 2025 Red Hat, Inc.