]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - arch/arm/mach-s3c64xx/mach-smdk6410.c
ARM: S3C64XX: Add keypad device to the SMDK6410 board
[net-next-2.6.git] / arch / arm / mach-s3c64xx / mach-smdk6410.c
index 7fd38e9dcfca85e9b2f69a22fd055dd74345dd7f..b5d78616c774740fdb5c3b3cf6c03e71f9d575c6 100644 (file)
@@ -17,6 +17,7 @@
 #include <linux/list.h>
 #include <linux/timer.h>
 #include <linux/init.h>
+#include <linux/input.h>
 #include <linux/serial_core.h>
 #include <linux/platform_device.h>
 #include <linux/io.h>
@@ -67,6 +68,7 @@
 #include <plat/cpu.h>
 #include <plat/adc.h>
 #include <plat/ts.h>
+#include <plat/keypad.h>
 
 #define UCON S3C2410_UCON_DEFAULT | S3C2410_UCON_UCLK
 #define ULCON S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB
@@ -247,6 +249,25 @@ static struct s3c_ide_platdata smdk6410_ide_pdata __initdata = {
        .setup_gpio     = s3c64xx_ide_setup_gpio,
 };
 
+static uint32_t smdk6410_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 smdk6410_keymap_data __initdata = {
+       .keymap         = smdk6410_keymap,
+       .keymap_size    = ARRAY_SIZE(smdk6410_keymap),
+};
+
+static struct samsung_keypad_platdata smdk6410_keypad_data __initdata = {
+       .keymap_data    = &smdk6410_keymap_data,
+       .rows           = 2,
+       .cols           = 8,
+};
+
 static struct map_desc smdk6410_iodesc[] = {};
 
 static struct platform_device *smdk6410_devices[] __initdata = {
@@ -262,6 +283,7 @@ static struct platform_device *smdk6410_devices[] __initdata = {
        &s3c_device_ohci,
        &s3c_device_usb_hsotg,
        &s3c64xx_device_iisv4,
+       &samsung_device_keypad,
 
 #ifdef CONFIG_REGULATOR
        &smdk6410_b_pwr_5v,
@@ -643,6 +665,8 @@ static void __init smdk6410_machine_init(void)
        s3c_i2c1_set_platdata(NULL);
        s3c_fb_set_platdata(&smdk6410_lcd_pdata);
 
+       samsung_keypad_set_platdata(&smdk6410_keypad_data);
+
        s3c24xx_ts_set_platdata(&s3c_ts_platform);
 
        /* configure nCS1 width to 16 bits */