aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-at91/board-sam9rlek.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-at91/board-sam9rlek.c')
-rw-r--r--arch/arm/mach-at91/board-sam9rlek.c79
1 files changed, 79 insertions, 0 deletions
diff --git a/arch/arm/mach-at91/board-sam9rlek.c b/arch/arm/mach-at91/board-sam9rlek.c
index f6b5672cabd6..9d07679efce7 100644
--- a/arch/arm/mach-at91/board-sam9rlek.c
+++ b/arch/arm/mach-at91/board-sam9rlek.c
@@ -15,6 +15,8 @@
15#include <linux/spi/spi.h> 15#include <linux/spi/spi.h>
16#include <linux/fb.h> 16#include <linux/fb.h>
17#include <linux/clk.h> 17#include <linux/clk.h>
18#include <linux/input.h>
19#include <linux/gpio_keys.h>
18 20
19#include <video/atmel_lcdc.h> 21#include <video/atmel_lcdc.h>
20 22
@@ -208,6 +210,79 @@ static struct atmel_lcdfb_info __initdata ek_lcdc_data;
208#endif 210#endif
209 211
210 212
213/*
214 * LEDs
215 */
216static struct gpio_led ek_leds[] = {
217 { /* "bottom" led, green, userled1 to be defined */
218 .name = "ds1",
219 .gpio = AT91_PIN_PD15,
220 .active_low = 1,
221 .default_trigger = "none",
222 },
223 { /* "bottom" led, green, userled2 to be defined */
224 .name = "ds2",
225 .gpio = AT91_PIN_PD16,
226 .active_low = 1,
227 .default_trigger = "none",
228 },
229 { /* "power" led, yellow */
230 .name = "ds3",
231 .gpio = AT91_PIN_PD14,
232 .default_trigger = "heartbeat",
233 }
234};
235
236
237/*
238 * GPIO Buttons
239 */
240#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
241static struct gpio_keys_button ek_buttons[] = {
242 {
243 .gpio = AT91_PIN_PB0,
244 .code = BTN_2,
245 .desc = "Right Click",
246 .active_low = 1,
247 .wakeup = 1,
248 },
249 {
250 .gpio = AT91_PIN_PB1,
251 .code = BTN_1,
252 .desc = "Left Click",
253 .active_low = 1,
254 .wakeup = 1,
255 }
256};
257
258static struct gpio_keys_platform_data ek_button_data = {
259 .buttons = ek_buttons,
260 .nbuttons = ARRAY_SIZE(ek_buttons),
261};
262
263static struct platform_device ek_button_device = {
264 .name = "gpio-keys",
265 .id = -1,
266 .num_resources = 0,
267 .dev = {
268 .platform_data = &ek_button_data,
269 }
270};
271
272static void __init ek_add_device_buttons(void)
273{
274 at91_set_gpio_input(AT91_PIN_PB1, 1); /* btn1 */
275 at91_set_deglitch(AT91_PIN_PB1, 1);
276 at91_set_gpio_input(AT91_PIN_PB0, 1); /* btn2 */
277 at91_set_deglitch(AT91_PIN_PB0, 1);
278
279 platform_device_register(&ek_button_device);
280}
281#else
282static void __init ek_add_device_buttons(void) {}
283#endif
284
285
211static void __init ek_board_init(void) 286static void __init ek_board_init(void)
212{ 287{
213 /* Serial */ 288 /* Serial */
@@ -226,6 +301,10 @@ static void __init ek_board_init(void)
226 at91_add_device_lcdc(&ek_lcdc_data); 301 at91_add_device_lcdc(&ek_lcdc_data);
227 /* Touch Screen Controller */ 302 /* Touch Screen Controller */
228 at91_add_device_tsadcc(); 303 at91_add_device_tsadcc();
304 /* LEDs */
305 at91_gpio_leds(ek_leds, ARRAY_SIZE(ek_leds));
306 /* Push Buttons */
307 ek_add_device_buttons();
229} 308}
230 309
231MACHINE_START(AT91SAM9RLEK, "Atmel AT91SAM9RL-EK") 310MACHINE_START(AT91SAM9RLEK, "Atmel AT91SAM9RL-EK")