diff mbox

[1/2] OMAP4: board-omap4panda.c: adding leds status1 and status2

Message ID 1283201896-19046-2-git-send-email-ricardo.salveti@canonical.com
State Accepted
Delegated to: Leann Ogasawara
Headers show

Commit Message

Ricardo Salveti de Araujo Aug. 30, 2010, 8:58 p.m. UTC
At Pandaboard we have 2 status leds, so adding them with similar usage as
we have for Beagleboard (heartbeat and mmc0).

Signed-off-by: Ricardo Salveti de Araujo <ricardo.salveti@canonical.com>
---
 arch/arm/mach-omap2/board-omap4panda.c |   29 +++++++++++++++++++++++++++++
 1 files changed, 29 insertions(+), 0 deletions(-)
diff mbox

Patch

diff --git a/arch/arm/mach-omap2/board-omap4panda.c b/arch/arm/mach-omap2/board-omap4panda.c
index 692ea25..1d676c6 100644
--- a/arch/arm/mach-omap2/board-omap4panda.c
+++ b/arch/arm/mach-omap2/board-omap4panda.c
@@ -20,6 +20,7 @@ 
 #include <linux/init.h>
 #include <linux/platform_device.h>
 #include <linux/io.h>
+#include <linux/leds.h>
 #include <linux/gpio.h>
 #include <linux/usb/otg.h>
 #include <linux/i2c/twl.h>
@@ -68,6 +69,32 @@  struct platform_device *st_get_plat_device(void)
 }
 EXPORT_SYMBOL(st_get_plat_device);
 
+static struct gpio_led gpio_leds[] = {
+	{
+		.name			= "pandaboard::status1",
+		.default_trigger	= "heartbeat",
+		.gpio			= 7,
+	},
+	{
+		.name			= "pandaboard::status2",
+		.default_trigger	= "mmc0",
+		.gpio			= 8,
+	},
+};
+
+static struct gpio_led_platform_data gpio_led_info = {
+	.leds		= gpio_leds,
+	.num_leds	= ARRAY_SIZE(gpio_leds),
+};
+
+static struct platform_device leds_gpio = {
+	.name	= "leds-gpio",
+	.id	= -1,
+	.dev	= {
+		.platform_data	= &gpio_led_info,
+	},
+};
+
 #ifdef CONFIG_OMAP2_DSS_HDMI
 static struct platform_device sdp4430_hdmi_audio_device = {
 	.name		= "hdmi-dai",
@@ -122,6 +149,7 @@  static struct omap_dss_board_info panda_dss_data = {
 };
 
 static struct platform_device *panda_devices[] __initdata = {
+	&leds_gpio,
 	&sdp4430_hdmi_audio_device,
 	&wl127x_device
 };
@@ -138,6 +166,7 @@  static void __init omap4_display_init(void)
 #else
 
 static struct platform_device *panda_devices[] __initdata = {
+	&leds_gpio,
 	&wl127x_device,
 	&panda_dss_device,
 	&sdp4430_hdmi_audio_device,