[openwrt/openwrt] rockchip: remove LED label hack
LEDE Commits
lede-commits at lists.infradead.org
Thu Feb 22 08:30:13 PST 2024
nick pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/08e249d43ca8011662bc862969534b6f0570a7a3
commit 08e249d43ca8011662bc862969534b6f0570a7a3
Author: Tianling Shen <cnsztl at immortalwrt.org>
AuthorDate: Mon Feb 12 19:21:38 2024 +0800
rockchip: remove LED label hack
Now we support parsing the color and function properties.
Ref: e814acc59948 ("base-files: support parse DT LED color and function")
Signed-off-by: Tianling Shen <cnsztl at immortalwrt.org>
---
.../rockchip/armv8/base-files/etc/board.d/01_leds | 4 +-
.../100-rockchip-use-system-LED-for-OpenWrt.patch | 22 ++++++--
...hip-add-OF-node-for-USB-eth-on-NanoPi-R2S.patch | 2 +-
...ockchip-Update-LED-properties-for-Orange-.patch | 22 +-------
...ockchip-add-LED-configuration-to-Orange-P.patch | 2 +-
...ockchip-Update-LED-properties-for-NanoPi-.patch | 64 ++--------------------
6 files changed, 30 insertions(+), 86 deletions(-)
diff --git a/target/linux/rockchip/armv8/base-files/etc/board.d/01_leds b/target/linux/rockchip/armv8/base-files/etc/board.d/01_leds
index ad84666600..ef89461056 100644
--- a/target/linux/rockchip/armv8/base-files/etc/board.d/01_leds
+++ b/target/linux/rockchip/armv8/base-files/etc/board.d/01_leds
@@ -25,8 +25,8 @@ friendlyarm,nanopi-r5c)
;;
friendlyarm,nanopi-r5s)
ucidef_set_led_netdev "wan" "WAN" "green:wan" "eth0"
- ucidef_set_led_netdev "lan1" "LAN1" "green:lan1" "eth1"
- ucidef_set_led_netdev "lan2" "LAN2" "green:lan2" "eth2"
+ ucidef_set_led_netdev "lan1" "LAN1" "green:lan-1" "eth1"
+ ucidef_set_led_netdev "lan2" "LAN2" "green:lan-2" "eth2"
;;
esac
diff --git a/target/linux/rockchip/patches-6.1/100-rockchip-use-system-LED-for-OpenWrt.patch b/target/linux/rockchip/patches-6.1/100-rockchip-use-system-LED-for-OpenWrt.patch
index 01009c5eb8..683e5347f7 100644
--- a/target/linux/rockchip/patches-6.1/100-rockchip-use-system-LED-for-OpenWrt.patch
+++ b/target/linux/rockchip/patches-6.1/100-rockchip-use-system-LED-for-OpenWrt.patch
@@ -15,7 +15,15 @@ Signed-off-by: David Bauer <mail at david-bauer.net>
--- a/arch/arm64/boot/dts/rockchip/rk3328-nanopi-r2s.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3328-nanopi-r2s.dts
-@@ -16,6 +16,11 @@
+@@ -6,6 +6,7 @@
+ /dts-v1/;
+
+ #include <dt-bindings/input/input.h>
++#include <dt-bindings/leds/common.h>
+ #include <dt-bindings/gpio/gpio.h>
+ #include "rk3328.dtsi"
+
+@@ -16,6 +17,11 @@
aliases {
ethernet1 = &rtl8153;
mmc0 = &sdmmc;
@@ -27,25 +35,29 @@ Signed-off-by: David Bauer <mail at david-bauer.net>
};
chosen {
-@@ -49,18 +54,18 @@
+@@ -48,19 +54,22 @@
+ pinctrl-names = "default";
lan_led: led-0 {
++ color = <LED_COLOR_ID_GREEN>;
++ function = LED_FUNCTION_LAN;
gpios = <&gpio2 RK_PB7 GPIO_ACTIVE_HIGH>;
- label = "nanopi-r2s:green:lan";
-+ label = "green:lan";
};
sys_led: led-1 {
++ color = <LED_COLOR_ID_RED>;
++ function = LED_FUNCTION_STATUS;
gpios = <&gpio0 RK_PA2 GPIO_ACTIVE_HIGH>;
- label = "nanopi-r2s:red:sys";
-+ label = "red:sys";
default-state = "on";
};
wan_led: led-2 {
++ color = <LED_COLOR_ID_GREEN>;
++ function = LED_FUNCTION_WAN;
gpios = <&gpio2 RK_PC2 GPIO_ACTIVE_HIGH>;
- label = "nanopi-r2s:green:wan";
-+ label = "green:wan";
};
};
diff --git a/target/linux/rockchip/patches-6.1/103-arm64-rockchip-add-OF-node-for-USB-eth-on-NanoPi-R2S.patch b/target/linux/rockchip/patches-6.1/103-arm64-rockchip-add-OF-node-for-USB-eth-on-NanoPi-R2S.patch
index 2221077c97..eeef0df014 100644
--- a/target/linux/rockchip/patches-6.1/103-arm64-rockchip-add-OF-node-for-USB-eth-on-NanoPi-R2S.patch
+++ b/target/linux/rockchip/patches-6.1/103-arm64-rockchip-add-OF-node-for-USB-eth-on-NanoPi-R2S.patch
@@ -14,7 +14,7 @@ Signed-off-by: David Bauer <mail at david-bauer.net>
--- a/arch/arm64/boot/dts/rockchip/rk3328-nanopi-r2s.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3328-nanopi-r2s.dts
-@@ -402,6 +402,7 @@
+@@ -406,6 +406,7 @@
rtl8153: device at 2 {
compatible = "usbbda,8153";
reg = <2>;
diff --git a/target/linux/rockchip/patches-6.1/107-arm64-dts-rockchip-Update-LED-properties-for-Orange-.patch b/target/linux/rockchip/patches-6.1/107-arm64-dts-rockchip-Update-LED-properties-for-Orange-.patch
index b1e26d4e3e..3aff37d096 100644
--- a/target/linux/rockchip/patches-6.1/107-arm64-dts-rockchip-Update-LED-properties-for-Orange-.patch
+++ b/target/linux/rockchip/patches-6.1/107-arm64-dts-rockchip-Update-LED-properties-for-Orange-.patch
@@ -5,8 +5,6 @@ Subject: [PATCH] arm64: dts: rockchip: Update LED properties for Orange Pi R1
Plus
Add OpenWrt's LED aliases for showing system status.
-Also replace function/color with legacy label as OpenWrt relys on it
-to update LED settings.
Signed-off-by: Tianling Shen <cnsztl at gmail.com>
---
@@ -27,30 +25,16 @@ Signed-off-by: Tianling Shen <cnsztl at gmail.com>
};
chosen {
-@@ -36,22 +41,18 @@
- pinctrl-names = "default";
-
- led-0 {
-- function = LED_FUNCTION_LAN;
-- color = <LED_COLOR_ID_GREEN>;
+@@ -41,11 +46,10 @@
gpios = <&gpio2 RK_PB7 GPIO_ACTIVE_HIGH>;
-+ label = "green:lan";
};
- led-1 {
-- function = LED_FUNCTION_STATUS;
-- color = <LED_COLOR_ID_RED>;
+ status_led: led-1 {
+ function = LED_FUNCTION_STATUS;
+ color = <LED_COLOR_ID_RED>;
gpios = <&gpio3 RK_PC5 GPIO_ACTIVE_HIGH>;
- linux,default-trigger = "heartbeat";
-+ label = "red:status";
};
led-2 {
-- function = LED_FUNCTION_WAN;
-- color = <LED_COLOR_ID_GREEN>;
- gpios = <&gpio2 RK_PC2 GPIO_ACTIVE_HIGH>;
-+ label = "green:wan";
- };
- };
-
diff --git a/target/linux/rockchip/patches-6.1/108-arm64-dts-rockchip-add-LED-configuration-to-Orange-P.patch b/target/linux/rockchip/patches-6.1/108-arm64-dts-rockchip-add-LED-configuration-to-Orange-P.patch
index 37b59925fc..af8f8b16ba 100644
--- a/target/linux/rockchip/patches-6.1/108-arm64-dts-rockchip-add-LED-configuration-to-Orange-P.patch
+++ b/target/linux/rockchip/patches-6.1/108-arm64-dts-rockchip-add-LED-configuration-to-Orange-P.patch
@@ -14,7 +14,7 @@ Signed-off-by: Tianling Shen <cnsztl at gmail.com>
--- a/arch/arm64/boot/dts/rockchip/rk3328-orangepi-r1-plus.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3328-orangepi-r1-plus.dts
-@@ -362,6 +362,7 @@
+@@ -365,6 +365,7 @@
rtl8153: device at 2 {
compatible = "usbbda,8153";
reg = <2>;
diff --git a/target/linux/rockchip/patches-6.1/110-arm64-dts-rockchip-Update-LED-properties-for-NanoPi-.patch b/target/linux/rockchip/patches-6.1/110-arm64-dts-rockchip-Update-LED-properties-for-NanoPi-.patch
index 64dc433a30..c22fdd52b8 100644
--- a/target/linux/rockchip/patches-6.1/110-arm64-dts-rockchip-Update-LED-properties-for-NanoPi-.patch
+++ b/target/linux/rockchip/patches-6.1/110-arm64-dts-rockchip-Update-LED-properties-for-NanoPi-.patch
@@ -5,82 +5,30 @@ Subject: [PATCH] arm64: dts: rockchip: Update LED properties for NanoPi R5
series
Add OpenWrt's LED aliases for showing system status.
-Also replace function/color with legacy label as OpenWrt relys on it
-to update LED settings.
Signed-off-by: Tianling Shen <cnsztl at gmail.com>
---
--- a/arch/arm64/boot/dts/rockchip/rk3568-nanopi-r5c.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3568-nanopi-r5c.dts
-@@ -32,27 +32,22 @@
- pinctrl-0 = <&lan_led_pin>, <&power_led_pin>, <&wan_led_pin>, <&wlan_led_pin>;
-
- led-lan {
-- color = <LED_COLOR_ID_GREEN>;
-- function = LED_FUNCTION_LAN;
-+ label = "green:lan";
- gpios = <&gpio3 RK_PA3 GPIO_ACTIVE_HIGH>;
- };
-
+@@ -40,7 +40,6 @@
power_led: led-power {
-- color = <LED_COLOR_ID_RED>;
-- function = LED_FUNCTION_POWER;
+ color = <LED_COLOR_ID_RED>;
+ function = LED_FUNCTION_POWER;
- linux,default-trigger = "heartbeat";
-+ label = "red:power";
gpios = <&gpio3 RK_PA2 GPIO_ACTIVE_HIGH>;
};
- led-wan {
-- color = <LED_COLOR_ID_GREEN>;
-- function = LED_FUNCTION_WAN;
-+ label = "green:wan";
- gpios = <&gpio3 RK_PA4 GPIO_ACTIVE_HIGH>;
- };
-
- led-wlan {
-- color = <LED_COLOR_ID_GREEN>;
-- function = LED_FUNCTION_WLAN;
-+ label = "green:wlan";
- gpios = <&gpio3 RK_PA5 GPIO_ACTIVE_HIGH>;
- };
- };
--- a/arch/arm64/boot/dts/rockchip/rk3568-nanopi-r5s.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3568-nanopi-r5s.dts
-@@ -23,29 +23,22 @@
- pinctrl-0 = <&lan1_led_pin>, <&lan2_led_pin>, <&power_led_pin>, <&wan_led_pin>;
-
- led-lan1 {
-- color = <LED_COLOR_ID_GREEN>;
-- function = LED_FUNCTION_LAN;
-- function-enumerator = <1>;
-+ label = "green:lan1";
- gpios = <&gpio3 RK_PD6 GPIO_ACTIVE_HIGH>;
- };
-
- led-lan2 {
-- color = <LED_COLOR_ID_GREEN>;
-- function = LED_FUNCTION_LAN;
-- function-enumerator = <2>;
-+ label = "green:lan2";
- gpios = <&gpio3 RK_PD7 GPIO_ACTIVE_HIGH>;
- };
-
+@@ -39,7 +39,6 @@
power_led: led-power {
-- color = <LED_COLOR_ID_RED>;
-- function = LED_FUNCTION_POWER;
+ color = <LED_COLOR_ID_RED>;
+ function = LED_FUNCTION_POWER;
- linux,default-trigger = "heartbeat";
-+ label = "red:power";
gpios = <&gpio4 RK_PD2 GPIO_ACTIVE_HIGH>;
};
- led-wan {
-- color = <LED_COLOR_ID_GREEN>;
-- function = LED_FUNCTION_WAN;
-+ label = "green:wan";
- gpios = <&gpio2 RK_PC1 GPIO_ACTIVE_HIGH>;
- };
- };
--- a/arch/arm64/boot/dts/rockchip/rk3568-nanopi-r5s.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3568-nanopi-r5s.dtsi
@@ -18,6 +18,11 @@
More information about the lede-commits
mailing list