[ARM] 5263/2: [AT91] GPIO buttons as wakeup sources

Allow the various GPIO-connected buttons to be used as wakeup sources.
Also enable the internal GPIO pullup.

Signed-off-by: Sedji Gaouaou <sedji.gaouaou@atmel.com>
Signed-off-by: Andrew Victor <linux@maxim.org.za>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
This commit is contained in:
Andrew Victor
2008-09-21 21:34:06 +01:00
committed by Russell King
parent 2e9f12d6dd
commit 77789ad8b1
3 changed files with 15 additions and 11 deletions

View File

@@ -435,24 +435,28 @@ static struct gpio_keys_button ek_buttons[] = {
.code = BTN_0,
.desc = "Button 0",
.active_low = 1,
.wakeup = 1,
},
{
.gpio = AT91_PIN_PA26,
.code = BTN_1,
.desc = "Button 1",
.active_low = 1,
.wakeup = 1,
},
{
.gpio = AT91_PIN_PA25,
.code = BTN_2,
.desc = "Button 2",
.active_low = 1,
.wakeup = 1,
},
{
.gpio = AT91_PIN_PA24,
.code = BTN_3,
.desc = "Button 3",
.active_low = 1,
.wakeup = 1,
}
};
@@ -472,13 +476,13 @@ static struct platform_device ek_button_device = {
static void __init ek_add_device_buttons(void)
{
at91_set_gpio_input(AT91_PIN_PA27, 0); /* btn0 */
at91_set_gpio_input(AT91_PIN_PA27, 1); /* btn0 */
at91_set_deglitch(AT91_PIN_PA27, 1);
at91_set_gpio_input(AT91_PIN_PA26, 0); /* btn1 */
at91_set_gpio_input(AT91_PIN_PA26, 1); /* btn1 */
at91_set_deglitch(AT91_PIN_PA26, 1);
at91_set_gpio_input(AT91_PIN_PA25, 0); /* btn2 */
at91_set_gpio_input(AT91_PIN_PA25, 1); /* btn2 */
at91_set_deglitch(AT91_PIN_PA25, 1);
at91_set_gpio_input(AT91_PIN_PA24, 0); /* btn3 */
at91_set_gpio_input(AT91_PIN_PA24, 1); /* btn3 */
at91_set_deglitch(AT91_PIN_PA24, 1);
platform_device_register(&ek_button_device);