* [PATCH] omap4: board-omap4panda: adding leds status1 and status2
@ 2010-09-06 22:02 Ricardo Salveti de Araujo
2010-09-23 18:17 ` Tony Lindgren
0 siblings, 1 reply; 2+ messages in thread
From: Ricardo Salveti de Araujo @ 2010-09-06 22:02 UTC (permalink / raw)
To: linux-omap; +Cc: Bryan Wu, Ricardo Salveti de Araujo
At Pandaboard we have 2 status leds, so adding them with similar usage as
we have for Beagleboard (heartbeat and mmc0). The patch basically adds the
platform data required by leds-gpio driver.
Signed-off-by: Ricardo Salveti de Araujo <ricardo.salveti@canonical.com>
---
arch/arm/mach-omap2/board-omap4panda.c | 32 ++++++++++++++++++++++++++++++++
1 files changed, 32 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-omap2/board-omap4panda.c b/arch/arm/mach-omap2/board-omap4panda.c
index 96f5bbb..e67bd2c 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>
@@ -40,6 +41,36 @@
#include "hsmmc.h"
+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,
+ },
+};
+
+static struct platform_device *panda_devices[] __initdata = {
+ &leds_gpio,
+};
+
static void __init omap4_panda_init_irq(void)
{
omap2_init_common_hw(NULL, NULL);
@@ -275,6 +306,7 @@ static int __init omap4_panda_i2c_init(void)
static void __init omap4_panda_init(void)
{
omap4_panda_i2c_init();
+ platform_add_devices(panda_devices, ARRAY_SIZE(panda_devices));
omap_serial_init();
omap4_twl6030_hsmmc_init(mmc);
/* OMAP4 Panda uses internal transceiver so register nop transceiver */
--
1.7.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] omap4: board-omap4panda: adding leds status1 and status2
2010-09-06 22:02 [PATCH] omap4: board-omap4panda: adding leds status1 and status2 Ricardo Salveti de Araujo
@ 2010-09-23 18:17 ` Tony Lindgren
0 siblings, 0 replies; 2+ messages in thread
From: Tony Lindgren @ 2010-09-23 18:17 UTC (permalink / raw)
To: Ricardo Salveti de Araujo; +Cc: linux-omap, Bryan Wu
* Ricardo Salveti de Araujo <ricardo.salveti@canonical.com> [100906 14:55]:
> At Pandaboard we have 2 status leds, so adding them with similar usage as
> we have for Beagleboard (heartbeat and mmc0). The patch basically adds the
> platform data required by leds-gpio driver.
Adding this, thanks.
Tony
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-09-23 18:17 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-06 22:02 [PATCH] omap4: board-omap4panda: adding leds status1 and status2 Ricardo Salveti de Araujo
2010-09-23 18:17 ` Tony Lindgren
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.