aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authoreric miao <eric.miao@marvell.com>2008-01-23 01:25:27 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2008-04-19 06:29:05 -0400
commit55c26e4011572a2e1329cbff92e930838010ba88 (patch)
tree1fd0a094ee048ea1e46e0573d0bd2139d158c855 /arch
parent37320980414f5a7654ee08a047194224c6bba46e (diff)
[ARM] pxa: add partial keypad support for mainstone
This is partial because mainstone's keypad is really special, some of the keys like '1', '2', ... are actually connected to two row/column juntions, thus pressing '1' is equivalent to pressing 'A' & 'H'. This is really brain damanged since it makes distinguishing between pressing '1' and multiple keys pressing of 'A' & 'H' difficult. So these special keys are not supported for the time being. Signed-off-by: eric miao <eric.miao@marvell.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-pxa/mainstone.c54
1 files changed, 54 insertions, 0 deletions
diff --git a/arch/arm/mach-pxa/mainstone.c b/arch/arm/mach-pxa/mainstone.c
index bde60887dd12..e0f5f97e967f 100644
--- a/arch/arm/mach-pxa/mainstone.c
+++ b/arch/arm/mach-pxa/mainstone.c
@@ -49,6 +49,7 @@
49#include <asm/arch/mmc.h> 49#include <asm/arch/mmc.h>
50#include <asm/arch/irda.h> 50#include <asm/arch/irda.h>
51#include <asm/arch/ohci.h> 51#include <asm/arch/ohci.h>
52#include <asm/arch/pxa27x_keypad.h>
52 53
53#include "generic.h" 54#include "generic.h"
54#include "devices.h" 55#include "devices.h"
@@ -548,6 +549,57 @@ static struct pxaohci_platform_data mainstone_ohci_platform_data = {
548 .init = mainstone_ohci_init, 549 .init = mainstone_ohci_init,
549}; 550};
550 551
552#if defined(CONFIG_KEYBOARD_PXA27x) || defined(CONFIG_KEYBOARD_PXA27x_MODULES)
553static unsigned int mainstone_matrix_keys[] = {
554 KEY(0, 0, KEY_A), KEY(1, 0, KEY_B), KEY(2, 0, KEY_C),
555 KEY(3, 0, KEY_D), KEY(4, 0, KEY_E), KEY(5, 0, KEY_F),
556 KEY(0, 1, KEY_G), KEY(1, 1, KEY_H), KEY(2, 1, KEY_I),
557 KEY(3, 1, KEY_J), KEY(4, 1, KEY_K), KEY(5, 1, KEY_L),
558 KEY(0, 2, KEY_M), KEY(1, 2, KEY_N), KEY(2, 2, KEY_O),
559 KEY(3, 2, KEY_P), KEY(4, 2, KEY_Q), KEY(5, 2, KEY_R),
560 KEY(0, 3, KEY_S), KEY(1, 3, KEY_T), KEY(2, 3, KEY_U),
561 KEY(3, 3, KEY_V), KEY(4, 3, KEY_W), KEY(5, 3, KEY_X),
562 KEY(2, 4, KEY_Y), KEY(3, 4, KEY_Z),
563
564 KEY(0, 4, KEY_DOT), /* . */
565 KEY(1, 4, KEY_CLOSE), /* @ */
566 KEY(4, 4, KEY_SLASH),
567 KEY(5, 4, KEY_BACKSLASH),
568 KEY(0, 5, KEY_HOME),
569 KEY(1, 5, KEY_LEFTSHIFT),
570 KEY(2, 5, KEY_SPACE),
571 KEY(3, 5, KEY_SPACE),
572 KEY(4, 5, KEY_ENTER),
573 KEY(5, 5, KEY_BACKSPACE),
574
575 KEY(0, 6, KEY_UP),
576 KEY(1, 6, KEY_DOWN),
577 KEY(2, 6, KEY_LEFT),
578 KEY(3, 6, KEY_RIGHT),
579 KEY(4, 6, KEY_SELECT),
580};
581
582struct pxa27x_keypad_platform_data mainstone_keypad_info = {
583 .matrix_key_rows = 6,
584 .matrix_key_cols = 7,
585 .matrix_key_map = mainstone_matrix_keys,
586 .matrix_key_map_size = ARRAY_SIZE(mainstone_matrix_keys),
587
588 .enable_rotary0 = 1,
589 .rotary0_up_key = KEY_UP,
590 .rotary0_down_key = KEY_DOWN,
591
592 .debounce_interval = 30,
593};
594
595static void __init mainstone_init_keypad(void)
596{
597 pxa_set_keypad_info(&mainstone_keypad_info);
598}
599#else
600static inline void mainstone_init_keypad(void) {}
601#endif
602
551static void __init mainstone_init(void) 603static void __init mainstone_init(void)
552{ 604{
553 int SW7 = 0; /* FIXME: get from SCR (Mst doc section 3.2.1.1) */ 605 int SW7 = 0; /* FIXME: get from SCR (Mst doc section 3.2.1.1) */
@@ -585,6 +637,8 @@ static void __init mainstone_init(void)
585 pxa_set_mci_info(&mainstone_mci_platform_data); 637 pxa_set_mci_info(&mainstone_mci_platform_data);
586 pxa_set_ficp_info(&mainstone_ficp_platform_data); 638 pxa_set_ficp_info(&mainstone_ficp_platform_data);
587 pxa_set_ohci_info(&mainstone_ohci_platform_data); 639 pxa_set_ohci_info(&mainstone_ohci_platform_data);
640
641 mainstone_init_keypad();
588} 642}
589 643
590 644