Linux Hardware Monitor development
 help / color / mirror / Atom feed
* [PATCH 1/6] dt-bindings: hwmon: sparx5: add LAN969x fan controller
@ 2026-10-13 12:56 Robert Marko
  2026-10-13 12:56 ` [PATCH 2/6] hwmon: sparx5: separate temperature reading from sensor dispatch Robert Marko
                   ` (6 more replies)
  0 siblings, 7 replies; 16+ messages in thread
From: Robert Marko @ 2026-10-13 12:56 UTC (permalink / raw)
  To: linux, robh, krzk+dt, conor+dt, Steen.Hegelund, daniel.machon,
	UNGLinuxDriver, nicolas.ferre, claudiu.beznea, lars.povlsen,
	linux-hwmon, devicetree, linux-arm-kernel, linux-kernel
  Cc: luka.perkov, Robert Marko

LAN969x integrates a PWM fan controller with a tachometer input in
addition to the Sparx5-compatible temperature sensor. Add a LAN969x
hardware-monitor compatible and describe the second register region.

Describe the fan as a child node using a two-cell PWM specifier for the
period and standard polarity flags. The child also carries the optional
tachometer pulses-per-revolution and thermal cooling properties.

Keep the existing microchip,lan9691-temp compatible for device tree ABI
compatibility.

Signed-off-by: Robert Marko <robert.marko@sartura.hr>
---
 .../bindings/hwmon/microchip,sparx5-temp.yaml | 90 ++++++++++++++++++-
 1 file changed, 87 insertions(+), 3 deletions(-)

diff --git a/Documentation/devicetree/bindings/hwmon/microchip,sparx5-temp.yaml b/Documentation/devicetree/bindings/hwmon/microchip,sparx5-temp.yaml
index 611fcadb1e771..e91c2a3ccd3c9 100644
--- a/Documentation/devicetree/bindings/hwmon/microchip,sparx5-temp.yaml
+++ b/Documentation/devicetree/bindings/hwmon/microchip,sparx5-temp.yaml
@@ -4,13 +4,15 @@
 $id: http://devicetree.org/schemas/hwmon/microchip,sparx5-temp.yaml#
 $schema: http://devicetree.org/meta-schemas/core.yaml#
 
-title: Microchip Sparx5 Temperature Monitor
+title: Microchip Sparx5 Hardware Monitor
 
 maintainers:
   - Lars Povlsen <lars.povlsen@microchip.com>
 
 description: |
-  Microchip Sparx5 embedded temperature monitor
+  Microchip Sparx5 temperature monitor with a fan controller on LAN969x.
+  The fan child's pwms property references this node to specify the
+  PWM period and polarity.
 
 properties:
   compatible:
@@ -18,11 +20,19 @@ properties:
       - const: microchip,sparx5-temp
       - items:
           - enum:
+              - microchip,lan9691-hwmon
               - microchip,lan9691-temp
           - const: microchip,sparx5-temp
 
   reg:
-    maxItems: 1
+    minItems: 1
+    maxItems: 2
+
+  reg-names:
+    minItems: 1
+    items:
+      - const: temp
+      - const: fan
 
   clocks:
     items:
@@ -31,11 +41,67 @@ properties:
   '#thermal-sensor-cells':
     const: 0
 
+  '#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
+
+  fan:
+    $ref: fan-common.yaml#
+    unevaluatedProperties: false
+
+    properties:
+      cooling-levels:
+        description:
+          PWM duty-cycle values corresponding to thermal cooling states.
+        items:
+          maximum: 255
+
+      pulses-per-revolution:
+        minimum: 1
+        maximum: 4
+        default: 2
+
+    required:
+      - pwms
+
+    dependencies:
+      '#cooling-cells':
+        - cooling-levels
+      cooling-levels:
+        - '#cooling-cells'
+
 required:
   - compatible
   - reg
   - clocks
 
+allOf:
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: microchip,lan9691-hwmon
+    then:
+      properties:
+        reg:
+          minItems: 2
+        reg-names:
+          minItems: 2
+      required:
+        - '#pwm-cells'
+        - reg-names
+    else:
+      properties:
+        '#pwm-cells': false
+        fan: false
+        reg:
+          maxItems: 1
+        reg-names:
+          maxItems: 1
+
 additionalProperties: false
 
 examples:
@@ -46,3 +112,21 @@ examples:
         #thermal-sensor-cells = <0>;
         clocks = <&sys_clk>;
     };
+
+  - |
+    #include <dt-bindings/pwm/pwm.h>
+
+    hwmon: hwmon@e2020100 {
+        compatible = "microchip,lan9691-hwmon", "microchip,sparx5-temp";
+        reg = <0xe2020100 0xc>, <0xe2010348 0xc>;
+        reg-names = "temp", "fan";
+        #pwm-cells = <2>;
+        #thermal-sensor-cells = <0>;
+        clocks = <&sys_clk>;
+
+        fan {
+            pwms = <&hwmon 40000 PWM_POLARITY_INVERTED>;
+            cooling-levels = <0 128 192 255>;
+            #cooling-cells = <2>;
+        };
+    };
-- 
2.56.0


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

end of thread, other threads:[~2026-10-13 17:31 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-13 12:56 [PATCH 1/6] dt-bindings: hwmon: sparx5: add LAN969x fan controller Robert Marko
2026-10-13 12:56 ` [PATCH 2/6] hwmon: sparx5: separate temperature reading from sensor dispatch Robert Marko
2026-10-13 13:02   ` sashiko-bot
2026-10-13 12:56 ` [PATCH 3/6] hwmon: sparx5: add LAN969x fan monitoring support Robert Marko
2026-10-13 13:02   ` sashiko-bot
2026-10-13 12:56 ` [PATCH 4/6] hwmon: sparx5: add LAN969x PWM support Robert Marko
2026-10-13 13:10   ` sashiko-bot
2026-10-13 12:56 ` [PATCH 5/6] hwmon: sparx5: register LAN969x fan as a cooling device Robert Marko
2026-10-13 13:12   ` sashiko-bot
2026-10-13 12:56 ` [PATCH 6/6] arm64: dts: microchip: lan969x: add fan controller Robert Marko
2026-10-13 13:03   ` sashiko-bot
2026-10-13 13:03 ` [PATCH 1/6] dt-bindings: hwmon: sparx5: add LAN969x " sashiko-bot
2026-10-13 16:30 ` Conor Dooley
2026-10-13 16:38   ` Conor Dooley
2026-10-13 17:08   ` Robert Marko
2026-10-13 17:31     ` Conor Dooley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox