aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/board-overo.c
diff options
context:
space:
mode:
authorSteve Sakoman <steve@sakoman.com>2011-03-09 19:08:05 -0500
committerTomi Valkeinen <tomi.valkeinen@ti.com>2011-03-11 08:48:24 -0500
commit7c94f68d7b490c7787c6b97c5b2d6d56d57b071c (patch)
treed4fb98f468d15f8cf031415d6e545ded71ae9b00 /arch/arm/mach-omap2/board-overo.c
parentca0a6a6473f69f1773c97755840587262d841883 (diff)
OMAP: Add gpio-leds support for Overo
This patch adds support for the standard LEDs on the Overo COM and expansion boards Signed-off-by: Steve Sakoman <steve@sakoman.com> Acked-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'arch/arm/mach-omap2/board-overo.c')
-rw-r--r--arch/arm/mach-omap2/board-overo.c53
1 files changed, 53 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/board-overo.c b/arch/arm/mach-omap2/board-overo.c
index 4278ecb799a2..e694ebd2636c 100644
--- a/arch/arm/mach-omap2/board-overo.c
+++ b/arch/arm/mach-omap2/board-overo.c
@@ -473,6 +473,52 @@ static struct regulator_consumer_supply overo_vmmc1_supply = {
473 .supply = "vmmc", 473 .supply = "vmmc",
474}; 474};
475 475
476#if defined(CONFIG_LEDS_GPIO) || defined(CONFIG_LEDS_GPIO_MODULE)
477#include <linux/leds.h>
478
479static struct gpio_led gpio_leds[] = {
480 {
481 .name = "overo:red:gpio21",
482 .default_trigger = "heartbeat",
483 .gpio = 21,
484 .active_low = true,
485 },
486 {
487 .name = "overo:blue:gpio22",
488 .default_trigger = "none",
489 .gpio = 22,
490 .active_low = true,
491 },
492 {
493 .name = "overo:blue:COM",
494 .default_trigger = "mmc0",
495 .gpio = -EINVAL, /* gets replaced */
496 .active_low = true,
497 },
498};
499
500static struct gpio_led_platform_data gpio_leds_pdata = {
501 .leds = gpio_leds,
502 .num_leds = ARRAY_SIZE(gpio_leds),
503};
504
505static struct platform_device gpio_leds_device = {
506 .name = "leds-gpio",
507 .id = -1,
508 .dev = {
509 .platform_data = &gpio_leds_pdata,
510 },
511};
512
513static void __init overo_init_led(void)
514{
515 platform_device_register(&gpio_leds_device);
516}
517
518#else
519static inline void __init overo_init_led(void) { return; }
520#endif
521
476static int overo_twl_gpio_setup(struct device *dev, 522static int overo_twl_gpio_setup(struct device *dev,
477 unsigned gpio, unsigned ngpio) 523 unsigned gpio, unsigned ngpio)
478{ 524{
@@ -480,6 +526,11 @@ static int overo_twl_gpio_setup(struct device *dev,
480 526
481 overo_vmmc1_supply.dev = mmc[0].dev; 527 overo_vmmc1_supply.dev = mmc[0].dev;
482 528
529#if defined(CONFIG_LEDS_GPIO) || defined(CONFIG_LEDS_GPIO_MODULE)
530 /* TWL4030_GPIO_MAX + 1 == ledB, PMU_STAT (out, active low LED) */
531 gpio_leds[2].gpio = gpio + TWL4030_GPIO_MAX + 1;
532#endif
533
483 return 0; 534 return 0;
484} 535}
485 536
@@ -487,6 +538,7 @@ static struct twl4030_gpio_platform_data overo_gpio_data = {
487 .gpio_base = OMAP_MAX_GPIO_LINES, 538 .gpio_base = OMAP_MAX_GPIO_LINES,
488 .irq_base = TWL4030_GPIO_IRQ_BASE, 539 .irq_base = TWL4030_GPIO_IRQ_BASE,
489 .irq_end = TWL4030_GPIO_IRQ_END, 540 .irq_end = TWL4030_GPIO_IRQ_END,
541 .use_leds = true,
490 .setup = overo_twl_gpio_setup, 542 .setup = overo_twl_gpio_setup,
491}; 543};
492 544
@@ -648,6 +700,7 @@ static void __init overo_init(void)
648 overo_spi_init(); 700 overo_spi_init();
649 overo_init_smsc911x(); 701 overo_init_smsc911x();
650 overo_display_init(); 702 overo_display_init();
703 overo_init_led();
651 704
652 /* Ensure SDRC pins are mux'd for self-refresh */ 705 /* Ensure SDRC pins are mux'd for self-refresh */
653 omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT); 706 omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT);