The switches from Zyxels XS1930 have one or two fans in the case. They
might be controlled in a limited fashion. There's a single GPIO which -
depending on the state - drives the fan in slow or fast mode. Wire that
up as a device tree node to be able to control that in userspace.
XS1930-10 and XS1930-12HP use the same GPIO while XS1930-12F moves that
to one of its GPIO expanders. Also add 'kmod-hwmon-gpiofan' for all
three devices to be selected by default.
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/23428
Signed-off-by: Robert Marko <robimarko@gmail.com>
};
};
+&fan0 { gpios = <&gpio1 35 GPIO_ACTIVE_HIGH>; };
+
&gpio0 {
pinctrl-names = "default";
pinctrl-0 = <&pinmux_disable_jtag>,
gpios = <&gpio0 26 GPIO_ACTIVE_LOW>;
};
};
+
+ fan0: gpio-fan {
+ compatible = "gpio-fan";
+ gpios = <&gpio0 22 GPIO_ACTIVE_HIGH>;
+
+ gpio-fan,speed-map =
+ <3600 0>,
+ <9000 1>;
+ #cooling-cells = <2>;
+ };
};
&spi0 {
define Device/zyxel_xs1930
SOC := rtl9313
- DEVICE_PACKAGES := kmod-hwmon-lm85
+ DEVICE_PACKAGES := kmod-hwmon-lm85 kmod-hwmon-gpiofan
FLASH_ADDR := 0xb4280000
IMAGE_SIZE := 31808k
ZYNFW_ALIGN := 0x10000