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>
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;
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";
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;
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>;
+ };
};
};