From 0f52aa9d8d232164b11ec8e2b7820eb2bf078536 Mon Sep 17 00:00:00 2001 From: Girish Date: Fri, 2 Nov 2007 20:55:02 +0530 Subject: [PATCH] Twl4030- Keypad support on OMAP 3430 This patch supports Keypad on 3430 Signed-off-by: Girish S G Signed-off-by: Tony Lindgren --- arch/arm/configs/omap_3430sdp_defconfig | 1 + arch/arm/mach-omap2/board-3430sdp.c | 53 +++++++++++++++++++++++++ drivers/input/keyboard/Kconfig | 2 +- 3 files changed, 55 insertions(+), 1 deletion(-) diff --git a/arch/arm/configs/omap_3430sdp_defconfig b/arch/arm/configs/omap_3430sdp_defconfig index 4e460b72a28..ccb59807819 100644 --- a/arch/arm/configs/omap_3430sdp_defconfig +++ b/arch/arm/configs/omap_3430sdp_defconfig @@ -545,6 +545,7 @@ CONFIG_INPUT_KEYBOARD=y # CONFIG_KEYBOARD_XTKBD is not set # CONFIG_KEYBOARD_NEWTON is not set # CONFIG_KEYBOARD_STOWAWAY is not set +CONFIG_KEYBOARD_TWL4030=y # CONFIG_KEYBOARD_GPIO is not set # CONFIG_INPUT_MOUSE is not set # CONFIG_INPUT_JOYSTICK is not set diff --git a/arch/arm/mach-omap2/board-3430sdp.c b/arch/arm/mach-omap2/board-3430sdp.c index d8f7878882e..22b0d033852 100644 --- a/arch/arm/mach-omap2/board-3430sdp.c +++ b/arch/arm/mach-omap2/board-3430sdp.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include @@ -36,6 +37,7 @@ #include #include #include +#include #include #include @@ -122,6 +124,56 @@ static struct platform_device sdp3430_smc91x_device = { .resource = sdp3430_smc91x_resources, }; +static int sdp3430_keymap[] = { + KEY(0, 0, KEY_LEFT), + KEY(0, 1, KEY_RIGHT), + KEY(0, 2, KEY_A), + KEY(0, 3, KEY_B), + KEY(0, 4, KEY_C), + KEY(1, 0, KEY_DOWN), + KEY(1, 1, KEY_UP), + KEY(1, 2, KEY_E), + KEY(1, 3, KEY_F), + KEY(1, 4, KEY_G), + KEY(2, 0, KEY_ENTER), + KEY(2, 1, KEY_I), + KEY(2, 2, KEY_J), + KEY(2, 3, KEY_K), + KEY(2, 4, KEY_3), + KEY(3, 0, KEY_M), + KEY(3, 1, KEY_N), + KEY(3, 2, KEY_O), + KEY(3, 3, KEY_P), + KEY(3, 4, KEY_Q), + KEY(4, 0, KEY_R), + KEY(4, 1, KEY_4), + KEY(4, 2, KEY_T), + KEY(4, 3, KEY_U), + KEY(4, 4, KEY_D), + KEY(5, 0, KEY_V), + KEY(5, 1, KEY_W), + KEY(5, 2, KEY_L), + KEY(5, 3, KEY_S), + KEY(5, 4, KEY_H), + 0 +}; + +static struct omap_kp_platform_data sdp3430_kp_data = { + .rows = 5, + .cols = 6, + .keymap = sdp3430_keymap, + .keymapsize = ARRAY_SIZE(sdp3430_keymap), + .rep = 1, +}; + +static struct platform_device sdp3430_kp_device = { + .name = "omap_twl4030keypad", + .id = -1, + .dev = { + .platform_data = &sdp3430_kp_data, + }, +}; + /** * @brief ads7846_dev_init : Requests & sets GPIO line for pen-irq * @@ -205,6 +257,7 @@ static struct spi_board_info sdp3430_spi_board_info[] __initdata = { static struct platform_device *sdp3430_devices[] __initdata = { &sdp3430_smc91x_device, &sdp3430_flash_device, + &sdp3430_kp_device, }; static inline void __init sdp3430_init_smc91x(void) diff --git a/drivers/input/keyboard/Kconfig b/drivers/input/keyboard/Kconfig index 54395433219..8816ca94426 100644 --- a/drivers/input/keyboard/Kconfig +++ b/drivers/input/keyboard/Kconfig @@ -240,7 +240,7 @@ config KEYBOARD_OMAP config KEYBOARD_TWL4030 tristate "TI TWL4030 keypad support" - depends on TWL4030_CORE && MACH_OMAP_2430SDP + depends on TWL4030_CORE && (MACH_OMAP_2430SDP || MACH_OMAP_3430SDP) help Say Y here if you want to use the OMAP TWL4030 keypad. -- 2.41.1