diff mbox series

[1/2] dt-bindings: hwmon: pwm-fan: Document target-pwm property

Message ID 20240424090453.2292185-1-peter@korsgaard.com (mailing list archive)
State Superseded
Headers show
Series [1/2] dt-bindings: hwmon: pwm-fan: Document target-pwm property | expand

Commit Message

Peter Korsgaard April 24, 2024, 9:04 a.m. UTC
Similar to target-rpm from fan-common.yaml but for the PWM setting
(0..255).

Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
---
 Documentation/devicetree/bindings/hwmon/pwm-fan.yaml | 8 ++++++++
 1 file changed, 8 insertions(+)

Comments

Guenter Roeck April 24, 2024, 2:10 p.m. UTC | #1
On 4/24/24 02:04, Peter Korsgaard wrote:
> Similar to target-rpm from fan-common.yaml but for the PWM setting
> (0..255).
> 
> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
> ---
>   Documentation/devicetree/bindings/hwmon/pwm-fan.yaml | 8 ++++++++
>   1 file changed, 8 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/hwmon/pwm-fan.yaml b/Documentation/devicetree/bindings/hwmon/pwm-fan.yaml
> index 4e5abf7580cc..58513ff732af 100644
> --- a/Documentation/devicetree/bindings/hwmon/pwm-fan.yaml
> +++ b/Documentation/devicetree/bindings/hwmon/pwm-fan.yaml
> @@ -46,6 +46,14 @@ properties:
>   
>     "#cooling-cells": true
>   
> +  target-pwm:
> +    description:
> +      The default desired fan PWM.

Unlike target-rpm, there is no "desired" here. If this is the default pwm,
to be set, name and describe it accordingly.

Guenter

> +    $ref: /schemas/types.yaml#/definitions/uint32
> +    minimum: 0
> +    maximum: 255
> +    default: 255
> +
>   required:
>     - compatible
>     - pwms
Peter Korsgaard April 24, 2024, 8:24 p.m. UTC | #2
On 24/04/2024 16.10, Guenter Roeck wrote:
> On 4/24/24 02:04, Peter Korsgaard wrote:
>> Similar to target-rpm from fan-common.yaml but for the PWM setting
>> (0..255).
>>
>> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
>> ---
>>   Documentation/devicetree/bindings/hwmon/pwm-fan.yaml | 8 ++++++++
>>   1 file changed, 8 insertions(+)
>>
>> diff --git a/Documentation/devicetree/bindings/hwmon/pwm-fan.yaml 
>> b/Documentation/devicetree/bindings/hwmon/pwm-fan.yaml
>> index 4e5abf7580cc..58513ff732af 100644
>> --- a/Documentation/devicetree/bindings/hwmon/pwm-fan.yaml
>> +++ b/Documentation/devicetree/bindings/hwmon/pwm-fan.yaml
>> @@ -46,6 +46,14 @@ properties:
>>     "#cooling-cells": true
>> +  target-pwm:
>> +    description:
>> +      The default desired fan PWM.
> 
> Unlike target-rpm, there is no "desired" here. If this is the default pwm,
> to be set, name and describe it accordingly.

OK, I will rename to default-pwm and send a v2 - Thanks.
Rob Herring (Arm) April 24, 2024, 10:04 p.m. UTC | #3
On Wed, Apr 24, 2024 at 11:04:52AM +0200, Peter Korsgaard wrote:
> Similar to target-rpm from fan-common.yaml but for the PWM setting
> (0..255).

IIRC, we have a map of RPMs to PWM duty cycle, so why can't you 
use that plus target-rpm?

Anything new for existing fan bindings should ideally use what 
fan-common.yaml defined or be added to it.

> 
> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
> ---
>  Documentation/devicetree/bindings/hwmon/pwm-fan.yaml | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/hwmon/pwm-fan.yaml b/Documentation/devicetree/bindings/hwmon/pwm-fan.yaml
> index 4e5abf7580cc..58513ff732af 100644
> --- a/Documentation/devicetree/bindings/hwmon/pwm-fan.yaml
> +++ b/Documentation/devicetree/bindings/hwmon/pwm-fan.yaml
> @@ -46,6 +46,14 @@ properties:
>  
>    "#cooling-cells": true
>  
> +  target-pwm:
> +    description:
> +      The default desired fan PWM.
> +    $ref: /schemas/types.yaml#/definitions/uint32
> +    minimum: 0
> +    maximum: 255
> +    default: 255
> +
>  required:
>    - compatible
>    - pwms
> -- 
> 2.39.2
>
Guenter Roeck April 24, 2024, 10:40 p.m. UTC | #4
On 4/24/24 15:04, Rob Herring wrote:
> On Wed, Apr 24, 2024 at 11:04:52AM +0200, Peter Korsgaard wrote:
>> Similar to target-rpm from fan-common.yaml but for the PWM setting
>> (0..255).
> 
> IIRC, we have a map of RPMs to PWM duty cycle, so why can't you
> use that plus target-rpm?
> 

target-rpm is the target fan speed. The property defined here
is the default pwm to set when the device is instantiated.

The two values are also orthogonal. The fan rpm is fan dependent.
Each fan will require a different pwm value to reach the target speed.
Trying to use target-rpm to set a default pwm value would really
not make much if any sense.

Guenter

> Anything new for existing fan bindings should ideally use what
> fan-common.yaml defined or be added to it.
> 
>>
>> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
>> ---
>>   Documentation/devicetree/bindings/hwmon/pwm-fan.yaml | 8 ++++++++
>>   1 file changed, 8 insertions(+)
>>
>> diff --git a/Documentation/devicetree/bindings/hwmon/pwm-fan.yaml b/Documentation/devicetree/bindings/hwmon/pwm-fan.yaml
>> index 4e5abf7580cc..58513ff732af 100644
>> --- a/Documentation/devicetree/bindings/hwmon/pwm-fan.yaml
>> +++ b/Documentation/devicetree/bindings/hwmon/pwm-fan.yaml
>> @@ -46,6 +46,14 @@ properties:
>>   
>>     "#cooling-cells": true
>>   
>> +  target-pwm:
>> +    description:
>> +      The default desired fan PWM.
>> +    $ref: /schemas/types.yaml#/definitions/uint32
>> +    minimum: 0
>> +    maximum: 255
>> +    default: 255
>> +
>>   required:
>>     - compatible
>>     - pwms
>> -- 
>> 2.39.2
>>
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/hwmon/pwm-fan.yaml b/Documentation/devicetree/bindings/hwmon/pwm-fan.yaml
index 4e5abf7580cc..58513ff732af 100644
--- a/Documentation/devicetree/bindings/hwmon/pwm-fan.yaml
+++ b/Documentation/devicetree/bindings/hwmon/pwm-fan.yaml
@@ -46,6 +46,14 @@  properties:
 
   "#cooling-cells": true
 
+  target-pwm:
+    description:
+      The default desired fan PWM.
+    $ref: /schemas/types.yaml#/definitions/uint32
+    minimum: 0
+    maximum: 255
+    default: 255
+
 required:
   - compatible
   - pwms