[PATCH linux] barreleye: Add gpio LEDs to device tree

OpenBMC Patches openbmc-patches at stwcx.xyz
Wed Dec 16 09:20:25 AEDT 2015


From: Jeremy Kerr <jk at ozlabs.org>

This change exposes the LEDs (which are connected to GPIOs) on
barreleye and palmetto machines as led-class devices. This allows
us to use the full trigger support.

Signed-off-by: Jeremy Kerr <jk at ozlabs.org>
---
 arch/arm/boot/dts/aspeed-bmc-opp-barreleye.dts | 19 +++++++++++++++++++
 arch/arm/boot/dts/aspeed-bmc-opp-palmetto.dts  | 18 ++++++++++++++++++
 arch/arm/boot/dts/ast2400.dtsi                 |  2 ++
 3 files changed, 39 insertions(+)

diff --git a/arch/arm/boot/dts/aspeed-bmc-opp-barreleye.dts b/arch/arm/boot/dts/aspeed-bmc-opp-barreleye.dts
index 4d1a215..38a4fd0 100644
--- a/arch/arm/boot/dts/aspeed-bmc-opp-barreleye.dts
+++ b/arch/arm/boot/dts/aspeed-bmc-opp-barreleye.dts
@@ -1,6 +1,7 @@
 /dts-v1/;
 
 #include "ast2400.dtsi"
+#include <dt-bindings/gpio/gpio.h>
 
 / {
 	model = "Barrelye BMC";
@@ -38,5 +39,23 @@
 			};
 		};
 	};
+
+
+	leds {
+		compatible = "gpio-leds";
+
+		heartbeat {
+			gpios = <&gpio 140 GPIO_ACTIVE_LOW>;
+		};
+
+		power {
+			gpios = <&gpio 141 GPIO_ACTIVE_LOW>;
+		};
+
+		identify {
+			gpios = <&gpio 2 GPIO_ACTIVE_LOW>;
+		};
+
+	};
 };
 
diff --git a/arch/arm/boot/dts/aspeed-bmc-opp-palmetto.dts b/arch/arm/boot/dts/aspeed-bmc-opp-palmetto.dts
index 2c3e824..92a7c77 100644
--- a/arch/arm/boot/dts/aspeed-bmc-opp-palmetto.dts
+++ b/arch/arm/boot/dts/aspeed-bmc-opp-palmetto.dts
@@ -1,6 +1,7 @@
 /dts-v1/;
 
 #include "ast2400.dtsi"
+#include <dt-bindings/gpio/gpio.h>
 
 / {
 	model = "Palmetto BMC";
@@ -31,4 +32,21 @@
 			};
 		};
 	};
+
+	leds {
+		compatible = "gpio-leds";
+
+		heartbeat {
+			gpios = <&gpio 140 GPIO_ACTIVE_LOW>;
+		};
+
+		power {
+			gpios = <&gpio 141 GPIO_ACTIVE_LOW>;
+		};
+
+		identify {
+			gpios = <&gpio 2 GPIO_ACTIVE_LOW>;
+		};
+
+	};
 };
diff --git a/arch/arm/boot/dts/ast2400.dtsi b/arch/arm/boot/dts/ast2400.dtsi
index 21f4875..20b5db3 100644
--- a/arch/arm/boot/dts/ast2400.dtsi
+++ b/arch/arm/boot/dts/ast2400.dtsi
@@ -287,6 +287,8 @@
 			};
 
 			gpio: gpio at 1e780000 {
+			       #gpio-cells = <2>;
+			       gpio-controller;
 			       compatible = "aspeed,ast2400-gpio";
 			       reg = <0x1e780000 0x1000>;
 			       interrupts = <20>;
-- 
2.6.3




More information about the openbmc mailing list