xref: /OK3568_Linux_fs/kernel/Documentation/devicetree/bindings/hwmon/gpio-fan.txt (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593SmuzhiyunBindings for fan connected to GPIO lines
2*4882a593Smuzhiyun
3*4882a593SmuzhiyunRequired properties:
4*4882a593Smuzhiyun- compatible : "gpio-fan"
5*4882a593Smuzhiyun
6*4882a593SmuzhiyunOptional properties:
7*4882a593Smuzhiyun- gpios: Specifies the pins that map to bits in the control value,
8*4882a593Smuzhiyun  ordered MSB-->LSB.
9*4882a593Smuzhiyun- gpio-fan,speed-map: A mapping of possible fan RPM speeds and the
10*4882a593Smuzhiyun  control value that should be set to achieve them. This array
11*4882a593Smuzhiyun  must have the RPM values in ascending order.
12*4882a593Smuzhiyun- alarm-gpios: This pin going active indicates something is wrong with
13*4882a593Smuzhiyun  the fan, and a udev event will be fired.
14*4882a593Smuzhiyun- #cooling-cells: If used as a cooling device, must be <2>
15*4882a593Smuzhiyun  Also see:
16*4882a593Smuzhiyun  Documentation/devicetree/bindings/thermal/thermal-cooling-devices.yaml
17*4882a593Smuzhiyun  min and max states are derived from the speed-map of the fan.
18*4882a593Smuzhiyun
19*4882a593SmuzhiyunNote: At least one the "gpios" or "alarm-gpios" properties must be set.
20*4882a593Smuzhiyun
21*4882a593SmuzhiyunExamples:
22*4882a593Smuzhiyun
23*4882a593Smuzhiyun	gpio_fan {
24*4882a593Smuzhiyun		compatible = "gpio-fan";
25*4882a593Smuzhiyun		gpios = <&gpio1 14 1
26*4882a593Smuzhiyun			 &gpio1 13 1>;
27*4882a593Smuzhiyun		gpio-fan,speed-map = <0    0
28*4882a593Smuzhiyun				      3000 1
29*4882a593Smuzhiyun				      6000 2>;
30*4882a593Smuzhiyun		alarm-gpios = <&gpio1 15 1>;
31*4882a593Smuzhiyun	};
32*4882a593Smuzhiyun	gpio_fan_cool: gpio_fan {
33*4882a593Smuzhiyun		compatible = "gpio-fan";
34*4882a593Smuzhiyun		gpios = <&gpio2 14 1
35*4882a593Smuzhiyun			 &gpio2 13 1>;
36*4882a593Smuzhiyun		gpio-fan,speed-map =	<0    0>,
37*4882a593Smuzhiyun					<3000 1>,
38*4882a593Smuzhiyun					<6000 2>;
39*4882a593Smuzhiyun		alarm-gpios = <&gpio2 15 1>;
40*4882a593Smuzhiyun		#cooling-cells = <2>; /* min followed by max */
41*4882a593Smuzhiyun	};
42