From 3fac6cf35806f099fad956d7b4ca76eebb26297e Mon Sep 17 00:00:00 2001 From: Rogerio Pimentel Date: Fri, 25 Jun 2010 10:31:33 -0300 Subject: mx27_3ds: add support for the keypad mx27_3ds: add support for the keypad Signed-off-by: Rogerio Pimentel Signed-off-by: Sascha Hauer --- arch/arm/mach-imx/mach-mx27_3ds.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'arch/arm/mach-imx') diff --git a/arch/arm/mach-imx/mach-mx27_3ds.c b/arch/arm/mach-imx/mach-mx27_3ds.c index e2a82bab012..e66ffaa1c26 100644 --- a/arch/arm/mach-imx/mach-mx27_3ds.c +++ b/arch/arm/mach-imx/mach-mx27_3ds.c @@ -22,6 +22,7 @@ #include #include +#include #include #include #include @@ -67,12 +68,34 @@ static struct platform_device *platform_devices[] __initdata = { &mxc_fec_device, }; +/* + * Matrix keyboard + */ + +static const uint32_t mx27_3ds_keymap[] = { + KEY(0, 0, KEY_UP), + KEY(0, 1, KEY_DOWN), + KEY(1, 0, KEY_RIGHT), + KEY(1, 1, KEY_LEFT), + KEY(1, 2, KEY_ENTER), + KEY(2, 0, KEY_F6), + KEY(2, 1, KEY_F8), + KEY(2, 2, KEY_F9), + KEY(2, 3, KEY_F10), +}; + +static struct matrix_keymap_data mx27_3ds_keymap_data = { + .keymap = mx27_3ds_keymap, + .keymap_size = ARRAY_SIZE(mx27_3ds_keymap), +}; + static void __init mx27pdk_init(void) { mxc_gpio_setup_multiple_pins(mx27pdk_pins, ARRAY_SIZE(mx27pdk_pins), "mx27pdk"); imx27_add_imx_uart0(&uart_pdata); platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices)); + mxc_register_device(&imx_kpp_device, &mx27_3ds_keymap_data); } static void __init mx27pdk_timer_init(void) -- cgit v1.2.3-70-g09d2