mvebu: fix LEDs on IIJ SA-W2
authorINAGAKI Hiroshi <musashino.open@gmail.com>
Sun, 18 Feb 2024 06:01:51 +0000 (15:01 +0900)
committerHauke Mehrtens <hauke@hauke-m.de>
Sun, 14 Apr 2024 17:46:30 +0000 (19:46 +0200)
On IIJ SA-W2, some multiple LEDs have no "function" property and only
"color" property is available for the newer binding of LED on Linux
Kernel.
9d93b6d091 ("mvebu: drop redundant label with new LED color/function
format") removes "label" property from LEDs, then, multiple "<color>:"
(ex.: "green:"/"red:") will be appeared and renamed to "<color>:_<num>"
(ex.: "green:_1", "green:_2", ...) by kernel.

log:

[    1.911118] leds-gpio leds: Led green: renamed to green:_1 due to name collision
[    1.918600] leds-gpio leds: Led red: renamed to red:_1 due to name collision
[    1.925727] leds-gpio leds: Led green: renamed to green:_2 due to name collision
[    1.933202] leds-gpio leds: Led red: renamed to red:_2 due to name collision
[    1.940321] leds-gpio leds: Led green: renamed to green:_3 due to name collision
[    1.947797] leds-gpio leds: Led red: renamed to red:_3 due to name collision
[    1.954939] leds-gpio leds: Led green: renamed to green:_4 due to name collision
[    1.962456] leds-gpio leds: Led green: renamed to green:_5 due to name collision

/sys/class/leds:

root@OpenWrt:/# ls /sys/class/leds/
green:        green:_3      green:status  red:_2
green:_1      green:_4      red:          red:_3
green:_2      green:_5      red:_1        red:status

Fix this issue by adding missing "function" (and "function-enumerator")
property to those LEDs on IIJ SA-W2.

Fixes: 9d93b6d091 ("mvebu: drop redundant label with new LED color/function format")
Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
target/linux/mvebu/files-6.1/arch/arm/boot/dts/armada-380-iij-sa-w2.dts
target/linux/mvebu/files-6.6/arch/arm/boot/dts/marvell/armada-380-iij-sa-w2.dts

index 335a2ecf96e840c266f8ca80660477f994b51e65..01c1ef675bb431c98239b9604e18c688570d6fc9 100644 (file)
                led-0 {
                        gpios = <&gpio0 19 GPIO_ACTIVE_HIGH>;
                        color = <LED_COLOR_ID_GREEN>;
+                       function = LED_FUNCTION_WLAN_5GHZ;
                        linux,default-trigger = "phy0tpt";
                };
 
                led-1 {
                        gpios = <&gpio0 20 GPIO_ACTIVE_HIGH>;
                        color = <LED_COLOR_ID_RED>;
+                       function = LED_FUNCTION_WLAN_5GHZ;
                };
 
                led-2 {
                led-4 {
                        gpios = <&gpio1 3 GPIO_ACTIVE_HIGH>;
                        color = <LED_COLOR_ID_GREEN>;
+                       function = LED_FUNCTION_MOBILE;
                };
 
                led-5 {
                        gpios = <&gpio1 4 GPIO_ACTIVE_HIGH>;
                        color = <LED_COLOR_ID_RED>;
+                       function = LED_FUNCTION_MOBILE;
                };
 
                led-6 {
                        gpios = <&gpio1 12 GPIO_ACTIVE_HIGH>;
                        color = <LED_COLOR_ID_GREEN>;
+                       function = LED_FUNCTION_WLAN_2GHZ;
                        linux,default-trigger = "phy1tpt";
                };
 
                led-7 {
                        gpios = <&gpio1 13 GPIO_ACTIVE_HIGH>;
                        color = <LED_COLOR_ID_RED>;
+                       function = LED_FUNCTION_WLAN_2GHZ;
                };
 
                led_power_green: led-8 {
                        gpios = <&gpio1 14 GPIO_ACTIVE_LOW>;
                        color = <LED_COLOR_ID_GREEN>;
+                       function = LED_FUNCTION_POWER;
                };
 
                led_power_red: led-9 {
                        gpios = <&gpio1 15 GPIO_ACTIVE_HIGH>;
                        color = <LED_COLOR_ID_RED>;
+                       function = LED_FUNCTION_POWER;
                };
 
                led-10 {
                        gpios = <&gpio1 22 GPIO_ACTIVE_LOW>;
                        color = <LED_COLOR_ID_GREEN>;
+                       function = LED_FUNCTION_USB;
+                       function-enumerator = <1>;
                        linux,default-trigger = "usbport";
                        trigger-sources = <&hub_port2>;
                };
                led-11 {
                        gpios = <&gpio1 23 GPIO_ACTIVE_LOW>;
                        color = <LED_COLOR_ID_GREEN>;
+                       function = LED_FUNCTION_USB;
+                       function-enumerator = <0>;
                        linux,default-trigger = "usbport";
                        trigger-sources = <&hub_port1>;
                };
index 335a2ecf96e840c266f8ca80660477f994b51e65..01c1ef675bb431c98239b9604e18c688570d6fc9 100644 (file)
                led-0 {
                        gpios = <&gpio0 19 GPIO_ACTIVE_HIGH>;
                        color = <LED_COLOR_ID_GREEN>;
+                       function = LED_FUNCTION_WLAN_5GHZ;
                        linux,default-trigger = "phy0tpt";
                };
 
                led-1 {
                        gpios = <&gpio0 20 GPIO_ACTIVE_HIGH>;
                        color = <LED_COLOR_ID_RED>;
+                       function = LED_FUNCTION_WLAN_5GHZ;
                };
 
                led-2 {
                led-4 {
                        gpios = <&gpio1 3 GPIO_ACTIVE_HIGH>;
                        color = <LED_COLOR_ID_GREEN>;
+                       function = LED_FUNCTION_MOBILE;
                };
 
                led-5 {
                        gpios = <&gpio1 4 GPIO_ACTIVE_HIGH>;
                        color = <LED_COLOR_ID_RED>;
+                       function = LED_FUNCTION_MOBILE;
                };
 
                led-6 {
                        gpios = <&gpio1 12 GPIO_ACTIVE_HIGH>;
                        color = <LED_COLOR_ID_GREEN>;
+                       function = LED_FUNCTION_WLAN_2GHZ;
                        linux,default-trigger = "phy1tpt";
                };
 
                led-7 {
                        gpios = <&gpio1 13 GPIO_ACTIVE_HIGH>;
                        color = <LED_COLOR_ID_RED>;
+                       function = LED_FUNCTION_WLAN_2GHZ;
                };
 
                led_power_green: led-8 {
                        gpios = <&gpio1 14 GPIO_ACTIVE_LOW>;
                        color = <LED_COLOR_ID_GREEN>;
+                       function = LED_FUNCTION_POWER;
                };
 
                led_power_red: led-9 {
                        gpios = <&gpio1 15 GPIO_ACTIVE_HIGH>;
                        color = <LED_COLOR_ID_RED>;
+                       function = LED_FUNCTION_POWER;
                };
 
                led-10 {
                        gpios = <&gpio1 22 GPIO_ACTIVE_LOW>;
                        color = <LED_COLOR_ID_GREEN>;
+                       function = LED_FUNCTION_USB;
+                       function-enumerator = <1>;
                        linux,default-trigger = "usbport";
                        trigger-sources = <&hub_port2>;
                };
                led-11 {
                        gpios = <&gpio1 23 GPIO_ACTIVE_LOW>;
                        color = <LED_COLOR_ID_GREEN>;
+                       function = LED_FUNCTION_USB;
+                       function-enumerator = <0>;
                        linux,default-trigger = "usbport";
                        trigger-sources = <&hub_port1>;
                };