1
1
openwrt/target/linux/realtek/dts/rtl9313_zyxel_xs1930.dtsi
Jonas Jelonek 161a871edd realtek: wire up GPIO fan for Zyxel XS1930 switches
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>
2026-05-21 12:08:41 +02:00

175 lines
3.3 KiB
Plaintext

// SPDX-License-Identifier: GPL-2.0-or-later
/dts-v1/;
#include "rtl931x.dtsi"
#include <dt-bindings/input/input.h>
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/leds/common.h>
#include <dt-bindings/mux/mux.h>
/ {
aliases {
label-mac-device = &ethernet0;
led-boot = &led_sys_green;
led-failsafe = &led_sys_red;
led-running = &led_sys_green;
led-upgrade = &led_sys_green;
};
chosen {
bootargs = "console=ttyS0,115200 earlycon";
};
memory@0 {
device_type = "memory";
reg = <0x00000000 0x10000000>;
};
keys {
compatible = "gpio-keys";
key-restore {
label = "restore";
gpios = <&gpio0 28 GPIO_ACTIVE_LOW>;
linux,code = <KEY_RESTART>;
};
};
leds: leds {
compatible = "gpio-leds";
pinctrl-names = "default";
pinctrl-0 = <&pinmux_disable_sys_led>;
led_sys_green: led-0 {
color = <LED_COLOR_ID_GREEN>;
function = LED_FUNCTION_INDICATOR;
gpios = <&gpio0 0 GPIO_ACTIVE_HIGH>;
};
led_sys_red: led-1 {
color = <LED_COLOR_ID_RED>;
function = LED_FUNCTION_INDICATOR;
gpios = <&gpio0 30 GPIO_ACTIVE_HIGH>;
};
led_pwr_green: led-2 {
color = <LED_COLOR_ID_GREEN>;
function = LED_FUNCTION_POWER;
gpios = <&gpio0 20 GPIO_ACTIVE_HIGH>;
default-state = "on";
};
led_pwr_red: led-3 {
color = <LED_COLOR_ID_RED>;
function = LED_FUNCTION_POWER;
gpios = <&gpio0 21 GPIO_ACTIVE_LOW>;
};
led_cloud_green: led-4 {
color = <LED_COLOR_ID_GREEN>;
gpios = <&gpio0 24 GPIO_ACTIVE_LOW>;
};
led_cloud_red: led-5 {
color = <LED_COLOR_ID_RED>;
gpios = <&gpio0 25 GPIO_ACTIVE_LOW>;
};
led_locator: led-6 {
color = <LED_COLOR_ID_BLUE>;
function = LED_FUNCTION_INDICATOR;
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 {
status = "okay";
flash@0 {
compatible = "jedec,spi-nor";
reg = <0>;
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
partition@0 {
label = "BootBase";
reg = <0x0 0xa0000>;
read-only;
nvmem-layout {
compatible = "fixed-layout";
#address-cells = <1>;
#size-cells = <1>;
factory_macaddr: macaddr@9fff8 {
reg = <0x9fff8 0x6>;
};
};
};
/* DbgArea */
partition@a0000 {
label = "reserved";
reg = <0xa0000 0x20000>;
read-only;
};
partition@c0000 {
label = "RomDir2";
reg = <0xc0000 0x120000>;
read-only;
/* boot image index at offset 0x151 */
nvmem-layout {
compatible = "fixed-layout";
#address-cells = <1>;
#size-cells = <1>;
boot_selector: boot-selector@151 {
reg = <0x151 0x1>;
};
};
};
/* BootBase has dual-image support. Second partition starts at
* 0x1280000 and has same layout as first partition but smaller size
*/
partition@280000 {
reg = <0x280000 0x1d80000>;
label = "factory";
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
partition@0 {
label = "loader";
reg = <0x0 0x10000>;
};
partition@10000 {
label = "firmware";
reg = <0x10000 0x1d70000>;
compatible = "openwrt,uimage", "denx,uimage";
};
};
};
};
};
&ethernet0 {
nvmem-cells = <&factory_macaddr 0>;
nvmem-cell-names = "mac-address";
};