[openwrt/openwrt] mpc85xx: update lp5521 led-controller node for 5.10

LEDE Commits lede-commits at lists.infradead.org
Sat Feb 19 11:15:31 PST 2022


chunkeey pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/583ac0e11df7e29142837410a320db4654e4ff96

commit 583ac0e11df7e29142837410a320db4654e4ff96
Author: Christian Lamparter <chunkeey at gmail.com>
AuthorDate: Sun Feb 13 11:18:04 2022 +0100

    mpc85xx: update lp5521 led-controller node for 5.10
    
    The tricolor LED which is controlled by a lp5521 needed
    some maintenance as the driver failed to load in the
    current v5.10 image:
    | lp5521: probe of 0-0032 failed with error -22
    
    This is because the device-tree needed to be updated
    to match the latest led coloring and function trends.
    
     - removed the device name from the label
     - added color/function properties
     - added required reg and cells properties
    
    For reference a disabled multicolor/RGB is added since this
    reflects the real hardware. Unfortunately, the multicolor
    sysfs interface isn't supported by yet.
    
    Signed-off-by: Christian Lamparter <chunkeey at gmail.com>
---
 .../files/arch/powerpc/boot/dts/hiveap-330.dts     | 67 ++++++++++++++++++----
 1 file changed, 57 insertions(+), 10 deletions(-)

diff --git a/target/linux/mpc85xx/files/arch/powerpc/boot/dts/hiveap-330.dts b/target/linux/mpc85xx/files/arch/powerpc/boot/dts/hiveap-330.dts
index 359b123bc6..67b93707c7 100644
--- a/target/linux/mpc85xx/files/arch/powerpc/boot/dts/hiveap-330.dts
+++ b/target/linux/mpc85xx/files/arch/powerpc/boot/dts/hiveap-330.dts
@@ -9,16 +9,18 @@
  * option) any later version.
  */
 
+#include <dt-bindings/leds/common.h>
+
 /include/ "fsl/p1020si-pre.dtsi"
 / {
 	model = "Aerohive HiveAP-330";
 	compatible = "aerohive,hiveap-330";
 
 	aliases {
-		led-boot = &tricolor_green;
-		led-failsafe = &tricolor_red;
-		led-running = &tricolor_green;
-		led-upgrade = &tricolor_red;
+		led-boot = &led_power_green;
+		led-failsafe = &led_fault_red;
+		led-running = &led_power_green;
+		led-upgrade = &led_fault_red;
 		label-mac-device = &enet0;
 	};
 
@@ -119,21 +121,66 @@
 				compatible = "national,lp5521";
 				reg = <0x32>;
 				clock-mode = /bits/ 8 <2>;
-				tricolor_red: chan0 {
-					chan-name = "hiveap-330:red:tricolor0";
+#if 1
+				led_fault_red: led at 0 {
+					reg = <0>;
+					chan-name = "fault:red";
 					led-cur = /bits/ 8 <0x2f>;
 					max-cur = /bits/ 8 <0x5f>;
+					color = <LED_COLOR_ID_RED>;
+					function = LED_FUNCTION_FAULT;
 				};
-				tricolor_green:chan1 {
-					chan-name = "hiveap-330:green:tricolor0";
+				led_power_green: led at 1 {
+					reg = <1>;
+					chan-name = "power:green";
 					led-cur = /bits/ 8 <0x2f>;
 					max-cur = /bits/ 8 <0x5f>;
+					color = <LED_COLOR_ID_GREEN>;
+					function = LED_FUNCTION_POWER;
 				};
-				chan2 {
-					chan-name = "hiveap-330:blue:tricolor0";
+				led at 2{
+					reg = <2>;
+					chan-name = "blue";
 					led-cur = /bits/ 8 <0x2f>;
 					max-cur = /bits/ 8 <0x5f>;
+					color = <LED_COLOR_ID_BLUE>;
+				};
+#else
+				/*
+				 * openwrt isn't ready to handle multi-intensity leds yet
+				 * # echo 255 255 255 > /sys/class/leds/tricolor/multi_intensity
+				 * # echo 255 > /sys/class/leds/tricolor/brightness
+				 */
+
+				rgbled-0 {
+					function = LED_FUNCTION_POWER;
+					color = <LED_COLOR_ID_RGB>;
+					#address-cells = <1>;
+					#size-cells = <0>;
+
+					led at 0 {
+						reg = <0>;
+						chan-name = "tricolor";
+						led-cur = /bits/ 8 <0x2f>;
+						max-cur = /bits/ 8 <0x5f>;
+						color = <LED_COLOR_ID_RED>;
+					};
+					led at 1 {
+						reg = <1>;
+						chan-name = "tricolor";
+						led-cur = /bits/ 8 <0x2f>;
+						max-cur = /bits/ 8 <0x5f>;
+						color = <LED_COLOR_ID_GREEN>;
+					};
+					led at 2{
+						reg = <2>;
+						chan-name = "tricolor";
+						led-cur = /bits/ 8 <0x2f>;
+						max-cur = /bits/ 8 <0x5f>;
+						color = <LED_COLOR_ID_BLUE>;
+					};
 				};
+#endif
 			};
 
 			/* Most likely SoC boot config */



More information about the lede-commits mailing list