aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars-Peter Clausen <lars@metafoo.de>2011-02-28 01:24:34 -0500
committerKukjin Kim <kgene.kim@samsung.com>2011-02-28 01:24:34 -0500
commit003ddede62892f332992b200b1a1d7506f253d56 (patch)
treeac9a80cc4121fba46adcad2a9d67ae32d3220f27
parentafbb1edcd48bc7e2d90d6ae9ea5aa662d222c07c (diff)
ARM: S3C2440: Add button support on GTA02
This patch adds support for the two buttons found on the gta02 device, which are connectd to gpio pins, using the gpio-keys driver. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
-rw-r--r--arch/arm/mach-s3c2440/mach-gta02.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/arch/arm/mach-s3c2440/mach-gta02.c b/arch/arm/mach-s3c2440/mach-gta02.c
index e83062bde416..6629998bafdc 100644
--- a/arch/arm/mach-s3c2440/mach-gta02.c
+++ b/arch/arm/mach-s3c2440/mach-gta02.c
@@ -58,6 +58,9 @@
58#include <linux/mfd/pcf50633/pmic.h> 58#include <linux/mfd/pcf50633/pmic.h>
59#include <linux/mfd/pcf50633/backlight.h> 59#include <linux/mfd/pcf50633/backlight.h>
60 60
61#include <linux/input.h>
62#include <linux/gpio_keys.h>
63
61#include <asm/mach/arch.h> 64#include <asm/mach/arch.h>
62#include <asm/mach/map.h> 65#include <asm/mach/map.h>
63#include <asm/mach/irq.h> 66#include <asm/mach/irq.h>
@@ -489,6 +492,36 @@ static struct s3c2410_hcd_info gta02_usb_info __initdata = {
489 }, 492 },
490}; 493};
491 494
495/* Buttons */
496static struct gpio_keys_button gta02_buttons[] = {
497 {
498 .gpio = GTA02_GPIO_AUX_KEY,
499 .code = KEY_PHONE,
500 .desc = "Aux",
501 .type = EV_KEY,
502 .debounce_interval = 100,
503 },
504 {
505 .gpio = GTA02_GPIO_HOLD_KEY,
506 .code = KEY_PAUSE,
507 .desc = "Hold",
508 .type = EV_KEY,
509 .debounce_interval = 100,
510 },
511};
512
513static struct gpio_keys_platform_data gta02_buttons_pdata = {
514 .buttons = gta02_buttons,
515 .nbuttons = ARRAY_SIZE(gta02_buttons),
516};
517
518static struct platform_device gta02_buttons_device = {
519 .name = "gpio-keys",
520 .id = -1,
521 .dev = {
522 .platform_data = &gta02_buttons_pdata,
523 },
524};
492 525
493static void __init gta02_map_io(void) 526static void __init gta02_map_io(void)
494{ 527{
@@ -511,6 +544,7 @@ static struct platform_device *gta02_devices[] __initdata = {
511 &s3c_device_iis, 544 &s3c_device_iis,
512 &samsung_asoc_dma, 545 &samsung_asoc_dma,
513 &s3c_device_i2c0, 546 &s3c_device_i2c0,
547 &gta02_buttons_device,
514}; 548};
515 549
516/* These guys DO need to be children of PMU. */ 550/* These guys DO need to be children of PMU. */