2022-08-16 10:21:18

by Farber, Eliav

[permalink] [raw]
Subject: [PATCH 13/16] hwmon: (mr75203) add thermal coefficient properties for Moortec PVT controller

Add optional "ts-coeff-g", "ts-coeff-h", "ts-coeff-cal5" and
"ts-coeff-j" properties to be used instead of defaults for the
thermal equasion.

Signed-off-by: Eliav Farber <[email protected]>
---
.../bindings/hwmon/moortec,mr75203.yaml | 33 +++++++++++++++++++
1 file changed, 33 insertions(+)

diff --git a/Documentation/devicetree/bindings/hwmon/moortec,mr75203.yaml b/Documentation/devicetree/bindings/hwmon/moortec,mr75203.yaml
index e2a55001eefc..867664bd937f 100644
--- a/Documentation/devicetree/bindings/hwmon/moortec,mr75203.yaml
+++ b/Documentation/devicetree/bindings/hwmon/moortec,mr75203.yaml
@@ -62,6 +62,30 @@ properties:
used to normalzie the voltage output results.
$ref: /schemas/types.yaml#definitions/uint32

+ ts-coeff-g:
+ description:
+ G coefficient for thermal equation.
+ maxItems: 1
+ $ref: /schemas/types.yaml#definitions/uint32
+
+ ts-coeff-h:
+ description:
+ H coefficient for thermal equation.
+ maxItems: 1
+ $ref: /schemas/types.yaml#definitions/uint32
+
+ ts-coeff-cal5:
+ description:
+ cal5 coefficient for thermal equation (can't be 0).
+ maxItems: 1
+ $ref: /schemas/types.yaml#definitions/uint32
+
+ ts-coeff-j:
+ description:
+ J coefficient for thermal equation.
+ maxItems: 1
+ $ref: /schemas/types.yaml#definitions/int32
+
required:
- compatible
- reg
@@ -75,6 +99,10 @@ additionalProperties:
- reset-control-skip
- vm-active-channels
- vm-pre-scalar-ch#
+ - ts-coeff-g
+ - ts-coeff-h
+ - ts-coeff-cal5
+ - ts-coeff-j

examples:
- |
@@ -90,5 +118,10 @@ examples:
resets = <&rcu0 0x40 7>;
vm-active-channels = [08 10 02];
vm-pre-scalar-ch5 = <2>;
+ ts-coeff-g = <57400>;
+ ts-coeff-h = <249400>;
+ ts-coeff-cal5 = <4096>;
+ ts-coeff-j = <0>;
+
#thermal-sensor-cells = <1>;
};
--
2.37.1


2022-08-18 15:15:01

by Rob Herring (Arm)

[permalink] [raw]
Subject: Re: [PATCH 13/16] hwmon: (mr75203) add thermal coefficient properties for Moortec PVT controller

On Tue, Aug 16, 2022 at 08:27:54AM +0000, Eliav Farber wrote:
> Add optional "ts-coeff-g", "ts-coeff-h", "ts-coeff-cal5" and
> "ts-coeff-j" properties to be used instead of defaults for the
> thermal equasion.
>
> Signed-off-by: Eliav Farber <[email protected]>
> ---
> .../bindings/hwmon/moortec,mr75203.yaml | 33 +++++++++++++++++++
> 1 file changed, 33 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/hwmon/moortec,mr75203.yaml b/Documentation/devicetree/bindings/hwmon/moortec,mr75203.yaml
> index e2a55001eefc..867664bd937f 100644
> --- a/Documentation/devicetree/bindings/hwmon/moortec,mr75203.yaml
> +++ b/Documentation/devicetree/bindings/hwmon/moortec,mr75203.yaml
> @@ -62,6 +62,30 @@ properties:
> used to normalzie the voltage output results.
> $ref: /schemas/types.yaml#definitions/uint32
>
> + ts-coeff-g:

Needs a vendor prefix

> + description:
> + G coefficient for thermal equation.
> + maxItems: 1

It's a scalar. 'maxItems' is for arrays/matrices.

> + $ref: /schemas/types.yaml#definitions/uint32
> +
> + ts-coeff-h:
> + description:
> + H coefficient for thermal equation.
> + maxItems: 1
> + $ref: /schemas/types.yaml#definitions/uint32
> +
> + ts-coeff-cal5:
> + description:
> + cal5 coefficient for thermal equation (can't be 0).

minimum: 1

Other constraints on all these?

> + maxItems: 1
> + $ref: /schemas/types.yaml#definitions/uint32
> +
> + ts-coeff-j:
> + description:
> + J coefficient for thermal equation.
> + maxItems: 1
> + $ref: /schemas/types.yaml#definitions/int32
> +
> required:
> - compatible
> - reg
> @@ -75,6 +99,10 @@ additionalProperties:
> - reset-control-skip
> - vm-active-channels
> - vm-pre-scalar-ch#
> + - ts-coeff-g
> + - ts-coeff-h
> + - ts-coeff-cal5
> + - ts-coeff-j
>
> examples:
> - |
> @@ -90,5 +118,10 @@ examples:
> resets = <&rcu0 0x40 7>;
> vm-active-channels = [08 10 02];
> vm-pre-scalar-ch5 = <2>;
> + ts-coeff-g = <57400>;
> + ts-coeff-h = <249400>;
> + ts-coeff-cal5 = <4096>;
> + ts-coeff-j = <0>;
> +
> #thermal-sensor-cells = <1>;
> };
> --
> 2.37.1
>