diff mbox series

[v2,13/16] hwmon: (mr75203) add thermal coefficient properties for Moortec PVT controller

Message ID 20220817054321.6519-14-farbere@amazon.com (mailing list archive)
State Changes Requested
Headers show
Series Variety of fixes and new features for mr75203 driver | expand

Commit Message

Farber, Eliav Aug. 17, 2022, 5:43 a.m. UTC
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 <farbere@amazon.com>
---
 .../bindings/hwmon/moortec,mr75203.yaml       | 33 +++++++++++++++++++
 1 file changed, 33 insertions(+)

Comments

Guenter Roeck Aug. 18, 2022, 8:25 p.m. UTC | #1
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 <farbere@amazon.com>
> ---
>  .../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>;
>      };
Farber, Eliav Aug. 22, 2022, 1:24 p.m. UTC | #2
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
Guenter Roeck Aug. 22, 2022, 4:25 p.m. UTC | #3
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
Farber, Eliav Aug. 29, 2022, 6:46 p.m. UTC | #4
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
diff mbox series

Patch

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