diff mbox series

[1/2] ARM: dts: omap3-n900: Fix lp5523 for multi color

Message ID 20211212224007.10293-2-merlijn@wizzup.org (mailing list archive)
State New, archived
Headers show
Series Fix RGB status LED and keyboard backlight LEDs on Nokia N900 | expand

Commit Message

Merlijn Wajer Dec. 12, 2021, 10:40 p.m. UTC
From: "Sicelo A. Mhlongo" <absicsz@gmail.com>

Since the LED multicolor framework support was added in commit
92a81562e695 ("leds: lp55xx: Add multicolor framework support to lp55xx")
LEDs on this platform stopped working.

Fixes: 92a81562e695 ("leds: lp55xx: Add multicolor framework support to lp55xx")
Fixes: ac219bf3c9bd ("leds: lp55xx: Convert to use GPIO descriptors")
Signed-off-by: Merlijn Wajer <merlijn@wizzup.org>
Signed-off-by: Sicelo A. Mhlongo <absicsz@gmail.com>
---
 arch/arm/boot/dts/omap3-n900.dts | 50 +++++++++++++++++++++++++-------
 1 file changed, 40 insertions(+), 10 deletions(-)

Comments

Pavel Machek Dec. 15, 2021, 8:31 p.m. UTC | #1
Hi!

> From: "Sicelo A. Mhlongo" <absicsz@gmail.com>
> 
> Since the LED multicolor framework support was added in commit
> 92a81562e695 ("leds: lp55xx: Add multicolor framework support to lp55xx")
> LEDs on this platform stopped working.

Does this change names is /sys/class/leds?

Best regards,
								Pavel
Merlijn Wajer Dec. 16, 2021, 11:50 a.m. UTC | #2
Hi Pavel,

On 15/12/2021 21:31, Pavel Machek wrote:
> Hi!
> 
>> From: "Sicelo A. Mhlongo" <absicsz@gmail.com>
>>
>> Since the LED multicolor framework support was added in commit
>> 92a81562e695 ("leds: lp55xx: Add multicolor framework support to lp55xx")
>> LEDs on this platform stopped working.
> 
> Does this change names is /sys/class/leds?

I booted my 5.15 with this series (and some other patches) added and
these are the led names:

> root@devuan-n900:~# uname -a
> Linux devuan-n900 5.15.2-00596-g94bfc7de5522-dirty #58 SMP PREEMPT Thu Dec 16 11:53:53 CET 2021 armv7l GNU/Linux
> root@devuan-n900:~# ls /sys/class/leds
> debug::sleep  lp5523:g    lp5523:kb2  lp5523:kb4  lp5523:kb6
> lp5523:b      lp5523:kb1  lp5523:kb3  lp5523:kb5  lp5523:r

On 5.1 (my previous 'stable') kernel, these are the led names:

> root@devuan-n900:~# uname -a
> Linux devuan-n900 5.1.21 #1 Mon Jul 19 16:32:44 UTC 2021 armv7l GNU/Linux
> root@devuan-n900:~# ls /sys/class/leds
> debug::sleep  lp5523:g    lp5523:kb2  lp5523:kb4  lp5523:kb6
> lp5523:b      lp5523:kb1  lp5523:kb3  lp5523:kb5  lp5523:r

So I don't think the names are changed.

Regards,
Merlijn
diff mbox series

Patch

diff --git a/arch/arm/boot/dts/omap3-n900.dts b/arch/arm/boot/dts/omap3-n900.dts
index c89b6c87271f..1746a44e96bc 100644
--- a/arch/arm/boot/dts/omap3-n900.dts
+++ b/arch/arm/boot/dts/omap3-n900.dts
@@ -8,6 +8,7 @@ 
 
 #include "omap34xx.dtsi"
 #include <dt-bindings/input/input.h>
+#include <dt-bindings/leds/common.h>
 
 /*
  * Default secure signed bootloader (Nokia X-Loader) does not enable L3 firewall
@@ -630,63 +631,92 @@  indicator {
 	};
 
 	lp5523: lp5523@32 {
+		#address-cells = <1>;
+		#size-cells = <0>;
 		compatible = "national,lp5523";
 		reg = <0x32>;
 		clock-mode = /bits/ 8 <0>; /* LP55XX_CLOCK_AUTO */
-		enable-gpio = <&gpio2 9 GPIO_ACTIVE_HIGH>; /* 41 */
+		enable-gpios = <&gpio2 9 GPIO_ACTIVE_HIGH>; /* 41 */
 
-		chan0 {
+		led@0 {
+			reg = <0>;
 			chan-name = "lp5523:kb1";
 			led-cur = /bits/ 8 <50>;
 			max-cur = /bits/ 8 <100>;
+			color = <LED_COLOR_ID_WHITE>;
+			function = LED_FUNCTION_KBD_BACKLIGHT;
 		};
 
-		chan1 {
+		led@1 {
+			reg = <1>;
 			chan-name = "lp5523:kb2";
 			led-cur = /bits/ 8 <50>;
 			max-cur = /bits/ 8 <100>;
+			color = <LED_COLOR_ID_WHITE>;
+			function = LED_FUNCTION_KBD_BACKLIGHT;
 		};
 
-		chan2 {
+		led@2 {
+			reg = <2>;
 			chan-name = "lp5523:kb3";
 			led-cur = /bits/ 8 <50>;
 			max-cur = /bits/ 8 <100>;
+			color = <LED_COLOR_ID_WHITE>;
+			function = LED_FUNCTION_KBD_BACKLIGHT;
 		};
 
-		chan3 {
+		led@3 {
+			reg = <3>;
 			chan-name = "lp5523:kb4";
 			led-cur = /bits/ 8 <50>;
 			max-cur = /bits/ 8 <100>;
+			color = <LED_COLOR_ID_WHITE>;
+			function = LED_FUNCTION_KBD_BACKLIGHT;
 		};
 
-		chan4 {
+		led@4 {
+			reg = <4>;
 			chan-name = "lp5523:b";
 			led-cur = /bits/ 8 <50>;
 			max-cur = /bits/ 8 <100>;
+			color = <LED_COLOR_ID_BLUE>;
+			function = LED_FUNCTION_STATUS;
 		};
 
-		chan5 {
+		led@5 {
+			reg = <5>;
 			chan-name = "lp5523:g";
 			led-cur = /bits/ 8 <50>;
 			max-cur = /bits/ 8 <100>;
+			color = <LED_COLOR_ID_GREEN>;
+			function = LED_FUNCTION_STATUS;
 		};
 
-		chan6 {
+		led@6 {
+			reg = <6>;
 			chan-name = "lp5523:r";
 			led-cur = /bits/ 8 <50>;
 			max-cur = /bits/ 8 <100>;
+			color = <LED_COLOR_ID_RED>;
+			function = LED_FUNCTION_STATUS;
 		};
 
-		chan7 {
+		led@7 {
+			reg = <7>;
 			chan-name = "lp5523:kb5";
 			led-cur = /bits/ 8 <50>;
 			max-cur = /bits/ 8 <100>;
+			color = <LED_COLOR_ID_WHITE>;
+			function = LED_FUNCTION_KBD_BACKLIGHT;
 		};
 
-		chan8 {
+		led@8 {
+			reg = <8>;
 			chan-name = "lp5523:kb6";
 			led-cur = /bits/ 8 <50>;
 			max-cur = /bits/ 8 <100>;
+			color = <LED_COLOR_ID_WHITE>;
+			function = LED_FUNCTION_KBD_BACKLIGHT;
 		};
 	};