mpc85xx: update lp5521 led-controller node for 5.10
authorChristian Lamparter <chunkeey@gmail.com>
Sun, 13 Feb 2022 10:18:04 +0000 (11:18 +0100)
committerChristian Lamparter <chunkeey@gmail.com>
Sat, 19 Feb 2022 18:34:18 +0000 (19:34 +0100)
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@gmail.com>
target/linux/mpc85xx/files/arch/powerpc/boot/dts/hiveap-330.dts

index 359b123bc620b5f9cdbcd81794e5f9ce4e5c130c..67b93707c798d56675a238bc9f767043b7196266 100644 (file)
@@ -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;
        };
 
                                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@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@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@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@0 {
+                                               reg = <0>;
+                                               chan-name = "tricolor";
+                                               led-cur = /bits/ 8 <0x2f>;
+                                               max-cur = /bits/ 8 <0x5f>;
+                                               color = <LED_COLOR_ID_RED>;
+                                       };
+                                       led@1 {
+                                               reg = <1>;
+                                               chan-name = "tricolor";
+                                               led-cur = /bits/ 8 <0x2f>;
+                                               max-cur = /bits/ 8 <0x5f>;
+                                               color = <LED_COLOR_ID_GREEN>;
+                                       };
+                                       led@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 */