diff options
author | David Brownell <david-b@pacbell.net> | 2008-01-14 02:53:22 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2008-01-27 12:54:16 -0500 |
commit | eaf858a988a4b7b34a6ae03a3ac52cdf25013892 (patch) | |
tree | dfadf79705caf0a82f28a337cd1f5493fd4ca5c1 /arch/arm/mach-at91 | |
parent | 86640cae60147b0cd2705145de8067e24db70a8b (diff) |
[ARM] 4615/4: sam926[13]ek buttons updated
From: Nicolas Ferre <nicolas.ferre@rfo.atmel.com>
On the at92sam9263ek board, tell the input subsystem about the buttons.
This patch is taken from Andrew Victor's at91 patchset, then updated to
match the latest kernel code and to use labels printed on the board.
Also update the at91sam9261ek buttons to cope with input changes.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Acked-by: Andrew Victor <linux@maxim.org.za>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-at91')
-rw-r--r-- | arch/arm/mach-at91/board-sam9261ek.c | 8 | ||||
-rw-r--r-- | arch/arm/mach-at91/board-sam9263ek.c | 53 |
2 files changed, 57 insertions, 4 deletions
diff --git a/arch/arm/mach-at91/board-sam9261ek.c b/arch/arm/mach-at91/board-sam9261ek.c index 594c5c100ef9..aa29ea58ca09 100644 --- a/arch/arm/mach-at91/board-sam9261ek.c +++ b/arch/arm/mach-at91/board-sam9261ek.c | |||
@@ -404,25 +404,25 @@ static struct atmel_lcdfb_info __initdata ek_lcdc_data; | |||
404 | static struct gpio_keys_button ek_buttons[] = { | 404 | static struct gpio_keys_button ek_buttons[] = { |
405 | { | 405 | { |
406 | .gpio = AT91_PIN_PA27, | 406 | .gpio = AT91_PIN_PA27, |
407 | .keycode = BTN_0, | 407 | .code = BTN_0, |
408 | .desc = "Button 0", | 408 | .desc = "Button 0", |
409 | .active_low = 1, | 409 | .active_low = 1, |
410 | }, | 410 | }, |
411 | { | 411 | { |
412 | .gpio = AT91_PIN_PA26, | 412 | .gpio = AT91_PIN_PA26, |
413 | .keycode = BTN_1, | 413 | .code = BTN_1, |
414 | .desc = "Button 1", | 414 | .desc = "Button 1", |
415 | .active_low = 1, | 415 | .active_low = 1, |
416 | }, | 416 | }, |
417 | { | 417 | { |
418 | .gpio = AT91_PIN_PA25, | 418 | .gpio = AT91_PIN_PA25, |
419 | .keycode = BTN_2, | 419 | .code = BTN_2, |
420 | .desc = "Button 2", | 420 | .desc = "Button 2", |
421 | .active_low = 1, | 421 | .active_low = 1, |
422 | }, | 422 | }, |
423 | { | 423 | { |
424 | .gpio = AT91_PIN_PA24, | 424 | .gpio = AT91_PIN_PA24, |
425 | .keycode = BTN_3, | 425 | .code = BTN_3, |
426 | .desc = "Button 3", | 426 | .desc = "Button 3", |
427 | .active_low = 1, | 427 | .active_low = 1, |
428 | } | 428 | } |
diff --git a/arch/arm/mach-at91/board-sam9263ek.c b/arch/arm/mach-at91/board-sam9263ek.c index 2df0ff25d147..f09347a86e71 100644 --- a/arch/arm/mach-at91/board-sam9263ek.c +++ b/arch/arm/mach-at91/board-sam9263ek.c | |||
@@ -27,6 +27,8 @@ | |||
27 | #include <linux/spi/spi.h> | 27 | #include <linux/spi/spi.h> |
28 | #include <linux/spi/ads7846.h> | 28 | #include <linux/spi/ads7846.h> |
29 | #include <linux/fb.h> | 29 | #include <linux/fb.h> |
30 | #include <linux/gpio_keys.h> | ||
31 | #include <linux/input.h> | ||
30 | 32 | ||
31 | #include <video/atmel_lcdc.h> | 33 | #include <video/atmel_lcdc.h> |
32 | 34 | ||
@@ -265,6 +267,55 @@ static struct atmel_lcdfb_info __initdata ek_lcdc_data; | |||
265 | 267 | ||
266 | 268 | ||
267 | /* | 269 | /* |
270 | * GPIO Buttons | ||
271 | */ | ||
272 | #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) | ||
273 | static struct gpio_keys_button ek_buttons[] = { | ||
274 | { /* BP1, "leftclic" */ | ||
275 | .code = BTN_LEFT, | ||
276 | .gpio = AT91_PIN_PC5, | ||
277 | .active_low = 1, | ||
278 | .desc = "left_click", | ||
279 | .wakeup = 1, | ||
280 | }, | ||
281 | { /* BP2, "rightclic" */ | ||
282 | .code = BTN_RIGHT, | ||
283 | .gpio = AT91_PIN_PC4, | ||
284 | .active_low = 1, | ||
285 | .desc = "right_click", | ||
286 | .wakeup = 1, | ||
287 | }, | ||
288 | }; | ||
289 | |||
290 | static struct gpio_keys_platform_data ek_button_data = { | ||
291 | .buttons = ek_buttons, | ||
292 | .nbuttons = ARRAY_SIZE(ek_buttons), | ||
293 | }; | ||
294 | |||
295 | static struct platform_device ek_button_device = { | ||
296 | .name = "gpio-keys", | ||
297 | .id = -1, | ||
298 | .num_resources = 0, | ||
299 | .dev = { | ||
300 | .platform_data = &ek_button_data, | ||
301 | } | ||
302 | }; | ||
303 | |||
304 | static void __init ek_add_device_buttons(void) | ||
305 | { | ||
306 | at91_set_GPIO_periph(AT91_PIN_PC5, 0); /* left button */ | ||
307 | at91_set_deglitch(AT91_PIN_PC5, 1); | ||
308 | at91_set_GPIO_periph(AT91_PIN_PC4, 0); /* right button */ | ||
309 | at91_set_deglitch(AT91_PIN_PC4, 1); | ||
310 | |||
311 | platform_device_register(&ek_button_device); | ||
312 | } | ||
313 | #else | ||
314 | static void __init ek_add_device_buttons(void) {} | ||
315 | #endif | ||
316 | |||
317 | |||
318 | /* | ||
268 | * AC97 | 319 | * AC97 |
269 | */ | 320 | */ |
270 | static struct atmel_ac97_data ek_ac97_data = { | 321 | static struct atmel_ac97_data ek_ac97_data = { |
@@ -319,6 +370,8 @@ static void __init ek_board_init(void) | |||
319 | at91_add_device_i2c(NULL, 0); | 370 | at91_add_device_i2c(NULL, 0); |
320 | /* LCD Controller */ | 371 | /* LCD Controller */ |
321 | at91_add_device_lcdc(&ek_lcdc_data); | 372 | at91_add_device_lcdc(&ek_lcdc_data); |
373 | /* Push Buttons */ | ||
374 | ek_add_device_buttons(); | ||
322 | /* AC97 */ | 375 | /* AC97 */ |
323 | at91_add_device_ac97(&ek_ac97_data); | 376 | at91_add_device_ac97(&ek_ac97_data); |
324 | /* LEDs */ | 377 | /* LEDs */ |