ARM: EXYNOS4: Add keypad device to the SMDKV310
authorNaveen Krishna Ch <ch.naveen@samsung.com>
Tue, 22 Feb 2011 08:16:58 +0000 (17:16 +0900)
committerKukjin Kim <kgene.kim@samsung.com>
Tue, 15 Mar 2011 11:37:02 +0000 (20:37 +0900)
This patch is to support keypad device to the SMDKV310 board.

Signed-off-by: Naveen Krishna Ch <ch.naveen@samsung.com>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
arch/arm/mach-exynos4/Kconfig
arch/arm/mach-exynos4/mach-smdkv310.c

index 8a007cc26ac56e3fd689ca9b4e8f8c5647c1a6db..a021b5240bbad60d3d53f09a60ff4b1ade3e770f 100644 (file)
@@ -117,9 +117,11 @@ config MACH_SMDKV310
        select S3C_DEV_HSMMC1
        select S3C_DEV_HSMMC2
        select S3C_DEV_HSMMC3
+       select SAMSUNG_DEV_KEYPAD
        select EXYNOS4_DEV_PD
        select EXYNOS4_DEV_SYSMMU
        select EXYNOS4_SETUP_I2C1
+       select EXYNOS4_SETUP_KEYPAD
        select EXYNOS4_SETUP_SDHCI
        help
          Machine support for Samsung SMDKV310
index 07860a5b2f5dc9b743aa02c8674a83e1393a0a49..88e0275143be3e769888aaa48615ee9a1105904e 100644 (file)
@@ -15,6 +15,7 @@
 #include <linux/smsc911x.h>
 #include <linux/io.h>
 #include <linux/i2c.h>
+#include <linux/input.h>
 
 #include <asm/mach/arch.h>
 #include <asm/mach-types.h>
@@ -24,6 +25,7 @@
 #include <plat/exynos4.h>
 #include <plat/cpu.h>
 #include <plat/devs.h>
+#include <plat/keypad.h>
 #include <plat/sdhci.h>
 #include <plat/iic.h>
 #include <plat/pd.h>
@@ -142,6 +144,25 @@ static struct platform_device smdkv310_smsc911x = {
        },
 };
 
+static uint32_t smdkv310_keymap[] __initdata = {
+       /* KEY(row, col, keycode) */
+       KEY(0, 3, KEY_1), KEY(0, 4, KEY_2), KEY(0, 5, KEY_3),
+       KEY(0, 6, KEY_4), KEY(0, 7, KEY_5),
+       KEY(1, 3, KEY_A), KEY(1, 4, KEY_B), KEY(1, 5, KEY_C),
+       KEY(1, 6, KEY_D), KEY(1, 7, KEY_E)
+};
+
+static struct matrix_keymap_data smdkv310_keymap_data __initdata = {
+       .keymap         = smdkv310_keymap,
+       .keymap_size    = ARRAY_SIZE(smdkv310_keymap),
+};
+
+static struct samsung_keypad_platdata smdkv310_keypad_data __initdata = {
+       .keymap_data    = &smdkv310_keymap_data,
+       .rows           = 2,
+       .cols           = 8,
+};
+
 static struct i2c_board_info i2c_devs1[] __initdata = {
        {I2C_BOARD_INFO("wm8994", 0x1a),},
 };
@@ -156,6 +177,7 @@ static struct platform_device *smdkv310_devices[] __initdata = {
        &s3c_device_wdt,
        &exynos4_device_ac97,
        &exynos4_device_i2s0,
+       &samsung_device_keypad,
        &exynos4_device_pd[PD_MFC],
        &exynos4_device_pd[PD_G3D],
        &exynos4_device_pd[PD_LCD0],
@@ -210,6 +232,8 @@ static void __init smdkv310_machine_init(void)
        s3c_sdhci2_set_platdata(&smdkv310_hsmmc2_pdata);
        s3c_sdhci3_set_platdata(&smdkv310_hsmmc3_pdata);
 
+       samsung_keypad_set_platdata(&smdkv310_keypad_data);
+
        platform_add_devices(smdkv310_devices, ARRAY_SIZE(smdkv310_devices));
 }