2022-08-17 06:10:12

by Farber, Eliav

[permalink] [raw]
Subject: [PATCH v2 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 21:43:26

by Guenter Roeck

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

On Wed, Aug 17, 2022 at 05:43:18AM +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.
>
Vendor prefix again, and shouldn;t there be some note about the
to-be-used defaults ?

Guenter

> 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>;
> };

2022-08-22 13:31:52

by Farber, Eliav

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

On 8/18/2022 11:25 PM, Guenter Roeck wrote:
> On Wed, Aug 17, 2022 at 05:43:18AM +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.
>>
> Vendor prefix again, and shouldn;t there be some note about the
> to-be-used defaults ?
Can you please explain why to add a vendor prefix to these properties
(and also to all other properties I added in this series)?
All the properties I added are not specific to our SOC, and any other
vendor using the same mr75203 ip block in their SOC, can also use the new
properties.

Regarding defaults, these properties are optional, so if they are absent
in device tree, the current defaults in code are used.

--
Thanks, Eliav

2022-08-22 16:33:54

by Guenter Roeck

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

On Mon, Aug 22, 2022 at 04:24:20PM +0300, Farber, Eliav wrote:
> On 8/18/2022 11:25 PM, Guenter Roeck wrote:
> > On Wed, Aug 17, 2022 at 05:43:18AM +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.
> > >
> > Vendor prefix again, and shouldn;t there be some note about the
> > to-be-used defaults ?
> Can you please explain why to add a vendor prefix to these properties
> (and also to all other properties I added in this series)?
> All the properties I added are not specific to our SOC, and any other
> vendor using the same mr75203 ip block in their SOC, can also use the new
> properties.

To me it seems that the properties are very mr75203 and thus vendor
specific.

However, I am not a DT maintainer. Stepping back to let DT maintainers
respond and state their preferences.

>
> Regarding defaults, these properties are optional, so if they are absent
> in device tree, the current defaults in code are used.
>
Same as before. Question was if DT should say what the defaults are.
I'll leave it up to DT maintainers.

Thanks,
Guenter

2022-08-29 19:05:06

by Farber, Eliav

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

On 8/22/2022 7:25 PM, Guenter Roeck wrote:
> On Mon, Aug 22, 2022 at 04:24:20PM +0300, Farber, Eliav wrote:
>> On 8/18/2022 11:25 PM, Guenter Roeck wrote:
>> > On Wed, Aug 17, 2022 at 05:43:18AM +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.
>> > >
>> > Vendor prefix again, and shouldn;t there be some note about the
>> > to-be-used defaults ?
>> Can you please explain why to add a vendor prefix to these properties
>> (and also to all other properties I added in this series)?
>> All the properties I added are not specific to our SOC, and any other
>> vendor using the same mr75203 ip block in their SOC, can also use the
>> new
>> properties.
>
> To me it seems that the properties are very mr75203 and thus vendor
> specific.
>
> However, I am not a DT maintainer. Stepping back to let DT maintainers
> respond and state their preferences.

I added "moortec" prefix to all the new properties I added in this
series.
Will be part of v3.

--
Thanks, Eliav