diff mbox series

[v5,16/21] dt-bindings: hwmon: (mr75203) add "moortec,ts-series" property

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

Commit Message

Farber, Eliav Sept. 8, 2022, 3:24 p.m. UTC
Add optional "moortec,ts-series" property to define the temperature
equation and coefficients that shall be used to convert the digital
output to value in milli-Celsius.
Supported series: 5 (default) and 6.

Series 5:
  T = G + H * (n / cal5 - 0.5) + J * F
Where: G = 60, H = 200, cal5 = 4094, J = -0.1, F = frequency clock in MHz

Series 6:
   T = G + H * (n / cal5 - 0.5)
Where: G = 57.4, H = 249.4, cal5 = 4096

Signed-off-by: Eliav Farber <farbere@amazon.com>
---
V4 -> V3:
- Remove constraints in free-form text descriptions.

V3 -> V2:
- New patch to introduce "moortec,ts-series" property.

 .../devicetree/bindings/hwmon/moortec,mr75203.yaml       | 9 +++++++++
 1 file changed, 9 insertions(+)

Comments

Guenter Roeck Sept. 8, 2022, 7:02 p.m. UTC | #1
On Thu, Sep 08, 2022 at 03:24:44PM +0000, Eliav Farber wrote:
> Add optional "moortec,ts-series" property to define the temperature
> equation and coefficients that shall be used to convert the digital
> output to value in milli-Celsius.
> Supported series: 5 (default) and 6.
> 
> Series 5:
>   T = G + H * (n / cal5 - 0.5) + J * F
> Where: G = 60, H = 200, cal5 = 4094, J = -0.1, F = frequency clock in MHz
> 
> Series 6:
>    T = G + H * (n / cal5 - 0.5)
> Where: G = 57.4, H = 249.4, cal5 = 4096
> 
> Signed-off-by: Eliav Farber <farbere@amazon.com>
> ---
> V4 -> V3:
> - Remove constraints in free-form text descriptions.
> 
> V3 -> V2:
> - New patch to introduce "moortec,ts-series" property.
> 
>  .../devicetree/bindings/hwmon/moortec,mr75203.yaml       | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/hwmon/moortec,mr75203.yaml b/Documentation/devicetree/bindings/hwmon/moortec,mr75203.yaml
> index d6b03a6d7043..df849517464e 100644
> --- a/Documentation/devicetree/bindings/hwmon/moortec,mr75203.yaml
> +++ b/Documentation/devicetree/bindings/hwmon/moortec,mr75203.yaml
> @@ -91,6 +91,15 @@ properties:
>        Each channel should not appear more than once.
>      $ref: /schemas/types.yaml#/definitions/uint8-array
>  
> +  moortec,ts-series:
> +    description:
> +      Definition of the temperature equation and coefficients that shall be
> +      used to convert the digital output to value in milli-Celsius.
> +    minimum: 5
> +    maximum: 6
> +    default: 5
> +    $ref: /schemas/types.yaml#/definitions/uint32
> +

I am not a dt expert, but I wonder if this should be handled
with different "compatible" properties. Sorry if this was already
addressed and I missed it.

Thanks,
Guenter
Farber, Eliav Sept. 8, 2022, 8:18 p.m. UTC | #2
On 9/8/2022 10:02 PM, Guenter Roeck wrote:
> On Thu, Sep 08, 2022 at 03:24:44PM +0000, Eliav Farber wrote:
>> Add optional "moortec,ts-series" property to define the temperature
>> equation and coefficients that shall be used to convert the digital
>> output to value in milli-Celsius.
>> Supported series: 5 (default) and 6.
>>
>> Series 5:
>>   T = G + H * (n / cal5 - 0.5) + J * F
>> Where: G = 60, H = 200, cal5 = 4094, J = -0.1, F = frequency clock in 
>> MHz
>>
>> Series 6:
>>    T = G + H * (n / cal5 - 0.5)
>> Where: G = 57.4, H = 249.4, cal5 = 4096
>>
>> Signed-off-by: Eliav Farber <farbere@amazon.com>
>> ---
>> V4 -> V3:
>> - Remove constraints in free-form text descriptions.
>>
>> V3 -> V2:
>> - New patch to introduce "moortec,ts-series" property.
>>
>>  .../devicetree/bindings/hwmon/moortec,mr75203.yaml       | 9 +++++++++
>>  1 file changed, 9 insertions(+)
>>
>> diff --git 
>> a/Documentation/devicetree/bindings/hwmon/moortec,mr75203.yaml 
>> b/Documentation/devicetree/bindings/hwmon/moortec,mr75203.yaml
>> index d6b03a6d7043..df849517464e 100644
>> --- a/Documentation/devicetree/bindings/hwmon/moortec,mr75203.yaml
>> +++ b/Documentation/devicetree/bindings/hwmon/moortec,mr75203.yaml
>> @@ -91,6 +91,15 @@ properties:
>>        Each channel should not appear more than once.
>>      $ref: /schemas/types.yaml#/definitions/uint8-array
>>
>> +  moortec,ts-series:
>> +    description:
>> +      Definition of the temperature equation and coefficients that 
>> shall be
>> +      used to convert the digital output to value in milli-Celsius.
>> +    minimum: 5
>> +    maximum: 6
>> +    default: 5
>> +    $ref: /schemas/types.yaml#/definitions/uint32
>> +
>
> I am not a dt expert, but I wonder if this should be handled
> with different "compatible" properties. Sorry if this was already
> addressed and I missed it.

It was already addressed in [PATCH v3 14/19] by Philipp.
It is indeed confusing which is why I added a detailed description
to moortec,mr75203.yaml in [PATCH v5 07/21].
Shortly, the driver is for the controller unit (mr75203), while the
"series" is a parameter of the temperature unit (mr74137).
Therefore I added a new TS property and not a different compatible.

--
Regards, Eliav
Guenter Roeck Sept. 8, 2022, 8:22 p.m. UTC | #3
On 9/8/22 13:18, Farber, Eliav wrote:
> On 9/8/2022 10:02 PM, Guenter Roeck wrote:
>> On Thu, Sep 08, 2022 at 03:24:44PM +0000, Eliav Farber wrote:
>>> Add optional "moortec,ts-series" property to define the temperature
>>> equation and coefficients that shall be used to convert the digital
>>> output to value in milli-Celsius.
>>> Supported series: 5 (default) and 6.
>>>
>>> Series 5:
>>>   T = G + H * (n / cal5 - 0.5) + J * F
>>> Where: G = 60, H = 200, cal5 = 4094, J = -0.1, F = frequency clock in MHz
>>>
>>> Series 6:
>>>    T = G + H * (n / cal5 - 0.5)
>>> Where: G = 57.4, H = 249.4, cal5 = 4096
>>>
>>> Signed-off-by: Eliav Farber <farbere@amazon.com>
>>> ---
>>> V4 -> V3:
>>> - Remove constraints in free-form text descriptions.
>>>
>>> V3 -> V2:
>>> - New patch to introduce "moortec,ts-series" property.
>>>
>>>  .../devicetree/bindings/hwmon/moortec,mr75203.yaml       | 9 +++++++++
>>>  1 file changed, 9 insertions(+)
>>>
>>> diff --git a/Documentation/devicetree/bindings/hwmon/moortec,mr75203.yaml b/Documentation/devicetree/bindings/hwmon/moortec,mr75203.yaml
>>> index d6b03a6d7043..df849517464e 100644
>>> --- a/Documentation/devicetree/bindings/hwmon/moortec,mr75203.yaml
>>> +++ b/Documentation/devicetree/bindings/hwmon/moortec,mr75203.yaml
>>> @@ -91,6 +91,15 @@ properties:
>>>        Each channel should not appear more than once.
>>>      $ref: /schemas/types.yaml#/definitions/uint8-array
>>>
>>> +  moortec,ts-series:
>>> +    description:
>>> +      Definition of the temperature equation and coefficients that shall be
>>> +      used to convert the digital output to value in milli-Celsius.
>>> +    minimum: 5
>>> +    maximum: 6
>>> +    default: 5
>>> +    $ref: /schemas/types.yaml#/definitions/uint32
>>> +
>>
>> I am not a dt expert, but I wonder if this should be handled
>> with different "compatible" properties. Sorry if this was already
>> addressed and I missed it.
> 
> It was already addressed in [PATCH v3 14/19] by Philipp.
> It is indeed confusing which is why I added a detailed description
> to moortec,mr75203.yaml in [PATCH v5 07/21].
> Shortly, the driver is for the controller unit (mr75203), while the
> "series" is a parameter of the temperature unit (mr74137).
> Therefore I added a new TS property and not a different compatible.
> 

Thanks a lot for the clarification.

Guenter
Rob Herring (Arm) Sept. 13, 2022, 11:57 a.m. UTC | #4
On Thu, 08 Sep 2022 15:24:44 +0000, Eliav Farber wrote:
> Add optional "moortec,ts-series" property to define the temperature
> equation and coefficients that shall be used to convert the digital
> output to value in milli-Celsius.
> Supported series: 5 (default) and 6.
> 
> Series 5:
>   T = G + H * (n / cal5 - 0.5) + J * F
> Where: G = 60, H = 200, cal5 = 4094, J = -0.1, F = frequency clock in MHz
> 
> Series 6:
>    T = G + H * (n / cal5 - 0.5)
> Where: G = 57.4, H = 249.4, cal5 = 4096
> 
> Signed-off-by: Eliav Farber <farbere@amazon.com>
> ---
> V4 -> V3:
> - Remove constraints in free-form text descriptions.
> 
> V3 -> V2:
> - New patch to introduce "moortec,ts-series" property.
> 
>  .../devicetree/bindings/hwmon/moortec,mr75203.yaml       | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 

Reviewed-by: Rob Herring <robh@kernel.org>
Guenter Roeck Sept. 19, 2022, 1:18 p.m. UTC | #5
On Thu, Sep 08, 2022 at 03:24:44PM +0000, Eliav Farber wrote:
> Add optional "moortec,ts-series" property to define the temperature
> equation and coefficients that shall be used to convert the digital
> output to value in milli-Celsius.
> Supported series: 5 (default) and 6.
> 
> Series 5:
>   T = G + H * (n / cal5 - 0.5) + J * F
> Where: G = 60, H = 200, cal5 = 4094, J = -0.1, F = frequency clock in MHz
> 
> Series 6:
>    T = G + H * (n / cal5 - 0.5)
> Where: G = 57.4, H = 249.4, cal5 = 4096
> 
> Signed-off-by: Eliav Farber <farbere@amazon.com>
> Reviewed-by: Rob Herring <robh@kernel.org>

Applied to hwmon-next.

Thanks,
Guenter
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/hwmon/moortec,mr75203.yaml b/Documentation/devicetree/bindings/hwmon/moortec,mr75203.yaml
index d6b03a6d7043..df849517464e 100644
--- a/Documentation/devicetree/bindings/hwmon/moortec,mr75203.yaml
+++ b/Documentation/devicetree/bindings/hwmon/moortec,mr75203.yaml
@@ -91,6 +91,15 @@  properties:
       Each channel should not appear more than once.
     $ref: /schemas/types.yaml#/definitions/uint8-array
 
+  moortec,ts-series:
+    description:
+      Definition of the temperature equation and coefficients that shall be
+      used to convert the digital output to value in milli-Celsius.
+    minimum: 5
+    maximum: 6
+    default: 5
+    $ref: /schemas/types.yaml#/definitions/uint32
+
 required:
   - compatible
   - reg