Skip to contentSkip to conversation

Add LEDs support for the ARM Versatile DT

PATCH New Linus Walleij 3 participants 8 messages Jan 5, 2016 – Jan 8, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover Add LEDs support for the ARM Versatile DT

This adds support for the board LEDs to the ARM Versatile device tree version.

I can't decice if this is a regression or not. The board file version of Versatile supported the LEDs, the Device Tree version never did until now.

The board file version of Versatile was deleted in commit 16956fed35fecde2201e23458cda193526b19559
"ARM: versatile: switch to DT only booting and remove legacy code"

If we consider the DT version a full drop-in replacement for the board file version, then this should go in as a regression fix. If it is not, we can delay it to the next merge window.

Sending this to arm at kernel.org anyway so the ARM SoC maintainers can decide.

Linus Walleij (2):
ARM: versatile: add the syscon LEDs to the DT
ARM: versatile: enable the right LEDs

 arch/arm/boot/dts/versatile-ab.dts   | 62 +++++++++++++++++++++++++++++++++++-
 arch/arm/configs/versatile_defconfig |  3 +-
 2 files changed, 63 insertions(+), 2 deletions(-)
Signature · 1 line
2.4.3
#1 lore raw

PATCH 1/2 ARM: versatile: add the syscon LEDs to the DT

The device tree version of Versatile AP/PB never had LED support so we are missing LEDs from our hardware boards. Add this as syscon LEDs like we did for Integrator and Juno. We need to spawn devices in the syscon with "simple-mfd" for this to work.

---
 arch/arm/boot/dts/versatile-ab.dts | 62 +++++++++++++++++++++++++++++++++++++-
 1 file changed, 61 insertions(+), 1 deletion(-)
arch/arm/boot/dts/versatile-ab.dts +61 -1
index 3279bf1a17a1..6fd7efbead34 100644
@@ -30,9 +30,69 @@
 	};
 
 	core-module at 10000000 {
-		compatible = "arm,core-module-versatile", "syscon";
+		compatible = "arm,core-module-versatile", "syscon", "simple-mfd";
 		reg = <0x10000000 0x200>;
 
+		led at 08.0 {
+			compatible = "register-bit-led";
+			offset = <0x08>;
+			mask = <0x01>;
+			label = "versatile:0";
+			linux,default-trigger = "heartbeat";
+			default-state = "on";
+		};
+		led at 08.1 {
+			compatible = "register-bit-led";
+			offset = <0x08>;
+			mask = <0x02>;
+			label = "versatile:1";
+			linux,default-trigger = "mmc0";
+			default-state = "off";
+		};
+		led at 08.2 {
+			compatible = "register-bit-led";
+			offset = <0x08>;
+			mask = <0x04>;
+			label = "versatile:2";
+			linux,default-trigger = "cpu0";
+			default-state = "off";
+		};
+		led at 08.3 {
+			compatible = "register-bit-led";
+			offset = <0x08>;
+			mask = <0x08>;
+			label = "versatile:3";
+			default-state = "off";
+		};
+		led at 08.4 {
+			compatible = "register-bit-led";
+			offset = <0x08>;
+			mask = <0x10>;
+			label = "versatile:4";
+			default-state = "off";
+		};
+		led at 08.5 {
+			compatible = "register-bit-led";
+			offset = <0x08>;
+			mask = <0x20>;
+			label = "versatile:5";
+			default-state = "off";
+		};
+		led at 08.6 {
+			compatible = "register-bit-led";
+			offset = <0x08>;
+			mask = <0x40>;
+			label = "versatile:6";
+			default-state = "off";
+		};
+		led at 08.7 {
+			compatible = "register-bit-led";
+			offset = <0x08>;
+			mask = <0x80>;
+			label = "versatile:7";
+			default-state = "off";
+		};
+
 		/* OSC1 on AB, OSC4 on PB */
 		osc1: cm_aux_osc at 24M {
 			#clock-cells = <0>;
Signature · 1 line
2.4.3
maintainer
#2 lore raw

PATCH 1/2 ARM: versatile: add the syscon LEDs to the DT

Quoted 9 lines · Linus Walleij

The device tree version of Versatile AP/PB never had LED support so we are missing LEDs from our hardware boards. Add this as syscon LEDs like we did for Integrator and Juno. We need to spawn devices in the syscon with "simple-mfd" for this to work.

---
 arch/arm/boot/dts/versatile-ab.dts | 62 +++++++++++++++++++++++++++++++++++++-
 1 file changed, 61 insertions(+), 1 deletion(-)

I guess this means you have tested my series on actual h/w now?

Rob

#3 lore raw

PATCH 1/2 ARM: versatile: add the syscon LEDs to the DT

Quoted 6 lines · Rob Herring
Quoted 5 lines · Linus Walleij

The device tree version of Versatile AP/PB never had LED support so we are missing LEDs from our hardware boards. Add this as syscon LEDs like we did for Integrator and Juno. We need to spawn devices in the syscon with "simple-mfd" for this to work.

Quoted 8 lines
Quoted 4 lines
---
 arch/arm/boot/dts/versatile-ab.dts | 62 +++++++++++++++++++++++++++++++++++++-
 1 file changed, 61 insertions(+), 1 deletion(-)

I guess this means you have tested my series on actual h/w now?

Yups tested today on Versatile AB. I sent some 4 different patches for various issues (that were there all the time with the device tree boot) and after that it works like a charm.

Yours,
Linus Walleij

#4 lore raw

PATCH 1/2 ARM: versatile: add the syscon LEDs to the DT

In reply to Linus Walleij
Quoted 7 lines · On Tuesday 05 January 2016 15:02:08 Linus Walleij wrote:

The device tree version of Versatile AP/PB never had LED support so we are missing LEDs from our hardware boards. Add this as syscon LEDs like we did for Integrator and Juno. We need to spawn devices in the syscon with "simple-mfd" for this to work.

Applied to next/dt, thanks!

Arnd

#5 lore raw

PATCH 2/2 ARM: versatile: enable the right LEDs

In reply to Linus Walleij

The Versatile now only has device tree boot support, and the device tree version does not support CONFIG_LEDS_VERSATILE. Instead select CONFIG_LEDS_SYSCON and MFD_SYSCON, so we can get LEDs support from the same generic driver that drives most other ARM reference boards.

---
 arch/arm/configs/versatile_defconfig | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
arch/arm/configs/versatile_defconfig +2 -1
index 75ef20462030..295408ea9dc7 100644
@@ -54,6 +54,7 @@ CONFIG_SPI=y
 CONFIG_GPIOLIB=y
 CONFIG_GPIO_PL061=y
 # CONFIG_HWMON is not set
+CONFIG_MFD_SYSCON=y
 CONFIG_FB=y
 CONFIG_FB_ARMCLCD=y
 CONFIG_FRAMEBUFFER_CONSOLE=y
@@ -66,7 +67,7 @@ CONFIG_MMC=y
 CONFIG_MMC_ARMMMCI=y
 CONFIG_NEW_LEDS=y
 CONFIG_LEDS_CLASS=y
-CONFIG_LEDS_VERSATILE=y
+CONFIG_LEDS_SYSCON=y
 CONFIG_LEDS_TRIGGERS=y
 CONFIG_LEDS_TRIGGER_HEARTBEAT=y
 CONFIG_LEDS_TRIGGER_CPU=y
Signature · 1 line
2.4.3
#6 lore raw

PATCH 2/2 ARM: versatile: enable the right LEDs

Quoted 8 lines · On Tuesday 05 January 2016 15:02:09 Linus Walleij wrote:

The Versatile now only has device tree boot support, and the device tree version does not support CONFIG_LEDS_VERSATILE. Instead select CONFIG_LEDS_SYSCON and MFD_SYSCON, so we can get LEDs support from the same generic driver that drives most other ARM reference boards.

Applied to next/defconfig, thanks!

Arnd

#7 lore raw

cover Add LEDs support for the ARM Versatile DT

In reply to Linus Walleij
Quoted 11 lines · On Tuesday 05 January 2016 15:02:07 Linus Walleij wrote:

This adds support for the board LEDs to the ARM Versatile device tree version.

I can't decice if this is a regression or not. The board file version of Versatile supported the LEDs, the Device Tree version never did until now.

The board file version of Versatile was deleted in commit 16956fed35fecde2201e23458cda193526b19559
"ARM: versatile: switch to DT only booting and remove legacy code"

Quoted 7 lines

If we consider the DT version a full drop-in replacement for the board file version, then this should go in as a regression fix. If it is not, we can delay it to the next merge window.

Sending this to arm at kernel.org anyway so the ARM SoC maintainers can decide.

It's really late, but I'd consider them sort-of fixes, and they seem rather harmless, so I've put them in.

Arnd