]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
realtek: wire up GPIO fan for Zyxel XS1930 switches
authorJonas Jelonek <jelonek.jonas@gmail.com>
Sun, 17 May 2026 22:02:19 +0000 (22:02 +0000)
committerRobert Marko <robimarko@gmail.com>
Thu, 21 May 2026 10:08:41 +0000 (12:08 +0200)
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>
target/linux/realtek/dts/rtl9313_zyxel_xs1930-12f.dts
target/linux/realtek/dts/rtl9313_zyxel_xs1930.dtsi
target/linux/realtek/image/rtl931x.mk

index 34d412b724afbc519282582b6dc634288a965da1..a058f6f0b5d3943e80d218db279aad093c2b927a 100644 (file)
        };
 };
 
+&fan0 { gpios = <&gpio1 35 GPIO_ACTIVE_HIGH>; };
+
 &gpio0 {
        pinctrl-names = "default";
        pinctrl-0 = <&pinmux_disable_jtag>,
index a594f42d97d451890f2eafe82053aa4b55db0b17..ef8c70f26d2bf40ebbe3948c394fd027a94e8175 100644 (file)
                        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 {
index a824376b0fd962ecc751ca35bfea9fc318dd42e1..865ef551a9fa6ebd12b04f6b4f00867195a10b72 100644 (file)
@@ -49,7 +49,7 @@ TARGET_DEVICES += xikestor_sks8300-12x-v1
 
 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