Skip to contentSkip to conversation

arm: mvebu: Add GPIO LEDs to Mirabox board

PATCH New Ryan Press 4 participants 4 messages Mar 29, 2013 – Mar 31, 2013 Device tree bindings

lore
Share & tools
lore

Ryan Press

author
#0 lore raw

PATCH 1/1 arm: mvebu: Add GPIO LEDs to Mirabox board

Add the three external LED definitions to the device tree file on the Mirabox.

The Mirabox user guide calls out one as a power LED, and the other two are defined for WiFi, but as the current mwifiex drivers don't have LED support, we make them status LEDs.

These have been tested working by writing to the appropriate /sys/class/leds trigger.

---
 arch/arm/boot/dts/armada-370-mirabox.dts | 37 ++++++++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)
arch/arm/boot/dts/armada-370-mirabox.dts +37 -0
index dd0c57d..242796e 100644
@@ -33,6 +33,43 @@
 			clock-frequency = <600000000>;
 			status = "okay";
 		};
+
+		pinctrl {
+			pwr_led_pin: pwr-led-pin {
+				marvell,pins = "mpp63";
+				marvell,function = "gpo";
+			};
+
+			stat_led_pins: stat-led-pins {
+				marvell,pins = "mpp64", "mpp65";
+				marvell,function = "gpio";
+			};
+		};
+
+		gpio_leds {
+			compatible = "gpio-leds";
+			pinctrl-names = "default";
+			pinctrl-0 = <&pwr_led_pin &stat_led_pins>;
+
+			green_pwr_led {
+				label = "mirabox:green:pwr";
+				gpios = <&gpio1 31 1>;
+				linux,default-trigger = "heartbeat";
+			};
+
+			blue_stat_led {
+				label = "mirabox:blue:stat";
+				gpios = <&gpio2 0 1>;
+				linux,default-trigger = "cpu0";
+			};
+
+			green_stat_led {
+				label = "mirabox:green:stat";
+				gpios = <&gpio2 1 1>;
+				default-state = "off";
+			};
+		};
+
 		mdio {
 			phy0: ethernet-phy at 0 {
 				reg = <0>;
Signature · 1 line
1.8.1.2
#1 lore raw

PATCH 1/1 arm: mvebu: Add GPIO LEDs to Mirabox board

Quoted 7 lines · Ryan Press

Add the three external LED definitions to the device tree file on the Mirabox.

The Mirabox user guide calls out one as a power LED, and the other two are defined for WiFi, but as the current mwifiex drivers don't have LED support, we make them status LEDs.

Quoted 7 lines

These have been tested working by writing to the appropriate /sys/class/leds trigger.

---
arch/arm/boot/dts/armada-370-mirabox.dts | 37 ++++++++++++++++++++++++++++++++

1 file changed, 37 insertions(+)

Cheers,
Neil

#2 lore raw

PATCH 1/1 arm: mvebu: Add GPIO LEDs to Mirabox board

Quoted 13 lines · Neil Greatorex
Quoted 10 lines · Ryan Press

Add the three external LED definitions to the device tree file on the Mirabox.

The Mirabox user guide calls out one as a power LED, and the other two are defined for WiFi, but as the current mwifiex drivers don't have LED support, we make them status LEDs.

These have been tested working by writing to the appropriate /sys/class/leds trigger.

Quoted 7 lines
Quoted 4 lines

---
arch/arm/boot/dts/armada-370-mirabox.dts | 37 ++++++++++++++++++++++++++++++++

1 file changed, 37 insertions(+)
Signature · 3 lines
Ezequiel Garc?a, Free Electrons
Embedded Linux, Kernel and Android Engineering
http://free-electrons.com
Applied
#3 lore raw

PATCH 1/1 arm: mvebu: Add GPIO LEDs to Mirabox board

In reply to Ryan Press
Quoted 7 lines · Ryan Press

Add the three external LED definitions to the device tree file on the Mirabox.

The Mirabox user guide calls out one as a power LED, and the other two are defined for WiFi, but as the current mwifiex drivers don't have LED support, we make them status LEDs.

Quoted 7 lines

These have been tested working by writing to the appropriate /sys/class/leds trigger.

---
 arch/arm/boot/dts/armada-370-mirabox.dts | 37 ++++++++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)

Applied to mvebu/dt

thx,

Jason.