devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4 1/2] dt-bindings: hwmon: pwm-fan: Document default-pwm property
@ 2025-01-03 10:14 Peter Korsgaard
  2025-01-03 10:14 ` [PATCH v4 2/2] hwmon: (pwm-fan): Make default PWM duty cycle configurable Peter Korsgaard
  2025-01-03 19:58 ` [PATCH v4 1/2] dt-bindings: hwmon: pwm-fan: Document default-pwm property Rob Herring
  0 siblings, 2 replies; 12+ messages in thread
From: Peter Korsgaard @ 2025-01-03 10:14 UTC (permalink / raw)
  To: Guenter Roeck, devicetree, linux-hwmon
  Cc: Peter Korsgaard, Jean Delvare, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, open list

The pwm-fan driver uses full PWM (255) duty cycle at startup, which may not
always be desirable because of noise or power consumption peaks, so add an
optional "default-pwm" property that can be used to specify a custom default
PWM duty cycle (0..255).

This is somewhat similar to target-rpm from fan-common.yaml, but that cannot
be used here as target-rpm specifies the target fan speed, whereas this is
the default pwm to set when the device is instantiated - And the resulting
fan RPM resulting from a given PWM duty cycle is fan dependent.

Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
---
Changes since v3:
 - Fix example syntax
 - Extend description of why target-rpm cannot be used

Changes since v2:
 - Recreated/resent

Changes since v1:
 - Rename to default-pwm

 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 8b4ed5ee962f..873c4c32e608 100644
--- a/Documentation/devicetree/bindings/hwmon/pwm-fan.yaml
+++ b/Documentation/devicetree/bindings/hwmon/pwm-fan.yaml
@@ -20,6 +20,13 @@ properties:
     items:
       maximum: 255
 
+  default-pwm:
+    description: Default PWM duty cycle value to use at startup
+    $ref: /schemas/types.yaml#/definitions/uint32
+    minimum: 0
+    maximum: 255
+    default: 255
+
   fan-supply:
     description: Phandle to the regulator that provides power to the fan.
 
@@ -100,6 +107,7 @@ examples:
     pwm-fan {
       compatible = "pwm-fan";
       pwms = <&pwm 0 40000 0>;
+      default-pwm = <75>;
       fan-supply = <&reg_fan>;
       interrupt-parent = <&gpio5>;
       interrupts = <1 IRQ_TYPE_EDGE_FALLING>;
-- 
2.39.5


^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2025-01-11 22:45 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-03 10:14 [PATCH v4 1/2] dt-bindings: hwmon: pwm-fan: Document default-pwm property Peter Korsgaard
2025-01-03 10:14 ` [PATCH v4 2/2] hwmon: (pwm-fan): Make default PWM duty cycle configurable Peter Korsgaard
2025-01-03 19:58 ` [PATCH v4 1/2] dt-bindings: hwmon: pwm-fan: Document default-pwm property Rob Herring
2025-01-05 16:10   ` Peter Korsgaard
2025-01-06 17:38     ` Rob Herring
2025-01-06 18:32       ` Guenter Roeck
2025-01-10 20:06       ` Peter Korsgaard
2025-01-11 17:15         ` Guenter Roeck
2025-01-11 18:24           ` Peter Korsgaard
2025-01-11 22:45             ` Guenter Roeck
2025-01-05 16:42   ` Guenter Roeck
2025-01-05 17:22   ` Guenter Roeck

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).