1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
|
Index: linux-2.6.21/arch/arm/mach-pxa/ezx-kbd.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ linux-2.6.21/arch/arm/mach-pxa/ezx-kbd.c 2007-04-30 20:33:19.000000000 -0300
@@ -0,0 +1,109 @@
+#include <linux/input.h>
+#include <asm/arch/kbd.h>
+#include <asm/arch/pxa-regs.h>
+
+extern void __init pxa_set_kbd_info(struct pxakbd_platform_data *);
+
+#if defined(CONFIG_PXA_EZX_E680)
+static unsigned char ezx_keycode[] = {
+ /* row 0 */
+ KEY_UP, KEY_RIGHT, KEY_RESERVED, KEY_PHONE,
+ /* row 1 */
+ KEY_DOWN, KEY_LEFT, KEY_VOLUMEUP, KEY_VOLUMEDOWN,
+ /* row 2 */
+ KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_KPENTER,
+};
+
+static unsigned char ezx_direct_keycode[] = {
+ KEY_CAMERA,
+ KEYPAD_RESERVED,
+ KEYPAD_RESERVED,
+ KEYPAD_HOME,
+ KEY_POWER,
+ KEYPAD_MENU,
+};
+#elif defined(CONFIG_PXA_EZX_A780)
+static unsigned char ezx_keycode[] = {
+ /* row 0 */
+ KEY_KPENTER, KEY_MENU, KEY_CANCEL, KEY_PAGEUP, KEY_UP,
+ /* row 1 */
+ KEY_KP1, KEY_KP2, KEY_KP3, KEY_ENTER, KEY_KPENTER, /*center joypad */
+ /* row 2 */
+ KEY_KP4, KEY_KP5, KEY_KP6, KEY_PAGEDOWN, KEY_PHONE,
+ /* row 3 */
+ KEY_KP7, KEY_KP8, KEY_KP9, KEY_PHONE, KEY_LEFT,
+ /* row 4 */
+ KEY_KPASTERISK, KEY_KP0, KEY_KPDOT, KEY_PAGEDOWN, KEY_DOWN,
+};
+static unsigned char ezx_direct_keycode[] = {
+ KEY_CAMERA,
+};
+#else
+#error "no EZX subarchitecture defined"
+#endif
+
+static int ezx_kbd_init(void)
+{
+#if defined(CONFIG_PXA_EZX_E680)
+ pxa_gpio_mode(93 | GPIO_ALT_FN_1_IN); /* KP_DKIN<0>, VR Key */
+ pxa_gpio_mode(96 | GPIO_ALT_FN_1_IN); /* KP_DKIN<3>, GAME_A */
+ pxa_gpio_mode(97 | GPIO_ALT_FN_1_IN); /* KP_DKIN<4>, power key */
+ pxa_gpio_mode(98 | GPIO_ALT_FN_1_IN); /* KP_DKIN<5>, GAME_B */
+ pxa_gpio_mode(100 | GPIO_ALT_FN_1_IN); /* KP_MKIN<0> */
+ pxa_gpio_mode(101 | GPIO_ALT_FN_1_IN); /* KP_MKIN<1> */
+ pxa_gpio_mode(102 | GPIO_ALT_FN_1_IN); /* KP_MKIN<2> */
+ pxa_gpio_mode(103 | GPIO_ALT_FN_2_OUT); /* KP_MKOUT<0> */
+ pxa_gpio_mode(104 | GPIO_ALT_FN_2_OUT); /* KP_MKOUT<1> */
+ pxa_gpio_mode(105 | GPIO_ALT_FN_2_OUT); /* KP_MKOUT<2> */
+ pxa_gpio_mode(106 | GPIO_ALT_FN_2_OUT); /* KP_MKOUT<3> */
+ pxa_gpio_mode(GPIO_TC_MM_EN);
+ GPDR(GPIO_TC_MM_EN) |= GPIO_bit(GPIO_TC_MM_EN);
+ GPSR(GPIO_TC_MM_EN) = GPIO_bit(GPIO_TC_MM_EN);
+ PGSR3 |= GPIO_bit(GPIO_TC_MM_EN);
+#elif defined(CONFIG_PXA_EZX_A780)
+ pxa_gpio_mode(93 | GPIO_ALT_FN_1_IN); /* KP_DKIN<0>, voice_rec */
+ pxa_gpio_mode(97 | GPIO_ALT_FN_3_IN); /* KP_MKIN<3> */
+ pxa_gpio_mode(98 | GPIO_ALT_FN_3_IN); /* KP_MKIN<4> */
+ pxa_gpio_mode(100 | GPIO_ALT_FN_1_IN); /* KP_MKIN<0> */
+ pxa_gpio_mode(101 | GPIO_ALT_FN_1_IN); /* KP_MKIN<1> */
+ pxa_gpio_mode(102 | GPIO_ALT_FN_1_IN); /* KP_MKIN<2> */
+ pxa_gpio_mode(103 | GPIO_ALT_FN_2_OUT); /* KP_MKOUT<0> */
+ pxa_gpio_mode(104 | GPIO_ALT_FN_2_OUT); /* KP_MKOUT<1> */
+ pxa_gpio_mode(105 | GPIO_ALT_FN_2_OUT); /* KP_MKOUT<2> */
+ pxa_gpio_mode(106 | GPIO_ALT_FN_2_OUT); /* KP_MKOUT<3> */
+ pxa_gpio_mode(107 | GPIO_ALT_FN_2_OUT); /* KP_MKOUT<4> */
+#endif
+ return 0;
+}
+
+static struct pxakbd_platform_data ezx_kbd_platform_data = {
+ .init = &ezx_kbd_init,
+ .scan_interval = HZ/40,
+ .matrix = {
+ .keycode = ezx_keycode,
+#if defined(CONFIG_PXA_EZX_E680)
+ .cols = 4,
+ .rows = 3,
+#elif defined(CONFIG_PXA_EZX_A780)
+ .cols = 5,
+ .rows = 5,
+#endif
+ },
+ .direct = {
+ .keycode = ezx_direct_keycode,
+#if defined(CONFIG_PXA_EZX_E680)
+ .num = 6,
+#elif defined(CONFIG_PXA_EZX_A780)
+ .num = 1,
+#endif
+ },
+};
+
+
+int __init __ezx_kbd_init (void)
+{
+ pxa_set_kbd_info(&ezx_kbd_platform_data);
+ return 0;
+}
+
+arch_initcall(__ezx_kbd_init);
Index: linux-2.6.21/arch/arm/mach-pxa/Makefile
===================================================================
--- linux-2.6.21.orig/arch/arm/mach-pxa/Makefile 2007-04-30 20:09:21.000000000 -0300
+++ linux-2.6.21/arch/arm/mach-pxa/Makefile 2007-04-30 20:09:34.000000000 -0300
@@ -18,7 +18,7 @@
obj-$(CONFIG_MACH_AKITA) += akita-ioexp.o
obj-$(CONFIG_MACH_POODLE) += poodle.o corgi_ssp.o
obj-$(CONFIG_MACH_TOSA) += tosa.o
-obj-$(CONFIG_PXA_EZX) += ezx.o ezx_lcd.o ezx_ssp.o ezx-pcap.o ezx-mci.o
+obj-$(CONFIG_PXA_EZX) += ezx.o ezx_lcd.o ezx_ssp.o ezx-pcap.o ezx-mci.o ezx-kbd.o
obj-$(CONFIG_PXA_EZX_EMU) += ezx-emu.o
# Support for blinky lights
Index: linux-2.6.21/drivers/input/keyboard/pxakbd.c
===================================================================
--- linux-2.6.21.orig/drivers/input/keyboard/pxakbd.c 2007-04-30 20:47:29.000000000 -0300
+++ linux-2.6.21/drivers/input/keyboard/pxakbd.c 2007-04-30 20:49:32.000000000 -0300
@@ -213,6 +213,7 @@
if (!input_dev)
goto out_pxa;
+ spin_lock_init(&pxakbd->lock);
pxakbd->irq = platform_get_irq(pdev, 0);
r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!r || pxakbd->irq == NO_IRQ) {
|