aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-pxa/littleton.c
diff options
context:
space:
mode:
authoreric miao <eric.miao@marvell.com>2008-01-23 02:07:22 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2008-04-19 06:29:06 -0400
commit5fa41510f0f481d5139c732c5c6aac4b4a722828 (patch)
treea81d9d4e9baa92030af6e22a8895604692ff412d /arch/arm/mach-pxa/littleton.c
parent468e086f78fb4ff69cefc256d7cd0673e95906d6 (diff)
[ARM] pxa: add keypad support for littleton
Signed-off-by: eric miao <eric.miao@marvell.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-pxa/littleton.c')
-rw-r--r--arch/arm/mach-pxa/littleton.c65
1 files changed, 65 insertions, 0 deletions
diff --git a/arch/arm/mach-pxa/littleton.c b/arch/arm/mach-pxa/littleton.c
index cdf22d4add25..03396063b561 100644
--- a/arch/arm/mach-pxa/littleton.c
+++ b/arch/arm/mach-pxa/littleton.c
@@ -37,6 +37,7 @@
37#include <asm/arch/gpio.h> 37#include <asm/arch/gpio.h>
38#include <asm/arch/pxafb.h> 38#include <asm/arch/pxafb.h>
39#include <asm/arch/ssp.h> 39#include <asm/arch/ssp.h>
40#include <asm/arch/pxa27x_keypad.h>
40#include <asm/arch/littleton.h> 41#include <asm/arch/littleton.h>
41 42
42#include "generic.h" 43#include "generic.h"
@@ -74,6 +75,21 @@ static mfp_cfg_t littleton_mfp_cfg[] __initdata = {
74 75
75 /* Debug Ethernet */ 76 /* Debug Ethernet */
76 GPIO90_GPIO, 77 GPIO90_GPIO,
78
79 /* Keypad */
80 GPIO107_KP_DKIN_0,
81 GPIO108_KP_DKIN_1,
82 GPIO115_KP_MKIN_0,
83 GPIO116_KP_MKIN_1,
84 GPIO117_KP_MKIN_2,
85 GPIO118_KP_MKIN_3,
86 GPIO119_KP_MKIN_4,
87 GPIO120_KP_MKIN_5,
88 GPIO121_KP_MKOUT_0,
89 GPIO122_KP_MKOUT_1,
90 GPIO123_KP_MKOUT_2,
91 GPIO124_KP_MKOUT_3,
92 GPIO125_KP_MKOUT_4,
77}; 93};
78 94
79static struct resource smc91x_resources[] = { 95static struct resource smc91x_resources[] = {
@@ -298,6 +314,54 @@ static void littleton_init_lcd(void)
298static inline void littleton_init_lcd(void) {}; 314static inline void littleton_init_lcd(void) {};
299#endif /* CONFIG_FB_PXA || CONFIG_FB_PXA_MODULES */ 315#endif /* CONFIG_FB_PXA || CONFIG_FB_PXA_MODULES */
300 316
317#if defined(CONFIG_KEYBOARD_PXA27x) || defined(CONFIG_KEYBOARD_PXA27x_MODULES)
318static unsigned int littleton_matrix_key_map[] = {
319 /* KEY(row, col, key_code) */
320 KEY(1, 3, KEY_0), KEY(0, 0, KEY_1), KEY(1, 0, KEY_2), KEY(2, 0, KEY_3),
321 KEY(0, 1, KEY_4), KEY(1, 1, KEY_5), KEY(2, 1, KEY_6), KEY(0, 2, KEY_7),
322 KEY(1, 2, KEY_8), KEY(2, 2, KEY_9),
323
324 KEY(0, 3, KEY_KPASTERISK), /* * */
325 KEY(2, 3, KEY_KPDOT), /* # */
326
327 KEY(5, 4, KEY_ENTER),
328
329 KEY(5, 0, KEY_UP),
330 KEY(5, 1, KEY_DOWN),
331 KEY(5, 2, KEY_LEFT),
332 KEY(5, 3, KEY_RIGHT),
333 KEY(3, 2, KEY_HOME),
334 KEY(4, 1, KEY_END),
335 KEY(3, 3, KEY_BACK),
336
337 KEY(4, 0, KEY_SEND),
338 KEY(4, 2, KEY_VOLUMEUP),
339 KEY(4, 3, KEY_VOLUMEDOWN),
340
341 KEY(3, 0, KEY_F22), /* soft1 */
342 KEY(3, 1, KEY_F23), /* soft2 */
343};
344
345static struct pxa27x_keypad_platform_data littleton_keypad_info = {
346 .matrix_key_rows = 6,
347 .matrix_key_cols = 5,
348 .matrix_key_map = littleton_matrix_key_map,
349 .matrix_key_map_size = ARRAY_SIZE(littleton_matrix_key_map),
350
351 .enable_rotary0 = 1,
352 .rotary0_up_key = KEY_UP,
353 .rotary0_down_key = KEY_DOWN,
354
355 .debounce_interval = 30,
356};
357static void __init littleton_init_keypad(void)
358{
359 pxa_set_keypad_info(&littleton_keypad_info);
360}
361#else
362static inline void littleton_init_keypad(void) {}
363#endif
364
301static void __init littleton_init(void) 365static void __init littleton_init(void)
302{ 366{
303 /* initialize MFP configurations */ 367 /* initialize MFP configurations */
@@ -310,6 +374,7 @@ static void __init littleton_init(void)
310 platform_device_register(&smc91x_device); 374 platform_device_register(&smc91x_device);
311 375
312 littleton_init_lcd(); 376 littleton_init_lcd();
377 littleton_init_keypad();
313} 378}
314 379
315MACHINE_START(LITTLETON, "Marvell Form Factor Development Platform (aka Littleton)") 380MACHINE_START(LITTLETON, "Marvell Form Factor Development Platform (aka Littleton)")