aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-pxa/zylonite.c
diff options
context:
space:
mode:
authoreric miao <eric.miao@marvell.com>2008-01-23 01:25:50 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2008-04-19 06:29:05 -0400
commit468e086f78fb4ff69cefc256d7cd0673e95906d6 (patch)
tree22d91c8dad4060176c8319dfe68b961315014838 /arch/arm/mach-pxa/zylonite.c
parent55c26e4011572a2e1329cbff92e930838010ba88 (diff)
[ARM] pxa: add keypad support for zylonite
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/zylonite.c')
-rw-r--r--arch/arm/mach-pxa/zylonite.c67
1 files changed, 67 insertions, 0 deletions
diff --git a/arch/arm/mach-pxa/zylonite.c b/arch/arm/mach-pxa/zylonite.c
index afd2cbfca0d9..9ca1d539bdc5 100644
--- a/arch/arm/mach-pxa/zylonite.c
+++ b/arch/arm/mach-pxa/zylonite.c
@@ -26,6 +26,7 @@
26#include <asm/arch/pxafb.h> 26#include <asm/arch/pxafb.h>
27#include <asm/arch/zylonite.h> 27#include <asm/arch/zylonite.h>
28#include <asm/arch/mmc.h> 28#include <asm/arch/mmc.h>
29#include <asm/arch/pxa27x_keypad.h>
29 30
30#include "generic.h" 31#include "generic.h"
31 32
@@ -249,6 +250,71 @@ static void __init zylonite_init_mmc(void)
249static inline void zylonite_init_mmc(void) {} 250static inline void zylonite_init_mmc(void) {}
250#endif 251#endif
251 252
253#if defined(CONFIG_KEYBOARD_PXA27x) || defined(CONFIG_KEYBOARD_PXA27x_MODULES)
254static unsigned int zylonite_matrix_key_map[] = {
255 /* KEY(row, col, key_code) */
256 KEY(0, 0, KEY_A), KEY(0, 1, KEY_B), KEY(0, 2, KEY_C), KEY(0, 5, KEY_D),
257 KEY(1, 0, KEY_E), KEY(1, 1, KEY_F), KEY(1, 2, KEY_G), KEY(1, 5, KEY_H),
258 KEY(2, 0, KEY_I), KEY(2, 1, KEY_J), KEY(2, 2, KEY_K), KEY(2, 5, KEY_L),
259 KEY(3, 0, KEY_M), KEY(3, 1, KEY_N), KEY(3, 2, KEY_O), KEY(3, 5, KEY_P),
260 KEY(5, 0, KEY_Q), KEY(5, 1, KEY_R), KEY(5, 2, KEY_S), KEY(5, 5, KEY_T),
261 KEY(6, 0, KEY_U), KEY(6, 1, KEY_V), KEY(6, 2, KEY_W), KEY(6, 5, KEY_X),
262 KEY(7, 1, KEY_Y), KEY(7, 2, KEY_Z),
263
264 KEY(4, 4, KEY_0), KEY(1, 3, KEY_1), KEY(4, 1, KEY_2), KEY(1, 4, KEY_3),
265 KEY(2, 3, KEY_4), KEY(4, 2, KEY_5), KEY(2, 4, KEY_6), KEY(3, 3, KEY_7),
266 KEY(4, 3, KEY_8), KEY(3, 4, KEY_9),
267
268 KEY(4, 5, KEY_SPACE),
269 KEY(5, 3, KEY_KPASTERISK), /* * */
270 KEY(5, 4, KEY_KPDOT), /* #" */
271
272 KEY(0, 7, KEY_UP),
273 KEY(1, 7, KEY_DOWN),
274 KEY(2, 7, KEY_LEFT),
275 KEY(3, 7, KEY_RIGHT),
276 KEY(2, 6, KEY_HOME),
277 KEY(3, 6, KEY_END),
278 KEY(6, 4, KEY_DELETE),
279 KEY(6, 6, KEY_BACK),
280 KEY(6, 3, KEY_CAPSLOCK), /* KEY_LEFTSHIFT), */
281
282 KEY(4, 6, KEY_ENTER), /* scroll push */
283 KEY(5, 7, KEY_ENTER), /* keypad action */
284
285 KEY(0, 4, KEY_EMAIL),
286 KEY(5, 6, KEY_SEND),
287 KEY(4, 0, KEY_CALENDAR),
288 KEY(7, 6, KEY_RECORD),
289 KEY(6, 7, KEY_VOLUMEUP),
290 KEY(7, 7, KEY_VOLUMEDOWN),
291
292 KEY(0, 6, KEY_F22), /* soft1 */
293 KEY(1, 6, KEY_F23), /* soft2 */
294 KEY(0, 3, KEY_AUX), /* contact */
295};
296
297static struct pxa27x_keypad_platform_data zylonite_keypad_info = {
298 .matrix_key_rows = 8,
299 .matrix_key_cols = 8,
300 .matrix_key_map = zylonite_matrix_key_map,
301 .matrix_key_map_size = ARRAY_SIZE(zylonite_matrix_key_map),
302
303 .enable_rotary0 = 1,
304 .rotary0_up_key = KEY_UP,
305 .rotary0_down_key = KEY_DOWN,
306
307 .debounce_interval = 30,
308};
309
310static void __init zylonite_init_keypad(void)
311{
312 pxa_set_keypad_info(&zylonite_keypad_info);
313}
314#else
315static inline void zylonite_init_keypad(void) {}
316#endif
317
252static void __init zylonite_init(void) 318static void __init zylonite_init(void)
253{ 319{
254 /* board-processor specific initialization */ 320 /* board-processor specific initialization */
@@ -265,6 +331,7 @@ static void __init zylonite_init(void)
265 331
266 zylonite_init_lcd(); 332 zylonite_init_lcd();
267 zylonite_init_mmc(); 333 zylonite_init_mmc();
334 zylonite_init_keypad();
268} 335}
269 336
270MACHINE_START(ZYLONITE, "PXA3xx Platform Development Kit (aka Zylonite)") 337MACHINE_START(ZYLONITE, "PXA3xx Platform Development Kit (aka Zylonite)")