diff options
author | Kevin Hilman <khilman@deeprootsystems.com> | 2009-10-02 11:17:56 -0400 |
---|---|---|
committer | Kevin Hilman <khilman@deeprootsystems.com> | 2010-02-23 14:05:04 -0500 |
commit | a4b41d8ed805e90bd855ac572eaeb13901d4af32 (patch) | |
tree | 7639aeeaea6db55e845685f17b5d81ae582c61eb /arch | |
parent | 709731bb369b562586ee4c60f3f0393eb94dd9d6 (diff) |
OMAP3: RX-51: support sleep indicator LEDs
The sleep indicator LEDs can be enabled/disabled by toggling GPIO162.
Use the LED GPIO class to export this LED functionality to userspace.
To enable:
# echo 1 > /sys/class/leds/sleep_ind/brightness
To disable:
# echo 0 > /sys/class/leds/sleep_ind/brightness
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-omap2/board-rx51.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/board-rx51.c b/arch/arm/mach-omap2/board-rx51.c index 6a49f916103d..26b70dab28cc 100644 --- a/arch/arm/mach-omap2/board-rx51.c +++ b/arch/arm/mach-omap2/board-rx51.c | |||
@@ -16,6 +16,7 @@ | |||
16 | #include <linux/clk.h> | 16 | #include <linux/clk.h> |
17 | #include <linux/io.h> | 17 | #include <linux/io.h> |
18 | #include <linux/gpio.h> | 18 | #include <linux/gpio.h> |
19 | #include <linux/leds.h> | ||
19 | 20 | ||
20 | #include <mach/hardware.h> | 21 | #include <mach/hardware.h> |
21 | #include <asm/mach-types.h> | 22 | #include <asm/mach-types.h> |
@@ -31,8 +32,30 @@ | |||
31 | 32 | ||
32 | #include "mux.h" | 33 | #include "mux.h" |
33 | 34 | ||
35 | #define RX51_GPIO_SLEEP_IND 162 | ||
36 | |||
34 | struct omap_sdrc_params *rx51_get_sdram_timings(void); | 37 | struct omap_sdrc_params *rx51_get_sdram_timings(void); |
35 | 38 | ||
39 | static struct gpio_led gpio_leds[] = { | ||
40 | { | ||
41 | .name = "sleep_ind", | ||
42 | .gpio = RX51_GPIO_SLEEP_IND, | ||
43 | }, | ||
44 | }; | ||
45 | |||
46 | static struct gpio_led_platform_data gpio_led_info = { | ||
47 | .leds = gpio_leds, | ||
48 | .num_leds = ARRAY_SIZE(gpio_leds), | ||
49 | }; | ||
50 | |||
51 | static struct platform_device leds_gpio = { | ||
52 | .name = "leds-gpio", | ||
53 | .id = -1, | ||
54 | .dev = { | ||
55 | .platform_data = &gpio_led_info, | ||
56 | }, | ||
57 | }; | ||
58 | |||
36 | static struct omap_lcd_config rx51_lcd_config = { | 59 | static struct omap_lcd_config rx51_lcd_config = { |
37 | .ctrl_name = "internal", | 60 | .ctrl_name = "internal", |
38 | }; | 61 | }; |
@@ -88,6 +111,8 @@ static void __init rx51_init(void) | |||
88 | /* Ensure SDRC pins are mux'd for self-refresh */ | 111 | /* Ensure SDRC pins are mux'd for self-refresh */ |
89 | omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT); | 112 | omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT); |
90 | omap_mux_init_signal("sdrc_cke1", OMAP_PIN_OUTPUT); | 113 | omap_mux_init_signal("sdrc_cke1", OMAP_PIN_OUTPUT); |
114 | |||
115 | platform_device_register(&leds_gpio); | ||
91 | } | 116 | } |
92 | 117 | ||
93 | static void __init rx51_map_io(void) | 118 | static void __init rx51_map_io(void) |