From: Ricardo Salveti de Araujo Date: Fri, 24 Sep 2010 01:22:49 +0000 (-0700) Subject: omap4: board-omap4panda: adding leds status1 and status2 X-Git-Tag: v2.6.37-rc1~121^2~50^2 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=3da434acd4f7c7f5aeebd44fed42bf5ed9adfc44;p=~shefty%2Frdma-dev.git omap4: board-omap4panda: adding leds status1 and status2 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 Signed-off-by: Tony Lindgren --- diff --git a/arch/arm/mach-omap2/board-omap4panda.c b/arch/arm/mach-omap2/board-omap4panda.c index c03d1d56db5..22a8fd30f9f 100644 --- a/arch/arm/mach-omap2/board-omap4panda.c +++ b/arch/arm/mach-omap2/board-omap4panda.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -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); @@ -277,6 +308,7 @@ static void __init omap4_panda_init(void) int status; 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 */