From 290d0983b86f6243beffaa3ddb02c14adc30f02a Mon Sep 17 00:00:00 2001 From: Naveen Krishna Ch Date: Tue, 22 Jun 2010 07:39:18 +0900 Subject: ARM: S3C64XX: Add keypad device to the SMDK6410 board This patch is to support keypad device to the SMDK6410 board. Signed-off-by: Naveen Krishna Ch Signed-off-by: Kukjin Kim --- arch/arm/mach-s3c64xx/mach-smdk6410.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'arch/arm/mach-s3c64xx/mach-smdk6410.c') diff --git a/arch/arm/mach-s3c64xx/mach-smdk6410.c b/arch/arm/mach-s3c64xx/mach-smdk6410.c index 7fd38e9..b5d7861 100644 --- a/arch/arm/mach-s3c64xx/mach-smdk6410.c +++ b/arch/arm/mach-s3c64xx/mach-smdk6410.c @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include @@ -67,6 +68,7 @@ #include #include #include +#include #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 */ -- cgit v1.1