Commit eaf858a9 authored by David Brownell's avatar David Brownell Committed by Russell King

[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: default avatarDavid Brownell <dbrownell@users.sourceforge.net>
Acked-by: default avatarAndrew Victor <linux@maxim.org.za>
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent 86640cae
...@@ -404,25 +404,25 @@ static struct atmel_lcdfb_info __initdata ek_lcdc_data; ...@@ -404,25 +404,25 @@ static struct atmel_lcdfb_info __initdata ek_lcdc_data;
static struct gpio_keys_button ek_buttons[] = { static struct gpio_keys_button ek_buttons[] = {
{ {
.gpio = AT91_PIN_PA27, .gpio = AT91_PIN_PA27,
.keycode = BTN_0, .code = BTN_0,
.desc = "Button 0", .desc = "Button 0",
.active_low = 1, .active_low = 1,
}, },
{ {
.gpio = AT91_PIN_PA26, .gpio = AT91_PIN_PA26,
.keycode = BTN_1, .code = BTN_1,
.desc = "Button 1", .desc = "Button 1",
.active_low = 1, .active_low = 1,
}, },
{ {
.gpio = AT91_PIN_PA25, .gpio = AT91_PIN_PA25,
.keycode = BTN_2, .code = BTN_2,
.desc = "Button 2", .desc = "Button 2",
.active_low = 1, .active_low = 1,
}, },
{ {
.gpio = AT91_PIN_PA24, .gpio = AT91_PIN_PA24,
.keycode = BTN_3, .code = BTN_3,
.desc = "Button 3", .desc = "Button 3",
.active_low = 1, .active_low = 1,
} }
......
...@@ -27,6 +27,8 @@ ...@@ -27,6 +27,8 @@
#include <linux/spi/spi.h> #include <linux/spi/spi.h>
#include <linux/spi/ads7846.h> #include <linux/spi/ads7846.h>
#include <linux/fb.h> #include <linux/fb.h>
#include <linux/gpio_keys.h>
#include <linux/input.h>
#include <video/atmel_lcdc.h> #include <video/atmel_lcdc.h>
...@@ -264,6 +266,55 @@ static struct atmel_lcdfb_info __initdata ek_lcdc_data; ...@@ -264,6 +266,55 @@ static struct atmel_lcdfb_info __initdata ek_lcdc_data;
#endif #endif
/*
* GPIO Buttons
*/
#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
static struct gpio_keys_button ek_buttons[] = {
{ /* BP1, "leftclic" */
.code = BTN_LEFT,
.gpio = AT91_PIN_PC5,
.active_low = 1,
.desc = "left_click",
.wakeup = 1,
},
{ /* BP2, "rightclic" */
.code = BTN_RIGHT,
.gpio = AT91_PIN_PC4,
.active_low = 1,
.desc = "right_click",
.wakeup = 1,
},
};
static struct gpio_keys_platform_data ek_button_data = {
.buttons = ek_buttons,
.nbuttons = ARRAY_SIZE(ek_buttons),
};
static struct platform_device ek_button_device = {
.name = "gpio-keys",
.id = -1,
.num_resources = 0,
.dev = {
.platform_data = &ek_button_data,
}
};
static void __init ek_add_device_buttons(void)
{
at91_set_GPIO_periph(AT91_PIN_PC5, 0); /* left button */
at91_set_deglitch(AT91_PIN_PC5, 1);
at91_set_GPIO_periph(AT91_PIN_PC4, 0); /* right button */
at91_set_deglitch(AT91_PIN_PC4, 1);
platform_device_register(&ek_button_device);
}
#else
static void __init ek_add_device_buttons(void) {}
#endif
/* /*
* AC97 * AC97
*/ */
...@@ -319,6 +370,8 @@ static void __init ek_board_init(void) ...@@ -319,6 +370,8 @@ static void __init ek_board_init(void)
at91_add_device_i2c(NULL, 0); at91_add_device_i2c(NULL, 0);
/* LCD Controller */ /* LCD Controller */
at91_add_device_lcdc(&ek_lcdc_data); at91_add_device_lcdc(&ek_lcdc_data);
/* Push Buttons */
ek_add_device_buttons();
/* AC97 */ /* AC97 */
at91_add_device_ac97(&ek_ac97_data); at91_add_device_ac97(&ek_ac97_data);
/* LEDs */ /* LEDs */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment