From patchwork Mon May 31 04:37:56 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joonyoung Shim X-Patchwork-Id: 103190 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o4V4fGxu020738 for ; Mon, 31 May 2010 04:41:19 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751584Ab0EaElS (ORCPT ); Mon, 31 May 2010 00:41:18 -0400 Received: from mailout4.samsung.com ([203.254.224.34]:63563 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751214Ab0EaElR (ORCPT ); Mon, 31 May 2010 00:41:17 -0400 Received: from epmmp1 (mailout4.samsung.com [203.254.224.34]) by mailout1.samsung.com (iPlanet Messaging Server 5.2 Patch 2 (built Jul 14 2004)) with ESMTP id <0L39007TPP0LXQ@mailout1.samsung.com>; Mon, 31 May 2010 13:41:10 +0900 (KST) Received: from TNRNDGASPAPP1.tn.corp.samsungelectronics.net ([165.213.149.150]) by mmp1.samsung.com (iPlanet Messaging Server 5.2 Patch 2 (built Jul 14 2004)) with ESMTPA id <0L3900BW2P0LQG@mmp1.samsung.com>; Mon, 31 May 2010 13:41:10 +0900 (KST) Received: from localhost.localdomain ([165.213.115.179]) by TNRNDGASPAPP1.tn.corp.samsungelectronics.net with Microsoft SMTPSVC(6.0.3790.4675); Mon, 31 May 2010 13:41:09 +0900 Date: Mon, 31 May 2010 13:37:56 +0900 From: Joonyoung Shim Subject: [PATCH v3 4/5] ARM: S5PV210: Add keypad device to the Aquila board In-reply-to: <1275280677-13357-1-git-send-email-jy0922.shim@samsung.com> To: ben-linux@fluff.org Cc: linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-input@vger.kernel.org, kyungmin.park@samsung.com, dmitry.torokhov@gmail.com Message-id: <1275280677-13357-4-git-send-email-jy0922.shim@samsung.com> X-Mailer: git-send-email 1.7.0.4 Content-transfer-encoding: 7BIT References: <1275280677-13357-1-git-send-email-jy0922.shim@samsung.com> X-OriginalArrivalTime: 31 May 2010 04:41:09.0928 (UTC) FILETIME=[7DA73A80:01CB007B] Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Mon, 31 May 2010 04:41:19 +0000 (UTC) diff --git a/arch/arm/mach-s5pv210/Kconfig b/arch/arm/mach-s5pv210/Kconfig index 6f41b2d..25b9e96 100644 --- a/arch/arm/mach-s5pv210/Kconfig +++ b/arch/arm/mach-s5pv210/Kconfig @@ -55,8 +55,10 @@ config MACH_AQUILA select CPU_S5PV210 select ARCH_SPARSEMEM_ENABLE select S5PV210_SETUP_FB_24BPP + select S5PV210_SETUP_KEYPAD select S3C_DEV_FB select S5PC110_DEV_ONENAND + select SAMSUNG_DEV_KEYPAD help Machine support for the Samsung Aquila target based on S5PC110 SoC diff --git a/arch/arm/mach-s5pv210/mach-aquila.c b/arch/arm/mach-s5pv210/mach-aquila.c index fb9dbb2..9b0e29d 100644 --- a/arch/arm/mach-s5pv210/mach-aquila.c +++ b/arch/arm/mach-s5pv210/mach-aquila.c @@ -28,6 +28,7 @@ #include #include #include +#include /* Following are default values for UCON, ULCON and UFCON UART registers */ #define S5PV210_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \ @@ -116,9 +117,30 @@ static struct s3c_fb_platdata aquila_lcd_pdata __initdata = { .setup_gpio = s5pv210_fb_gpio_setup_24bpp, }; +/* KEYPAD */ +static uint32_t keymap[] __initdata = { + /* KEY(row, col, keycode) */ + KEY(0, 0, KEY_CAMERA), /* Full Shot */ + KEY(0, 1, KEY_VOLUMEUP), + KEY(1, 0, KEY_CONFIG), /* Halt Shot */ + KEY(1, 1, KEY_VOLUMEDOWN), +}; + +static struct matrix_keymap_data keymap_data __initdata = { + .keymap = keymap, + .keymap_size = ARRAY_SIZE(keymap), +}; + +static struct samsung_keypad_platdata keypad_data __initdata = { + .keymap_data = &keymap_data, + .rows = 2, + .cols = 3, +}; + static struct platform_device *aquila_devices[] __initdata = { &s3c_device_fb, &s5pc110_device_onenand, + &samsung_device_keypad, }; static void __init aquila_map_io(void) @@ -133,6 +155,9 @@ static void __init aquila_machine_init(void) /* FB */ s3c_fb_set_platdata(&aquila_lcd_pdata); + /* KEYPAD */ + samsung_keypad_set_platdata(&keypad_data); + platform_add_devices(aquila_devices, ARRAY_SIZE(aquila_devices)); }