aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-pxa/littleton.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-pxa/littleton.c')
-rw-r--r--arch/arm/mach-pxa/littleton.c67
1 files changed, 65 insertions, 2 deletions
diff --git a/arch/arm/mach-pxa/littleton.c b/arch/arm/mach-pxa/littleton.c
index 0a4b54c21314..03396063b561 100644
--- a/arch/arm/mach-pxa/littleton.c
+++ b/arch/arm/mach-pxa/littleton.c
@@ -37,12 +37,11 @@
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"
43 44
44#define ARRAY_AND_SIZE(x) (x), ARRAY_SIZE(x)
45
46/* Littleton MFP configurations */ 45/* Littleton MFP configurations */
47static mfp_cfg_t littleton_mfp_cfg[] __initdata = { 46static mfp_cfg_t littleton_mfp_cfg[] __initdata = {
48 /* LCD */ 47 /* LCD */
@@ -76,6 +75,21 @@ static mfp_cfg_t littleton_mfp_cfg[] __initdata = {
76 75
77 /* Debug Ethernet */ 76 /* Debug Ethernet */
78 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,
79}; 93};
80 94
81static struct resource smc91x_resources[] = { 95static struct resource smc91x_resources[] = {
@@ -300,6 +314,54 @@ static void littleton_init_lcd(void)
300static inline void littleton_init_lcd(void) {}; 314static inline void littleton_init_lcd(void) {};
301#endif /* CONFIG_FB_PXA || CONFIG_FB_PXA_MODULES */ 315#endif /* CONFIG_FB_PXA || CONFIG_FB_PXA_MODULES */
302 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
303static void __init littleton_init(void) 365static void __init littleton_init(void)
304{ 366{
305 /* initialize MFP configurations */ 367 /* initialize MFP configurations */
@@ -312,6 +374,7 @@ static void __init littleton_init(void)
312 platform_device_register(&smc91x_device); 374 platform_device_register(&smc91x_device);
313 375
314 littleton_init_lcd(); 376 littleton_init_lcd();
377 littleton_init_keypad();
315} 378}
316 379
317MACHINE_START(LITTLETON, "Marvell Form Factor Development Platform (aka Littleton)") 380MACHINE_START(LITTLETON, "Marvell Form Factor Development Platform (aka Littleton)")