xref: /linux/Documentation/devicetree/bindings/hwmon/pwm-fan.yaml (revision 7f71507851fc7764b36a3221839607d3a45c2025)
1# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/hwmon/pwm-fan.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: Fan connected to PWM lines
8
9maintainers:
10  - Jean Delvare <jdelvare@suse.com>
11  - Guenter Roeck <linux@roeck-us.net>
12
13properties:
14  compatible:
15    const: pwm-fan
16
17  cooling-levels:
18    description: PWM duty cycle values corresponding to thermal cooling states.
19    $ref: /schemas/types.yaml#/definitions/uint32-array
20    items:
21      maximum: 255
22
23  fan-supply:
24    description: Phandle to the regulator that provides power to the fan.
25
26  interrupts:
27    description:
28      This contains an interrupt specifier for each fan tachometer output
29      connected to an interrupt source. The output signal must generate a
30      defined number of interrupts per fan revolution, which require that
31      it must be self resetting edge interrupts.
32    maxItems: 1
33
34  fan-stop-to-start-percent:
35    description:
36      Minimum fan RPM in percent to start when stopped.
37    minimum: 0
38    maximum: 100
39
40  fan-stop-to-start-us:
41    description:
42      Time to wait in microseconds after start when stopped.
43
44  pulses-per-revolution:
45    description:
46      Define the number of pulses per fan revolution for each tachometer
47      input as an integer.
48    $ref: /schemas/types.yaml#/definitions/uint32
49    minimum: 1
50    maximum: 4
51    default: 2
52
53  pwms:
54    description: The PWM that is used to control the fan.
55    maxItems: 1
56
57  "#cooling-cells": true
58
59required:
60  - compatible
61  - pwms
62
63additionalProperties: false
64
65examples:
66  - |
67    pwm-fan {
68      compatible = "pwm-fan";
69      cooling-levels = <0 102 170 230>;
70      pwms = <&pwm 0 10000 0>;
71      #cooling-cells = <2>;
72    };
73
74    thermal-zones {
75      cpu_thermal: cpu-thermal {
76        thermal-sensors = <&tmu 0>;
77        polling-delay-passive = <0>;
78        polling-delay = <0>;
79
80        trips {
81          cpu_alert1: cpu-alert1 {
82            temperature = <100000>; /* millicelsius */
83            hysteresis = <2000>; /* millicelsius */
84            type = "passive";
85          };
86        };
87
88        cooling-maps {
89          map0 {
90            trip = <&cpu_alert1>;
91            cooling-device = <&fan0 0 1>;
92          };
93        };
94      };
95    };
96
97  - |
98    #include <dt-bindings/interrupt-controller/irq.h>
99
100    pwm-fan {
101      compatible = "pwm-fan";
102      pwms = <&pwm 0 40000 0>;
103      fan-supply = <&reg_fan>;
104      interrupt-parent = <&gpio5>;
105      interrupts = <1 IRQ_TYPE_EDGE_FALLING>;
106      pulses-per-revolution = <2>;
107    };
108