diff options
author | Paul Mundt <lethal@linux-sh.org> | 2008-10-21 01:27:51 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2008-10-21 01:27:51 -0400 |
commit | bbc97411d11b3a835c62904fddb5ce9ff457f5fa (patch) | |
tree | c250fe2d54b10b28a5a919ad0238eca3515db65f /arch/sh | |
parent | 10bfc6e190c55b583ec312a6a8ef274924e16d8a (diff) |
sh: rsk7203: leds-gpio support for RSK+ LEDs.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh')
-rw-r--r-- | arch/sh/boards/board-rsk7203.c | 42 |
1 files changed, 37 insertions, 5 deletions
diff --git a/arch/sh/boards/board-rsk7203.c b/arch/sh/boards/board-rsk7203.c index c8114cdb95e8..58266f06134a 100644 --- a/arch/sh/boards/board-rsk7203.c +++ b/arch/sh/boards/board-rsk7203.c | |||
@@ -17,6 +17,7 @@ | |||
17 | #include <linux/mtd/map.h> | 17 | #include <linux/mtd/map.h> |
18 | #include <linux/smc911x.h> | 18 | #include <linux/smc911x.h> |
19 | #include <linux/gpio.h> | 19 | #include <linux/gpio.h> |
20 | #include <linux/leds.h> | ||
20 | #include <asm/machvec.h> | 21 | #include <asm/machvec.h> |
21 | #include <asm/io.h> | 22 | #include <asm/io.h> |
22 | #include <cpu/sh7203.h> | 23 | #include <cpu/sh7203.h> |
@@ -116,10 +117,46 @@ static void __init set_mtd_partitions(void) | |||
116 | } | 117 | } |
117 | } | 118 | } |
118 | 119 | ||
120 | static struct gpio_led rsk7203_gpio_leds[] = { | ||
121 | { | ||
122 | .name = "green", | ||
123 | .gpio = GPIO_PE10, | ||
124 | .active_low = 1, | ||
125 | }, { | ||
126 | .name = "orange", | ||
127 | .default_trigger = "nand-disk", | ||
128 | .gpio = GPIO_PE12, | ||
129 | .active_low = 1, | ||
130 | }, { | ||
131 | .name = "red:timer", | ||
132 | .default_trigger = "timer", | ||
133 | .gpio = GPIO_PC14, | ||
134 | .active_low = 1, | ||
135 | }, { | ||
136 | .name = "red:heartbeat", | ||
137 | .default_trigger = "heartbeat", | ||
138 | .gpio = GPIO_PE11, | ||
139 | .active_low = 1, | ||
140 | }, | ||
141 | }; | ||
142 | |||
143 | static struct gpio_led_platform_data rsk7203_gpio_leds_info = { | ||
144 | .leds = rsk7203_gpio_leds, | ||
145 | .num_leds = ARRAY_SIZE(rsk7203_gpio_leds), | ||
146 | }; | ||
147 | |||
148 | static struct platform_device led_device = { | ||
149 | .name = "leds-gpio", | ||
150 | .id = -1, | ||
151 | .dev = { | ||
152 | .platform_data = &rsk7203_gpio_leds_info, | ||
153 | }, | ||
154 | }; | ||
119 | 155 | ||
120 | static struct platform_device *rsk7203_devices[] __initdata = { | 156 | static struct platform_device *rsk7203_devices[] __initdata = { |
121 | &smc911x_device, | 157 | &smc911x_device, |
122 | &flash_device, | 158 | &flash_device, |
159 | &led_device, | ||
123 | }; | 160 | }; |
124 | 161 | ||
125 | static int __init rsk7203_devices_setup(void) | 162 | static int __init rsk7203_devices_setup(void) |
@@ -128,11 +165,6 @@ static int __init rsk7203_devices_setup(void) | |||
128 | gpio_request(GPIO_FN_TXD0, NULL); | 165 | gpio_request(GPIO_FN_TXD0, NULL); |
129 | gpio_request(GPIO_FN_RXD0, NULL); | 166 | gpio_request(GPIO_FN_RXD0, NULL); |
130 | 167 | ||
131 | /* Lit LED0 */ | ||
132 | gpio_request(GPIO_PE10, NULL); | ||
133 | gpio_direction_output(GPIO_PE10, 0); | ||
134 | gpio_export(GPIO_PE10, 0); | ||
135 | |||
136 | set_mtd_partitions(); | 168 | set_mtd_partitions(); |
137 | return platform_add_devices(rsk7203_devices, | 169 | return platform_add_devices(rsk7203_devices, |
138 | ARRAY_SIZE(rsk7203_devices)); | 170 | ARRAY_SIZE(rsk7203_devices)); |