xref: /linux/Documentation/devicetree/bindings/hwmon/pwm-fan.yaml (revision 55a42f78ffd386e01a5404419f8c5ded7db70a21)
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-shutdown-percent:
35    description:
36      Fan RPM in percent set during shutdown. This is used to keep the fan
37      running at fixed RPM after the kernel shut down, which is useful on
38      hardware that does keep heating itself even after the kernel did shut
39      down, for example from some sort of management core.
40    minimum: 0
41    maximum: 100
42
43  fan-stop-to-start-percent:
44    description:
45      Minimum fan RPM in percent to start when stopped.
46    minimum: 0
47    maximum: 100
48
49  fan-stop-to-start-us:
50    description:
51      Time to wait in microseconds after start when stopped.
52
53  pulses-per-revolution:
54    description:
55      Define the number of pulses per fan revolution for each tachometer
56      input as an integer.
57    $ref: /schemas/types.yaml#/definitions/uint32
58    minimum: 1
59    maximum: 4
60    default: 2
61
62  pwms:
63    description: The PWM that is used to control the fan.
64    maxItems: 1
65
66  "#cooling-cells": true
67
68required:
69  - compatible
70  - pwms
71
72additionalProperties: false
73
74examples:
75  - |
76    pwm-fan {
77      compatible = "pwm-fan";
78      cooling-levels = <0 102 170 230>;
79      pwms = <&pwm 0 10000 0>;
80      #cooling-cells = <2>;
81    };
82
83    thermal-zones {
84      cpu_thermal: cpu-thermal {
85        thermal-sensors = <&tmu 0>;
86        polling-delay-passive = <0>;
87        polling-delay = <0>;
88
89        trips {
90          cpu_alert1: cpu-alert1 {
91            temperature = <100000>; /* millicelsius */
92            hysteresis = <2000>; /* millicelsius */
93            type = "passive";
94          };
95        };
96
97        cooling-maps {
98          map0 {
99            trip = <&cpu_alert1>;
100            cooling-device = <&fan0 0 1>;
101          };
102        };
103      };
104    };
105
106  - |
107    #include <dt-bindings/interrupt-controller/irq.h>
108
109    pwm-fan {
110      compatible = "pwm-fan";
111      pwms = <&pwm 0 40000 0>;
112      fan-supply = <&reg_fan>;
113      interrupt-parent = <&gpio5>;
114      interrupts = <1 IRQ_TYPE_EDGE_FALLING>;
115      pulses-per-revolution = <2>;
116    };
117