From d349945f825072aea9bd01ec4204efd5272f581d Mon Sep 17 00:00:00 2001 From: Jonas Jelonek Date: Mon, 18 May 2026 08:36:05 +0000 Subject: [PATCH] realtek: move XS1930 LED definitions to common DTSI The power, cloud and locator LEDs exist on all three XS1930 variants with the same colors and roles, only the GPIOs differ. Declare them once in the common DTSI with the -10/-12HP pinout and let -12F override the gpios properties via phandle references. This removes three near-identical led-node blocks from the device DTS files. Signed-off-by: Jonas Jelonek Link: https://github.com/openwrt/openwrt/pull/23428 Signed-off-by: Robert Marko --- .../realtek/dts/rtl9313_zyxel_xs1930-10.dts | 27 --------------- .../realtek/dts/rtl9313_zyxel_xs1930-12f.dts | 33 ++++--------------- .../realtek/dts/rtl9313_zyxel_xs1930-12hp.dts | 27 --------------- .../realtek/dts/rtl9313_zyxel_xs1930.dtsi | 25 ++++++++++++++ 4 files changed, 31 insertions(+), 81 deletions(-) diff --git a/target/linux/realtek/dts/rtl9313_zyxel_xs1930-10.dts b/target/linux/realtek/dts/rtl9313_zyxel_xs1930-10.dts index 69a4b1e492..4d217bf67b 100644 --- a/target/linux/realtek/dts/rtl9313_zyxel_xs1930-10.dts +++ b/target/linux/realtek/dts/rtl9313_zyxel_xs1930-10.dts @@ -13,33 +13,6 @@ compatible = "zyxel,xs1930-10", "realtek,rtl9313-soc"; model = "Zyxel XS1930-10"; - leds { - led_pwr_green: led-2 { - color = ; - function = LED_FUNCTION_POWER; - gpios = <&gpio0 20 GPIO_ACTIVE_HIGH>; - default-state = "on"; - }; - led_pwr_red: led-3 { - color = ; - function = LED_FUNCTION_POWER; - gpios = <&gpio0 21 GPIO_ACTIVE_LOW>; - }; - led_cloud_green: led-4 { - color = ; - gpios = <&gpio0 24 GPIO_ACTIVE_LOW>; - }; - led_cloud_red: led-5 { - color = ; - gpios = <&gpio0 25 GPIO_ACTIVE_LOW>; - }; - led_locator: led-6 { - color = ; - function = LED_FUNCTION_INDICATOR; - gpios = <&gpio0 26 GPIO_ACTIVE_LOW>; - }; - }; - led_set: led_set@0 { compatible = "realtek,rtl9300-leds"; active-low; diff --git a/target/linux/realtek/dts/rtl9313_zyxel_xs1930-12f.dts b/target/linux/realtek/dts/rtl9313_zyxel_xs1930-12f.dts index 2a5afafb05..34d412b724 100644 --- a/target/linux/realtek/dts/rtl9313_zyxel_xs1930-12f.dts +++ b/target/linux/realtek/dts/rtl9313_zyxel_xs1930-12f.dts @@ -13,33 +13,6 @@ compatible = "zyxel,xs1930-12f", "realtek,rtl9313-soc"; model = "Zyxel XS1930-12F"; - leds { - led_pwr_green: led-2 { - color = ; - function = LED_FUNCTION_POWER; - gpios = <&gpio2 10 GPIO_ACTIVE_HIGH>; - default-state = "on"; - }; - led_pwr_red: led-3 { - color = ; - function = LED_FUNCTION_POWER; - gpios = <&gpio2 11 GPIO_ACTIVE_LOW>; - }; - led_cloud_green: led-4 { - color = ; - gpios = <&gpio1 17 GPIO_ACTIVE_LOW>; - }; - led_cloud_red: led-5 { - color = ; - gpios = <&gpio1 16 GPIO_ACTIVE_LOW>; - }; - led_locator: led-6 { - color = ; - function = LED_FUNCTION_INDICATOR; - gpios = <&gpio1 15 GPIO_ACTIVE_LOW>; - }; - }; - led_set: led_set@0 { compatible = "realtek,rtl9300-leds"; active-low; @@ -230,6 +203,12 @@ }; }; +&led_pwr_green { gpios = <&gpio2 10 GPIO_ACTIVE_HIGH>; }; +&led_pwr_red { gpios = <&gpio2 11 GPIO_ACTIVE_LOW>; }; +&led_cloud_green { gpios = <&gpio1 17 GPIO_ACTIVE_LOW>; }; +&led_cloud_red { gpios = <&gpio1 16 GPIO_ACTIVE_LOW>; }; +&led_locator { gpios = <&gpio1 15 GPIO_ACTIVE_LOW>; }; + &mdio_aux { status = "okay"; diff --git a/target/linux/realtek/dts/rtl9313_zyxel_xs1930-12hp.dts b/target/linux/realtek/dts/rtl9313_zyxel_xs1930-12hp.dts index 5ce41110de..5289c1eaa5 100644 --- a/target/linux/realtek/dts/rtl9313_zyxel_xs1930-12hp.dts +++ b/target/linux/realtek/dts/rtl9313_zyxel_xs1930-12hp.dts @@ -13,33 +13,6 @@ compatible = "zyxel,xs1930-12hp", "realtek,rtl9313-soc"; model = "Zyxel XS1930-12HP"; - leds { - led_pwr_green: led-2 { - color = ; - function = LED_FUNCTION_POWER; - gpios = <&gpio0 20 GPIO_ACTIVE_HIGH>; - default-state = "on"; - }; - led_pwr_red: led-3 { - color = ; - function = LED_FUNCTION_POWER; - gpios = <&gpio0 21 GPIO_ACTIVE_LOW>; - }; - led_cloud_green: led-4 { - color = ; - gpios = <&gpio0 24 GPIO_ACTIVE_LOW>; - }; - led_cloud_red: led-5 { - color = ; - gpios = <&gpio0 25 GPIO_ACTIVE_LOW>; - }; - led_locator: led-6 { - color = ; - function = LED_FUNCTION_INDICATOR; - gpios = <&gpio0 26 GPIO_ACTIVE_LOW>; - }; - }; - led_set: led_set@0 { compatible = "realtek,rtl9300-leds"; active-low; diff --git a/target/linux/realtek/dts/rtl9313_zyxel_xs1930.dtsi b/target/linux/realtek/dts/rtl9313_zyxel_xs1930.dtsi index efb517e485..a594f42d97 100644 --- a/target/linux/realtek/dts/rtl9313_zyxel_xs1930.dtsi +++ b/target/linux/realtek/dts/rtl9313_zyxel_xs1930.dtsi @@ -52,6 +52,31 @@ function = LED_FUNCTION_INDICATOR; gpios = <&gpio0 30 GPIO_ACTIVE_HIGH>; }; + + led_pwr_green: led-2 { + color = ; + function = LED_FUNCTION_POWER; + gpios = <&gpio0 20 GPIO_ACTIVE_HIGH>; + default-state = "on"; + }; + led_pwr_red: led-3 { + color = ; + function = LED_FUNCTION_POWER; + gpios = <&gpio0 21 GPIO_ACTIVE_LOW>; + }; + led_cloud_green: led-4 { + color = ; + gpios = <&gpio0 24 GPIO_ACTIVE_LOW>; + }; + led_cloud_red: led-5 { + color = ; + gpios = <&gpio0 25 GPIO_ACTIVE_LOW>; + }; + led_locator: led-6 { + color = ; + function = LED_FUNCTION_INDICATOR; + gpios = <&gpio0 26 GPIO_ACTIVE_LOW>; + }; }; };