diff options
author | Russell King <rmk+kernel@armlinux.org.uk> | 2016-08-31 08:49:50 +0100 |
---|---|---|
committer | Russell King <rmk+kernel@armlinux.org.uk> | 2018-12-04 22:37:38 +0000 |
commit | 17c7f4f7b4c6c3cc086d0ca0ce781bda95d4b402 (patch) | |
tree | 86c53a26d133e4b54fc27ae3ffd628ffc29e9cbb /arch/arm/mach-sa1100 | |
parent | e1b0d978459f17e21367fe4d3290b863919e5e73 (diff) | |
download | linux-17c7f4f7b4c6c3cc086d0ca0ce781bda95d4b402.tar.gz linux-17c7f4f7b4c6c3cc086d0ca0ce781bda95d4b402.tar.bz2 linux-17c7f4f7b4c6c3cc086d0ca0ce781bda95d4b402.zip |
ARM: sa1100/assabet: add gpio keys support for right-hand two buttons
Add gpio keys support for the right-hand two buttons on the Assabet,
which can be used to wake up the CPU after PM.
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Diffstat (limited to 'arch/arm/mach-sa1100')
-rw-r--r-- | arch/arm/mach-sa1100/assabet.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/arch/arm/mach-sa1100/assabet.c b/arch/arm/mach-sa1100/assabet.c index 3e8c0948abcc..53afea52a961 100644 --- a/arch/arm/mach-sa1100/assabet.c +++ b/arch/arm/mach-sa1100/assabet.c @@ -15,6 +15,7 @@ #include <linux/errno.h> #include <linux/gpio/gpio-reg.h> #include <linux/gpio/machine.h> +#include <linux/gpio_keys.h> #include <linux/ioport.h> #include <linux/platform_data/sa11x0-serial.h> #include <linux/regulator/fixed.h> @@ -479,6 +480,30 @@ static struct gpiod_lookup_table assabet_cf_vcc_gpio_table = { }, }; +static struct gpio_keys_button assabet_keys_buttons[] = { + { + .gpio = 0, + .irq = IRQ_GPIO0, + .desc = "gpio0", + .wakeup = 1, + .can_disable = 1, + .debounce_interval = 5, + }, { + .gpio = 1, + .irq = IRQ_GPIO1, + .desc = "gpio1", + .wakeup = 1, + .can_disable = 1, + .debounce_interval = 5, + }, +}; + +static const struct gpio_keys_platform_data assabet_keys_pdata = { + .buttons = assabet_keys_buttons, + .nbuttons = ARRAY_SIZE(assabet_keys_buttons), + .rep = 0, +}; + static void __init assabet_init(void) { /* @@ -533,6 +558,11 @@ static void __init assabet_init(void) } + platform_device_register_resndata(NULL, "gpio-keys", 0, + NULL, 0, + &assabet_keys_pdata, + sizeof(assabet_keys_pdata)); + #ifndef ASSABET_PAL_VIDEO sa11x0_register_lcd(&lq039q2ds54_info); #else |