diff options
author | Hartley Sweeten <hartleys@visionengravers.com> | 2009-07-20 21:22:36 +0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2009-07-21 20:20:48 +0400 |
commit | 3aa7a9a3cf8774f6701b1903a6353f9545f561ce (patch) | |
tree | b370a85625ae8c3e0ffc9ac62d84e468734d12ef /arch | |
parent | 5d43f11bcf854d83b24c7ca6bb15d9ab9130159f (diff) | |
download | linux-3aa7a9a3cf8774f6701b1903a6353f9545f561ce.tar.xz |
[ARM] 5612/1: ep93xx: add platform LEDs
The EP93xx has two gpio pins specifically assigned to drive
external LEDs. Add core support for these LEDs.
On the EDB93xx development boards, the rdled is connected to
an external reset circuit. Turning this led on for an extended
amount of time will cause the circuit to issue a manual reset.
Refer to Cirrus App Note AN258 for more information.
http://www.cirrus.com/en/pubs/appNote/AN258REV2.pdf
This led can be safely used as the system heartbeat with the
ledtrig-heartbeat driver.
echo heartbeat > /sys/class/leds/platform:rdled/trigger
The grled can be used for any desired purpose.
Tested-by: Matthieu Crapet <mcrapet@gmail.com>
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-ep93xx/core.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/arch/arm/mach-ep93xx/core.c b/arch/arm/mach-ep93xx/core.c index b390c35f8bc1..2b58df0184c1 100644 --- a/arch/arm/mach-ep93xx/core.c +++ b/arch/arm/mach-ep93xx/core.c @@ -22,6 +22,7 @@ #include <linux/timex.h> #include <linux/io.h> #include <linux/gpio.h> +#include <linux/leds.h> #include <linux/termios.h> #include <linux/amba/bus.h> #include <linux/amba/serial.h> @@ -568,6 +569,34 @@ void __init ep93xx_register_i2c(struct i2c_board_info *devices, int num) platform_device_register(&ep93xx_i2c_device); } + +/************************************************************************* + * EP93xx LEDs + *************************************************************************/ +static struct gpio_led ep93xx_led_pins[] = { + { + .name = "platform:grled", + .gpio = EP93XX_GPIO_LINE_GRLED, + }, { + .name = "platform:rdled", + .gpio = EP93XX_GPIO_LINE_RDLED, + }, +}; + +static struct gpio_led_platform_data ep93xx_led_data = { + .num_leds = ARRAY_SIZE(ep93xx_led_pins), + .leds = ep93xx_led_pins, +}; + +static struct platform_device ep93xx_leds = { + .name = "leds-gpio", + .id = -1, + .dev = { + .platform_data = &ep93xx_led_data, + }, +}; + + extern void ep93xx_gpio_init(void); void __init ep93xx_init_devices(void) @@ -583,4 +612,5 @@ void __init ep93xx_init_devices(void) platform_device_register(&ep93xx_rtc_device); platform_device_register(&ep93xx_ohci_device); + platform_device_register(&ep93xx_leds); } |