From patchwork Thu Sep 15 03:32:52 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Kamat X-Patchwork-Id: 4078 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id C2BEE23EF5 for ; Thu, 15 Sep 2011 03:37:41 +0000 (UTC) Received: from mail-fx0-f52.google.com (mail-fx0-f52.google.com [209.85.161.52]) by fiordland.canonical.com (Postfix) with ESMTP id B3527A18518 for ; Thu, 15 Sep 2011 03:37:41 +0000 (UTC) Received: by fxe23 with SMTP id 23so342843fxe.11 for ; Wed, 14 Sep 2011 20:37:41 -0700 (PDT) Received: by 10.223.34.143 with SMTP id l15mr146003fad.46.1316057804670; Wed, 14 Sep 2011 20:36:44 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.152.11.8 with SMTP id m8cs77082lab; Wed, 14 Sep 2011 20:36:43 -0700 (PDT) Received: by 10.229.63.42 with SMTP id z42mr511701qch.145.1316057802545; Wed, 14 Sep 2011 20:36:42 -0700 (PDT) Received: from mail-vw0-f45.google.com (mail-vw0-f45.google.com [209.85.212.45]) by mx.google.com with ESMTPS id s9si490749qcy.155.2011.09.14.20.36.41 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 14 Sep 2011 20:36:42 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.45 is neither permitted nor denied by best guess record for domain of sachin.kamat@linaro.org) client-ip=209.85.212.45; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.212.45 is neither permitted nor denied by best guess record for domain of sachin.kamat@linaro.org) smtp.mail=sachin.kamat@linaro.org Received: by vws17 with SMTP id 17so3896879vws.4 for ; Wed, 14 Sep 2011 20:36:41 -0700 (PDT) Received: by 10.68.0.37 with SMTP id 5mr1249839pbb.77.1316057800709; Wed, 14 Sep 2011 20:36:40 -0700 (PDT) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id f6sm19025530pbp.2.2011.09.14.20.36.37 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 14 Sep 2011 20:36:39 -0700 (PDT) From: Sachin Kamat To: linux-samsung-soc@vger.kernel.org Cc: kgene.kim@samsung.com, linaro-dev@lists.linaro.org, patches@linaro.org, sachin.kamat@linaro.org Subject: [PATCH] ARM: EXYNOS4: Add keypad support for Origen Date: Thu, 15 Sep 2011 09:02:52 +0530 Message-Id: <1316057572-13719-1-git-send-email-sachin.kamat@linaro.org> X-Mailer: git-send-email 1.7.4.1 This patch adds keypad support for Origen board as GPIO keys. Signed-off-by: Sachin Kamat --- arch/arm/mach-exynos4/mach-origen.c | 58 +++++++++++++++++++++++++++++++++++ 1 files changed, 58 insertions(+), 0 deletions(-) diff --git a/arch/arm/mach-exynos4/mach-origen.c b/arch/arm/mach-exynos4/mach-origen.c index ed59f86..61da36b 100644 --- a/arch/arm/mach-exynos4/mach-origen.c +++ b/arch/arm/mach-exynos4/mach-origen.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include @@ -79,10 +80,67 @@ static struct s3c_sdhci_platdata origen_hsmmc2_pdata __initdata = { .clk_type = S3C_SDHCI_CLK_DIV_EXTERNAL, }; +static struct gpio_keys_button origen_gpio_keys_table[] = { + { + .code = KEY_MENU, + .gpio = EXYNOS4_GPX1(5), + .desc = "gpio-keys: KEY_MENU", + .type = EV_KEY, + .active_low = 1, + .wakeup = 1, + .debounce_interval = 1, + }, { + .code = KEY_HOME, + .gpio = EXYNOS4_GPX1(6), + .desc = "gpio-keys: KEY_HOME", + .type = EV_KEY, + .active_low = 1, + .wakeup = 1, + .debounce_interval = 1, + }, { + .code = KEY_BACK, + .gpio = EXYNOS4_GPX1(7), + .desc = "gpio-keys: KEY_BACK", + .type = EV_KEY, + .active_low = 1, + .wakeup = 1, + .debounce_interval = 1, + }, { + .code = KEY_UP, + .gpio = EXYNOS4_GPX2(0), + .desc = "gpio-keys: KEY_UP", + .type = EV_KEY, + .active_low = 1, + .wakeup = 1, + .debounce_interval = 1, + }, { + .code = KEY_DOWN, + .gpio = EXYNOS4_GPX2(1), + .desc = "gpio-keys: KEY_DOWN", + .type = EV_KEY, + .active_low = 1, + .wakeup = 1, + .debounce_interval = 1, + }, +}; + +static struct gpio_keys_platform_data origen_gpio_keys_data = { + .buttons = origen_gpio_keys_table, + .nbuttons = ARRAY_SIZE(origen_gpio_keys_table), +}; + +static struct platform_device origen_device_gpiokeys = { + .name = "gpio-keys", + .dev = { + .platform_data = &origen_gpio_keys_data, + }, +}; + static struct platform_device *origen_devices[] __initdata = { &s3c_device_hsmmc2, &s3c_device_rtc, &s3c_device_wdt, + &origen_device_gpiokeys, }; static void __init origen_map_io(void)