diff options
author | Anand Gadiyar <gadiyar@ti.com> | 2012-05-21 16:00:12 +0530 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2012-05-21 21:40:33 +0200 |
commit | b53c3e5c4a21d37e95577a5da65da1af2686b856 (patch) | |
tree | 524f71fc870731242df253540df58acaa6c00fed /arch | |
parent | 0da6a0f0649f76c9bbfb097824478a9f2900d2a1 (diff) | |
download | barebox-b53c3e5c4a21d37e95577a5da65da1af2686b856.tar.gz barebox-b53c3e5c4a21d37e95577a5da65da1af2686b856.tar.xz |
panda: add LED support
Register GPIO7 as heartbeat LED, same as in the linux kernel.
Signed-off-by: Anand Gadiyar <gadiyar@ti.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/boards/panda/board.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/arch/arm/boards/panda/board.c b/arch/arm/boards/panda/board.c index 669e9b33c0..66085fb414 100644 --- a/arch/arm/boards/panda/board.c +++ b/arch/arm/boards/panda/board.c @@ -21,6 +21,8 @@ #include <environment.h> #include <mach/xload.h> #include <i2c/i2c.h> +#include <gpio.h> +#include <led.h> static int board_revision; @@ -112,6 +114,22 @@ static struct i2c_board_info i2c_devices[] = { }, }; +struct gpio_led panda_leds[] = { + { + .gpio = 7, + .led = { + .name = "heartbeat", + }, + }, +}; + +static void panda_led_init(void) +{ + gpio_direction_output(7, 0); + led_gpio_register(&panda_leds[0]); + led_set_trigger(LED_TRIGGER_HEARTBEAT, &panda_leds[0].led); +} + static int panda_devices_init(void) { panda_boardrev_init(); @@ -150,6 +168,7 @@ static int panda_devices_init(void) IORESOURCE_MEM, NULL); panda_ehci_init(); + panda_led_init(); armlinux_set_bootparams((void *)0x80000100); armlinux_set_architecture(MACH_TYPE_OMAP4_PANDA); |