rockchip: remove LED label hack
authorTianling Shen <cnsztl@immortalwrt.org>
Mon, 12 Feb 2024 11:21:38 +0000 (19:21 +0800)
committerNick Hainke <vincent@systemli.org>
Thu, 22 Feb 2024 16:30:05 +0000 (17:30 +0100)
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@immortalwrt.org>
target/linux/rockchip/armv8/base-files/etc/board.d/01_leds
target/linux/rockchip/patches-6.1/100-rockchip-use-system-LED-for-OpenWrt.patch
target/linux/rockchip/patches-6.1/103-arm64-rockchip-add-OF-node-for-USB-eth-on-NanoPi-R2S.patch
target/linux/rockchip/patches-6.1/107-arm64-dts-rockchip-Update-LED-properties-for-Orange-.patch
target/linux/rockchip/patches-6.1/108-arm64-dts-rockchip-add-LED-configuration-to-Orange-P.patch
target/linux/rockchip/patches-6.1/110-arm64-dts-rockchip-Update-LED-properties-for-NanoPi-.patch

index ad846666003e7b37cb27c97d06f1a9234bdb972f..ef894610560f268298766ae3c10d30dee681f911 100644 (file)
@@ -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
 
index 01009c5eb8411b1374cd99f061ecc7fd7c2ce31a..683e5347f75b01d999e0f4c4bd16f3c279147002 100644 (file)
@@ -15,7 +15,15 @@ Signed-off-by: David Bauer <mail@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@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";
                };
        };
  
index 2221077c97ced8d5fca1c28678a5dbab17e6e8eb..eeef0df014f2d03bd478821124301fa33e0d542d 100644 (file)
@@ -14,7 +14,7 @@ Signed-off-by: David Bauer <mail@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@2 {
                compatible = "usbbda,8153";
                reg = <2>;
index b1e26d4e3e27d795f42de9b61b68450fa87a2ffb..3aff37d0969b01f7ea4f27298641349d6dd8e809 100644 (file)
@@ -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@gmail.com>
 ---
@@ -27,30 +25,16 @@ Signed-off-by: Tianling Shen <cnsztl@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";
-               };
-       };
index 37b59925fc16dc750e116fae0b4307a1287718da..af8f8b16bada0aa739641489272bfe9ed4756d73 100644 (file)
@@ -14,7 +14,7 @@ Signed-off-by: Tianling Shen <cnsztl@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@2 {
                compatible = "usbbda,8153";
                reg = <2>;
index 64dc433a30ae1316aee19d5cfd03a17dff6c4540..c22fdd52b8a7896dacf31f0c60c6e74dc16133fe 100644 (file)
@@ -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@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 @@