]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
realtek: move XS1930 LED definitions to common DTSI
authorJonas Jelonek <jelonek.jonas@gmail.com>
Mon, 18 May 2026 08:36:05 +0000 (08:36 +0000)
committerRobert Marko <robimarko@gmail.com>
Thu, 21 May 2026 10:08:41 +0000 (12:08 +0200)
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 <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-10.dts
target/linux/realtek/dts/rtl9313_zyxel_xs1930-12f.dts
target/linux/realtek/dts/rtl9313_zyxel_xs1930-12hp.dts
target/linux/realtek/dts/rtl9313_zyxel_xs1930.dtsi

index 69a4b1e492d7d3f8ccda8eab2701aeb29fbe7219..4d217bf67b64938ddef72cda82cb624ea6eb6066 100644 (file)
        compatible = "zyxel,xs1930-10", "realtek,rtl9313-soc";
        model = "Zyxel XS1930-10";
 
-       leds {
-               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>;
-               };
-       };
-
        led_set: led_set@0 {
                compatible = "realtek,rtl9300-leds";
                active-low;
index 2a5afafb054a80e5ccd21a6284c7dbf383d8aaf9..34d412b724afbc519282582b6dc634288a965da1 100644 (file)
        compatible = "zyxel,xs1930-12f", "realtek,rtl9313-soc";
        model = "Zyxel XS1930-12F";
 
-       leds {
-               led_pwr_green: led-2 {
-                       color = <LED_COLOR_ID_GREEN>;
-                       function = LED_FUNCTION_POWER;
-                       gpios = <&gpio2 10 GPIO_ACTIVE_HIGH>;
-                       default-state = "on";
-               };
-               led_pwr_red: led-3 {
-                       color = <LED_COLOR_ID_RED>;
-                       function = LED_FUNCTION_POWER;
-                       gpios = <&gpio2 11 GPIO_ACTIVE_LOW>;
-               };
-               led_cloud_green: led-4 {
-                       color = <LED_COLOR_ID_GREEN>;
-                       gpios = <&gpio1 17 GPIO_ACTIVE_LOW>;
-               };
-               led_cloud_red: led-5 {
-                       color = <LED_COLOR_ID_RED>;
-                       gpios = <&gpio1 16 GPIO_ACTIVE_LOW>;
-               };
-               led_locator: led-6 {
-                       color = <LED_COLOR_ID_BLUE>;
-                       function = LED_FUNCTION_INDICATOR;
-                       gpios = <&gpio1 15 GPIO_ACTIVE_LOW>;
-               };
-       };
-
        led_set: led_set@0 {
                compatible = "realtek,rtl9300-leds";
                active-low;
        };
 };
 
+&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";
 
index 5ce41110de20ac26774bd07bfb3af30b4e513c01..5289c1eaa598de1981f4847eb5f83f752d4c05f4 100644 (file)
        compatible = "zyxel,xs1930-12hp", "realtek,rtl9313-soc";
        model = "Zyxel XS1930-12HP";
 
-       leds {
-               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>;
-               };
-       };
-
        led_set: led_set@0 {
                compatible = "realtek,rtl9300-leds";
                active-low;
index efb517e485a680c48859cc4da9eef4f1d945ecad..a594f42d97d451890f2eafe82053aa4b55db0b17 100644 (file)
                        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>;
+               };
        };
 };