aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-at91/board-sam9263ek.c
diff options
context:
space:
mode:
authorDavid Brownell <david-b@pacbell.net>2008-01-14 02:53:22 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2008-01-27 12:54:16 -0500
commiteaf858a988a4b7b34a6ae03a3ac52cdf25013892 (patch)
treedfadf79705caf0a82f28a337cd1f5493fd4ca5c1 /arch/arm/mach-at91/board-sam9263ek.c
parent86640cae60147b0cd2705145de8067e24db70a8b (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/board-sam9263ek.c')
-rw-r--r--arch/arm/mach-at91/board-sam9263ek.c53
1 files changed, 53 insertions, 0 deletions
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)
273static 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
290static struct gpio_keys_platform_data ek_button_data = {
291 .buttons = ek_buttons,
292 .nbuttons = ARRAY_SIZE(ek_buttons),
293};
294
295static 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
304static 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
314static void __init ek_add_device_buttons(void) {}
315#endif
316
317
318/*
268 * AC97 319 * AC97
269 */ 320 */
270static struct atmel_ac97_data ek_ac97_data = { 321static 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 */