diff options
author | Rogerio Pimentel <rogerio.pimentel@freescale.com> | 2010-06-25 09:31:33 -0400 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2010-07-26 08:29:20 -0400 |
commit | 3fac6cf35806f099fad956d7b4ca76eebb26297e (patch) | |
tree | da8cbcd245c923f208ea11dacc722f6612a7dba0 /arch/arm/mach-imx | |
parent | c5d38f08ca05c5253cb491a26225bf16bfa54ab1 (diff) |
mx27_3ds: add support for the keypad
mx27_3ds: add support for the keypad
Signed-off-by: Rogerio Pimentel <rogerio.pimentel@freescale.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/mach-imx')
-rw-r--r-- | arch/arm/mach-imx/mach-mx27_3ds.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/arch/arm/mach-imx/mach-mx27_3ds.c b/arch/arm/mach-imx/mach-mx27_3ds.c index e2a82bab012b..e66ffaa1c26c 100644 --- a/arch/arm/mach-imx/mach-mx27_3ds.c +++ b/arch/arm/mach-imx/mach-mx27_3ds.c | |||
@@ -22,6 +22,7 @@ | |||
22 | 22 | ||
23 | #include <linux/platform_device.h> | 23 | #include <linux/platform_device.h> |
24 | #include <linux/gpio.h> | 24 | #include <linux/gpio.h> |
25 | #include <linux/input/matrix_keypad.h> | ||
25 | #include <asm/mach-types.h> | 26 | #include <asm/mach-types.h> |
26 | #include <asm/mach/arch.h> | 27 | #include <asm/mach/arch.h> |
27 | #include <asm/mach/time.h> | 28 | #include <asm/mach/time.h> |
@@ -67,12 +68,34 @@ static struct platform_device *platform_devices[] __initdata = { | |||
67 | &mxc_fec_device, | 68 | &mxc_fec_device, |
68 | }; | 69 | }; |
69 | 70 | ||
71 | /* | ||
72 | * Matrix keyboard | ||
73 | */ | ||
74 | |||
75 | static const uint32_t mx27_3ds_keymap[] = { | ||
76 | KEY(0, 0, KEY_UP), | ||
77 | KEY(0, 1, KEY_DOWN), | ||
78 | KEY(1, 0, KEY_RIGHT), | ||
79 | KEY(1, 1, KEY_LEFT), | ||
80 | KEY(1, 2, KEY_ENTER), | ||
81 | KEY(2, 0, KEY_F6), | ||
82 | KEY(2, 1, KEY_F8), | ||
83 | KEY(2, 2, KEY_F9), | ||
84 | KEY(2, 3, KEY_F10), | ||
85 | }; | ||
86 | |||
87 | static struct matrix_keymap_data mx27_3ds_keymap_data = { | ||
88 | .keymap = mx27_3ds_keymap, | ||
89 | .keymap_size = ARRAY_SIZE(mx27_3ds_keymap), | ||
90 | }; | ||
91 | |||
70 | static void __init mx27pdk_init(void) | 92 | static void __init mx27pdk_init(void) |
71 | { | 93 | { |
72 | mxc_gpio_setup_multiple_pins(mx27pdk_pins, ARRAY_SIZE(mx27pdk_pins), | 94 | mxc_gpio_setup_multiple_pins(mx27pdk_pins, ARRAY_SIZE(mx27pdk_pins), |
73 | "mx27pdk"); | 95 | "mx27pdk"); |
74 | imx27_add_imx_uart0(&uart_pdata); | 96 | imx27_add_imx_uart0(&uart_pdata); |
75 | platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices)); | 97 | platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices)); |
98 | mxc_register_device(&imx_kpp_device, &mx27_3ds_keymap_data); | ||
76 | } | 99 | } |
77 | 100 | ||
78 | static void __init mx27pdk_timer_init(void) | 101 | static void __init mx27pdk_timer_init(void) |