From 7e5eca43dd852db0dcc207acc4a343b6ebcd3971 Mon Sep 17 00:00:00 2001 From: Lars-Peter Clausen Date: Thu, 24 Sep 2009 19:11:52 +0200 Subject: ARM: gta02: Add button support The gta02 has two buttons which are connected to gpio pins and thus can get supported by using the generic gpio-keys driver. Signed-off-by: Lars-Peter Clausen --- arch/arm/mach-s3c2440/mach-gta02.c | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/arch/arm/mach-s3c2440/mach-gta02.c b/arch/arm/mach-s3c2440/mach-gta02.c index 45799c608d8..009c0a446b2 100644 --- a/arch/arm/mach-s3c2440/mach-gta02.c +++ b/arch/arm/mach-s3c2440/mach-gta02.c @@ -58,6 +58,9 @@ #include #include +#include +#include + #include #include #include @@ -553,6 +556,36 @@ static struct s3c2410_hcd_info gta02_usb_info __initdata = { }, }; +/* Buttons */ +static struct gpio_keys_button gta02_buttons[] = { + { + .gpio = GTA02_GPIO_AUX_KEY, + .code = KEY_PHONE, + .desc = "Aux", + .type = EV_KEY, + .debounce_interval = 100, + }, + { + .gpio = GTA02_GPIO_HOLD_KEY, + .code = KEY_PAUSE, + .desc = "Hold", + .type = EV_KEY, + .debounce_interval = 100, + }, +}; + +static struct gpio_keys_platform_data gta02_buttons_pdata = { + .buttons = gta02_buttons, + .nbuttons = ARRAY_SIZE(gta02_buttons), +}; + +static struct platform_device gta02_buttons_device = { + .name = "gpio-keys", + .id = -1, + .dev = { + .platform_data = >a02_buttons_pdata, + }, +}; static void __init gta02_map_io(void) { @@ -574,6 +607,7 @@ static struct platform_device *gta02_devices[] __initdata = { &s3c24xx_pwm_device, &s3c_device_iis, &s3c_device_i2c0, + >a02_buttons_device, }; /* These guys DO need to be children of PMU. */ -- cgit v1.2.3