[PATCH v4 1/2] dt-bindings: hwmon: amc6821: add fan and PWM output

Francesco Dolcini posted 2 patches 8 months, 2 weeks ago
[PATCH v4 1/2] dt-bindings: hwmon: amc6821: add fan and PWM output
Posted by Francesco Dolcini 8 months, 2 weeks ago
From: Francesco Dolcini <francesco.dolcini@toradex.com>

Add properties to describe the fan and the PWM controller output.

Link: https://www.ti.com/lit/gpn/amc6821
Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
---
v4:
 - add #pwm-cells description
 - remove useless first #pwm-cells, that was supposed to be the instance
   number
v3: https://lore.kernel.org/all/20250331155229.147879-2-francesco@dolcini.it/
 - explicitly describe the fan, use standard PWM and FAN bindings
 - pwm.yaml cannot be referenced, because of the $nodename pattern that is
   enforced there
v2: https://lore.kernel.org/all/20250224180801.128685-2-francesco@dolcini.it/
 - no changes
v1: https://lore.kernel.org/all/20250218165633.106867-2-francesco@dolcini.it/
---
 .../devicetree/bindings/hwmon/ti,amc6821.yaml  | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/hwmon/ti,amc6821.yaml b/Documentation/devicetree/bindings/hwmon/ti,amc6821.yaml
index 5d33f1a23d03..9ca7356760a7 100644
--- a/Documentation/devicetree/bindings/hwmon/ti,amc6821.yaml
+++ b/Documentation/devicetree/bindings/hwmon/ti,amc6821.yaml
@@ -28,6 +28,17 @@ properties:
   i2c-mux:
     type: object
 
+  fan:
+    $ref: fan-common.yaml#
+    unevaluatedProperties: false
+
+  "#pwm-cells":
+    const: 2
+    description: |
+      Number of cells in a PWM specifier.
+      - cell 0: PWM period in nanoseconds
+      - cell 1: PWM polarity: 0 or PWM_POLARITY_INVERTED
+
 required:
   - compatible
   - reg
@@ -50,9 +61,14 @@ examples:
         #address-cells = <1>;
         #size-cells = <0>;
 
-        fan@18 {
+        fan_controller: fan@18 {
             compatible = "ti,amc6821";
             reg = <0x18>;
+            #pwm-cells = <2>;
+
+            fan {
+                pwms = <&fan_controller 40000 0>;
+            };
         };
     };
 
-- 
2.39.5
Re: [PATCH v4 1/2] dt-bindings: hwmon: amc6821: add fan and PWM output
Posted by Guenter Roeck 8 months, 2 weeks ago
On Wed, Apr 02, 2025 at 12:21:45PM +0200, Francesco Dolcini wrote:
> From: Francesco Dolcini <francesco.dolcini@toradex.com>
> 
> Add properties to describe the fan and the PWM controller output.
> 
> Link: https://www.ti.com/lit/gpn/amc6821
> Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
> Reviewed-by: Rob Herring (Arm) <robh@kernel.org>

Applied to hwmon-next.

Thanks,
Guenter
Re: [PATCH v4 1/2] dt-bindings: hwmon: amc6821: add fan and PWM output
Posted by Rob Herring (Arm) 8 months, 2 weeks ago
On Wed, 02 Apr 2025 12:21:45 +0200, Francesco Dolcini wrote:
> From: Francesco Dolcini <francesco.dolcini@toradex.com>
> 
> Add properties to describe the fan and the PWM controller output.
> 
> Link: https://www.ti.com/lit/gpn/amc6821
> Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
> ---
> v4:
>  - add #pwm-cells description
>  - remove useless first #pwm-cells, that was supposed to be the instance
>    number
> v3: https://lore.kernel.org/all/20250331155229.147879-2-francesco@dolcini.it/
>  - explicitly describe the fan, use standard PWM and FAN bindings
>  - pwm.yaml cannot be referenced, because of the $nodename pattern that is
>    enforced there
> v2: https://lore.kernel.org/all/20250224180801.128685-2-francesco@dolcini.it/
>  - no changes
> v1: https://lore.kernel.org/all/20250218165633.106867-2-francesco@dolcini.it/
> ---
>  .../devicetree/bindings/hwmon/ti,amc6821.yaml  | 18 +++++++++++++++++-
>  1 file changed, 17 insertions(+), 1 deletion(-)
> 

Reviewed-by: Rob Herring (Arm) <robh@kernel.org>