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