xref: /OK3568_Linux_fs/kernel/Documentation/devicetree/bindings/hwmon/pwm-fan.txt (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593SmuzhiyunBindings for a fan connected to the PWM lines
2*4882a593Smuzhiyun
3*4882a593SmuzhiyunRequired properties:
4*4882a593Smuzhiyun- compatible	: "pwm-fan"
5*4882a593Smuzhiyun- pwms		: the PWM that is used to control the PWM fan
6*4882a593Smuzhiyun- cooling-levels      : PWM duty cycle values in a range from 0 to 255
7*4882a593Smuzhiyun			which correspond to thermal cooling states
8*4882a593Smuzhiyun
9*4882a593SmuzhiyunOptional properties:
10*4882a593Smuzhiyun- fan-supply		: phandle to the regulator that provides power to the fan
11*4882a593Smuzhiyun- interrupts		: This contains a single interrupt specifier which
12*4882a593Smuzhiyun			  describes the tachometer output of the fan as an
13*4882a593Smuzhiyun			  interrupt source. The output signal must generate a
14*4882a593Smuzhiyun			  defined number of interrupts per fan revolution, which
15*4882a593Smuzhiyun			  require that it must be self resetting edge interrupts.
16*4882a593Smuzhiyun			  See interrupt-controller/interrupts.txt for the format.
17*4882a593Smuzhiyun- pulses-per-revolution : define the tachometer pulses per fan revolution as
18*4882a593Smuzhiyun			  an integer (default is 2 interrupts per revolution).
19*4882a593Smuzhiyun			  The value must be greater than zero.
20*4882a593Smuzhiyun- rockchip,temp-trips	: The property is an array of 2-tuples items, and
21*4882a593Smuzhiyun			  each item consists of temperature in millicelsius and
22*4882a593Smuzhiyun			  pwm cooling state. This depends on CONFIG_ROCKCHIP_SYSTEM_MONITOR.
23*4882a593Smuzhiyun			  If add the property the fan cooling state will be changed
24*4882a593Smuzhiyun			  by system monitor. Otherwise, use the default thermal governor.
25*4882a593Smuzhiyun
26*4882a593SmuzhiyunExample:
27*4882a593Smuzhiyun	fan0: pwm-fan {
28*4882a593Smuzhiyun		compatible = "pwm-fan";
29*4882a593Smuzhiyun		#cooling-cells = <2>;
30*4882a593Smuzhiyun		pwms = <&pwm 0 10000 0>;
31*4882a593Smuzhiyun		cooling-levels = <0 102 170 230>;
32*4882a593Smuzhiyun	};
33*4882a593Smuzhiyun
34*4882a593Smuzhiyun	thermal-zones {
35*4882a593Smuzhiyun		cpu_thermal: cpu-thermal {
36*4882a593Smuzhiyun			     thermal-sensors = <&tmu 0>;
37*4882a593Smuzhiyun			     polling-delay-passive = <0>;
38*4882a593Smuzhiyun			     polling-delay = <0>;
39*4882a593Smuzhiyun			     trips {
40*4882a593Smuzhiyun					cpu_alert1: cpu-alert1 {
41*4882a593Smuzhiyun						    temperature = <100000>; /* millicelsius */
42*4882a593Smuzhiyun						    hysteresis = <2000>; /* millicelsius */
43*4882a593Smuzhiyun						    type = "passive";
44*4882a593Smuzhiyun					};
45*4882a593Smuzhiyun			     };
46*4882a593Smuzhiyun			     cooling-maps {
47*4882a593Smuzhiyun					map0 {
48*4882a593Smuzhiyun						    trip = <&cpu_alert1>;
49*4882a593Smuzhiyun						    cooling-device = <&fan0 0 1>;
50*4882a593Smuzhiyun					};
51*4882a593Smuzhiyun			     };
52*4882a593Smuzhiyun		};
53*4882a593Smuzhiyun
54*4882a593SmuzhiyunExample 2:
55*4882a593Smuzhiyun	fan0: pwm-fan {
56*4882a593Smuzhiyun		compatible = "pwm-fan";
57*4882a593Smuzhiyun		pwms = <&pwm 0 40000 0>;
58*4882a593Smuzhiyun		fan-supply = <&reg_fan>;
59*4882a593Smuzhiyun		interrupt-parent = <&gpio5>;
60*4882a593Smuzhiyun		interrupts = <1 IRQ_TYPE_EDGE_FALLING>;
61*4882a593Smuzhiyun		pulses-per-revolution = <2>;
62*4882a593Smuzhiyun	};
63