Skip to contentSkip to conversation

sunxi: a10-cubieboard: Add user LEDs to the device tree

PATCH New Emilio López 2 participants 2 messages Jan 28, 2013 – Feb 3, 2013

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

PATCH 1/1 sunxi: a10-cubieboard: Add user LEDs to the device tree

Cubieboard has two LEDs available for use, a blue one (labeled LED1) and a green one (labeled LED2).

---
This patch requires all of the sunxi pinctrl/gpio/led patches by Maxime Ripard to function.

 arch/arm/boot/dts/sun4i-a10-cubieboard.dts | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)
arch/arm/boot/dts/sun4i-a10-cubieboard.dts +26 -0
index 5cab825..88e2dc1 100644
@@ -27,6 +27,15 @@
 	};
 
 	soc {
+		pinctrl at 01c20800 {
+			led_pins_cubieboard: led_pins at 0 {
+				allwinner,pins = "PH20", "PH21";
+				allwinner,function = "gpio_out";
+				allwinner,drive = <1>;
+				allwinner,pull = <0>;
+			};
+		};
+
 		uart0: uart at 01c28000 {
 			status = "okay";
 		};
@@ -35,4 +44,21 @@
 			status = "okay";
 		};
 	};
+
+	leds {
+		compatible = "gpio-leds";
+		pinctrl-names = "default";
+		pinctrl-0 = <&led_pins_cubieboard>;
+
+		blue {
+			label = "cubieboard::blue";
+			gpios = <&pio 7 21 0>; /* LED1 */
+		};
+
+		green {
+			label = "cubieboard::green";
+			gpios = <&pio 7 20 0>; /* LED2 */
+			linux,default-trigger = "heartbeat";
+		};
+	};
 };
Signature · 1 line
1.8.1.1
#1 lore raw

PATCH 1/1 sunxi: a10-cubieboard: Add user LEDs to the device tree

Le 28/01/2013 12:27, Emilio L?pez a ?crit :

Quoted 2 lines

Cubieboard has two LEDs available for use, a blue one (labeled LED1) and a green one (labeled LED2).

Applied, thanks.

Maxime

Signature · 4 lines
Maxime Ripard, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com