blob: 4f212e1b95393966f8f1c6a1ddd19c32631a0df0 [file] [log] [blame]
Stefan Schmidt9ab24e42008-07-09 08:08:17 +01001/*
2 * ezx.c - Common code for the EZX platform.
3 *
4 * Copyright (C) 2005-2006 Harald Welte <laforge@openezx.org>,
5 * 2007-2008 Daniel Ribeiro <drwyrm@gmail.com>,
6 * 2007-2008 Stefan Schmidt <stefan@datenfreihafen.org>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 *
12 */
13
14#include <linux/kernel.h>
15#include <linux/init.h>
16#include <linux/platform_device.h>
17#include <linux/delay.h>
18#include <linux/pwm_backlight.h>
Stefan Schmidtfe9490c2008-12-08 15:58:09 +010019#include <linux/input.h>
Stefan Schmidt9ab24e42008-07-09 08:08:17 +010020
21#include <asm/setup.h>
Russell Kinga09e64f2008-08-05 16:14:15 +010022#include <mach/pxafb.h>
23#include <mach/ohci.h>
24#include <mach/i2c.h>
Stefan Schmidtfe9490c2008-12-08 15:58:09 +010025#include <mach/pxa27x_keypad.h>
Stefan Schmidt9ab24e42008-07-09 08:08:17 +010026
Russell Kinga09e64f2008-08-05 16:14:15 +010027#include <mach/mfp-pxa27x.h>
28#include <mach/pxa-regs.h>
29#include <mach/pxa2xx-regs.h>
Stefan Schmidt9ab24e42008-07-09 08:08:17 +010030#include <asm/mach-types.h>
31#include <asm/mach/arch.h>
32
33#include "devices.h"
34#include "generic.h"
35
36static struct platform_pwm_backlight_data ezx_backlight_data = {
37 .pwm_id = 0,
38 .max_brightness = 1023,
39 .dft_brightness = 1023,
40 .pwm_period_ns = 78770,
41};
42
43static struct platform_device ezx_backlight_device = {
44 .name = "pwm-backlight",
45 .dev = {
46 .parent = &pxa27x_device_pwm0.dev,
47 .platform_data = &ezx_backlight_data,
48 },
49};
50
51static struct pxafb_mode_info mode_ezx_old = {
52 .pixclock = 150000,
53 .xres = 240,
54 .yres = 320,
55 .bpp = 16,
56 .hsync_len = 10,
57 .left_margin = 20,
58 .right_margin = 10,
59 .vsync_len = 2,
60 .upper_margin = 3,
61 .lower_margin = 2,
62 .sync = 0,
63};
64
65static struct pxafb_mach_info ezx_fb_info_1 = {
66 .modes = &mode_ezx_old,
67 .num_modes = 1,
68 .lcd_conn = LCD_COLOR_TFT_16BPP,
69};
70
71static struct pxafb_mode_info mode_72r89803y01 = {
72 .pixclock = 192308,
73 .xres = 240,
74 .yres = 320,
75 .bpp = 32,
76 .depth = 18,
77 .hsync_len = 10,
78 .left_margin = 20,
79 .right_margin = 10,
80 .vsync_len = 2,
81 .upper_margin = 3,
82 .lower_margin = 2,
83 .sync = 0,
84};
85
86static struct pxafb_mach_info ezx_fb_info_2 = {
87 .modes = &mode_72r89803y01,
88 .num_modes = 1,
89 .lcd_conn = LCD_COLOR_TFT_18BPP,
90};
91
92static struct platform_device *devices[] __initdata = {
93 &ezx_backlight_device,
94};
95
96static unsigned long ezx_pin_config[] __initdata = {
97 /* PWM backlight */
98 GPIO16_PWM0_OUT,
99
100 /* BTUART */
101 GPIO42_BTUART_RXD,
102 GPIO43_BTUART_TXD,
103 GPIO44_BTUART_CTS,
104 GPIO45_BTUART_RTS,
105
Eric Miao6f584cf2008-11-28 16:00:24 +0800106 /* I2C */
107 GPIO117_I2C_SCL,
108 GPIO118_I2C_SDA,
Stefan Schmidt9078ac22008-12-08 15:58:08 +0100109
110 /* PCAP SSP */
111 GPIO29_SSP1_SCLK,
112 GPIO25_SSP1_TXD,
113 GPIO26_SSP1_RXD,
114 GPIO24_GPIO, /* pcap chip select */
115 GPIO1_GPIO, /* pcap interrupt */
116 GPIO4_GPIO, /* WDI_AP */
117 GPIO55_GPIO, /* SYS_RESTART */
118
119 /* MMC */
120 GPIO32_MMC_CLK,
121 GPIO92_MMC_DAT_0,
122 GPIO109_MMC_DAT_1,
123 GPIO110_MMC_DAT_2,
124 GPIO111_MMC_DAT_3,
125 GPIO112_MMC_CMD,
126 GPIO11_GPIO, /* mmc detect */
127
128 /* usb to external transceiver */
129 GPIO34_USB_P2_2,
130 GPIO35_USB_P2_1,
131 GPIO36_USB_P2_4,
132 GPIO39_USB_P2_6,
133 GPIO40_USB_P2_5,
134 GPIO53_USB_P2_3,
135
136 /* usb to Neptune GSM chip */
137 GPIO30_USB_P3_2,
138 GPIO31_USB_P3_6,
139 GPIO90_USB_P3_5,
140 GPIO91_USB_P3_1,
141 GPIO56_USB_P3_4,
142 GPIO113_USB_P3_3,
Stefan Schmidt9ab24e42008-07-09 08:08:17 +0100143};
144
Stefan Schmidt9078ac22008-12-08 15:58:08 +0100145#if defined(CONFIG_MACH_EZX_A780) || defined(CONFIG_MACH_EZX_E680)
146static unsigned long gen1_pin_config[] __initdata = {
147 /* flip / lockswitch */
148 GPIO12_GPIO,
149
150 /* bluetooth (bcm2035) */
151 GPIO14_GPIO | WAKEUP_ON_LEVEL_HIGH, /* HOSTWAKE */
152 GPIO48_GPIO, /* RESET */
153 GPIO28_GPIO, /* WAKEUP */
154
155 /* Neptune handshake */
156 GPIO0_GPIO | WAKEUP_ON_LEVEL_HIGH, /* BP_RDY */
157 GPIO57_GPIO, /* AP_RDY */
158 GPIO13_GPIO | WAKEUP_ON_LEVEL_HIGH, /* WDI */
159 GPIO3_GPIO | WAKEUP_ON_LEVEL_HIGH, /* WDI2 */
160 GPIO82_GPIO, /* RESET */
161 GPIO99_GPIO, /* TC_MM_EN */
162
163 /* sound */
164 GPIO52_SSP3_SCLK,
165 GPIO83_SSP3_SFRM,
166 GPIO81_SSP3_TXD,
167 GPIO89_SSP3_RXD,
168
169 /* ssp2 pins to in */
170 GPIO22_GPIO, /* SSP2_SCLK */
171 GPIO37_GPIO, /* SSP2_SFRM */
172 GPIO38_GPIO, /* SSP2_TXD */
173 GPIO88_GPIO, /* SSP2_RXD */
174
175 /* camera */
176 GPIO23_CIF_MCLK,
177 GPIO54_CIF_PCLK,
178 GPIO85_CIF_LV,
179 GPIO84_CIF_FV,
180 GPIO27_CIF_DD_0,
181 GPIO114_CIF_DD_1,
182 GPIO51_CIF_DD_2,
183 GPIO115_CIF_DD_3,
184 GPIO95_CIF_DD_4,
185 GPIO94_CIF_DD_5,
186 GPIO17_CIF_DD_6,
187 GPIO108_CIF_DD_7,
188 GPIO50_GPIO, /* CAM_EN */
189 GPIO19_GPIO, /* CAM_RST */
190
191 /* EMU */
192 GPIO120_GPIO, /* EMU_MUX1 */
193 GPIO119_GPIO, /* EMU_MUX2 */
194 GPIO86_GPIO, /* SNP_INT_CTL */
195 GPIO87_GPIO, /* SNP_INT_IN */
196};
197#endif
198
199#if defined(CONFIG_MACH_EZX_A1200) || defined(CONFIG_MACH_EZX_A910) || \
200 defined(CONFIG_MACH_EZX_E2) || defined(CONFIG_MACH_EZX_E6)
201static unsigned long gen2_pin_config[] __initdata = {
202 /* flip / lockswitch */
203 GPIO15_GPIO,
204
205 /* EOC */
206 GPIO10_GPIO,
207
208 /* bluetooth (bcm2045) */
209 GPIO13_GPIO | WAKEUP_ON_LEVEL_HIGH, /* HOSTWAKE */
210 GPIO37_GPIO, /* RESET */
211 GPIO57_GPIO, /* WAKEUP */
212
213 /* Neptune handshake */
214 GPIO0_GPIO | WAKEUP_ON_LEVEL_HIGH, /* BP_RDY */
215 GPIO96_GPIO, /* AP_RDY */
216 GPIO3_GPIO | WAKEUP_ON_LEVEL_HIGH, /* WDI */
217 GPIO116_GPIO, /* RESET */
218 GPIO41_GPIO, /* BP_FLASH */
219
220 /* sound */
221 GPIO52_SSP3_SCLK,
222 GPIO83_SSP3_SFRM,
223 GPIO81_SSP3_TXD,
224 GPIO82_SSP3_RXD,
225
226 /* ssp2 pins to in */
227 GPIO22_GPIO, /* SSP2_SCLK */
228 GPIO14_GPIO, /* SSP2_SFRM */
229 GPIO38_GPIO, /* SSP2_TXD */
230 GPIO88_GPIO, /* SSP2_RXD */
231
232 /* camera */
233 GPIO23_CIF_MCLK,
234 GPIO54_CIF_PCLK,
235 GPIO85_CIF_LV,
236 GPIO84_CIF_FV,
237 GPIO27_CIF_DD_0,
238 GPIO114_CIF_DD_1,
239 GPIO51_CIF_DD_2,
240 GPIO115_CIF_DD_3,
241 GPIO95_CIF_DD_4,
242 GPIO48_CIF_DD_5,
243 GPIO93_CIF_DD_6,
244 GPIO12_CIF_DD_7,
245 GPIO50_GPIO, /* CAM_EN */
246 GPIO28_GPIO, /* CAM_RST */
247 GPIO17_GPIO, /* CAM_FLASH */
248};
249#endif
250
251#ifdef CONFIG_MACH_EZX_A780
252static unsigned long a780_pin_config[] __initdata = {
253 /* keypad */
254 GPIO93_KP_DKIN_0 | WAKEUP_ON_LEVEL_HIGH,
255 GPIO100_KP_MKIN_0 | WAKEUP_ON_LEVEL_HIGH,
256 GPIO101_KP_MKIN_1 | WAKEUP_ON_LEVEL_HIGH,
257 GPIO102_KP_MKIN_2 | WAKEUP_ON_LEVEL_HIGH,
258 GPIO97_KP_MKIN_3 | WAKEUP_ON_LEVEL_HIGH,
259 GPIO98_KP_MKIN_4 | WAKEUP_ON_LEVEL_HIGH,
260 GPIO103_KP_MKOUT_0,
261 GPIO104_KP_MKOUT_1,
262 GPIO105_KP_MKOUT_2,
263 GPIO106_KP_MKOUT_3,
264 GPIO107_KP_MKOUT_4,
265
266 /* attenuate sound */
267 GPIO96_GPIO,
268};
269#endif
270
271#ifdef CONFIG_MACH_EZX_E680
272static unsigned long e680_pin_config[] __initdata = {
273 /* keypad */
274 GPIO93_KP_DKIN_0 | WAKEUP_ON_LEVEL_HIGH,
275 GPIO96_KP_DKIN_3 | WAKEUP_ON_LEVEL_HIGH,
276 GPIO97_KP_DKIN_4 | WAKEUP_ON_LEVEL_HIGH,
277 GPIO98_KP_DKIN_5 | WAKEUP_ON_LEVEL_HIGH,
278 GPIO100_KP_MKIN_0 | WAKEUP_ON_LEVEL_HIGH,
279 GPIO101_KP_MKIN_1 | WAKEUP_ON_LEVEL_HIGH,
280 GPIO102_KP_MKIN_2 | WAKEUP_ON_LEVEL_HIGH,
281 GPIO103_KP_MKOUT_0,
282 GPIO104_KP_MKOUT_1,
283 GPIO105_KP_MKOUT_2,
284 GPIO106_KP_MKOUT_3,
285
286 /* MIDI */
287 GPIO79_GPIO, /* VA_SEL_BUL */
288 GPIO80_GPIO, /* FLT_SEL_BUL */
289 GPIO78_GPIO, /* MIDI_RESET */
290 GPIO33_GPIO, /* MIDI_CS */
291 GPIO15_GPIO, /* MIDI_IRQ */
292 GPIO49_GPIO, /* MIDI_NPWE */
293 GPIO18_GPIO, /* MIDI_RDY */
294
295 /* leds */
296 GPIO46_GPIO,
297 GPIO47_GPIO,
298};
299#endif
300
301#ifdef CONFIG_MACH_EZX_A1200
302static unsigned long a1200_pin_config[] __initdata = {
303 /* keypad */
304 GPIO100_KP_MKIN_0 | WAKEUP_ON_LEVEL_HIGH,
305 GPIO101_KP_MKIN_1 | WAKEUP_ON_LEVEL_HIGH,
306 GPIO102_KP_MKIN_2 | WAKEUP_ON_LEVEL_HIGH,
307 GPIO97_KP_MKIN_3 | WAKEUP_ON_LEVEL_HIGH,
308 GPIO98_KP_MKIN_4 | WAKEUP_ON_LEVEL_HIGH,
309 GPIO103_KP_MKOUT_0,
310 GPIO104_KP_MKOUT_1,
311 GPIO105_KP_MKOUT_2,
312 GPIO106_KP_MKOUT_3,
313 GPIO107_KP_MKOUT_4,
314 GPIO108_KP_MKOUT_5,
315};
316#endif
317
318#ifdef CONFIG_MACH_EZX_A910
319static unsigned long a910_pin_config[] __initdata = {
320 /* keypad */
321 GPIO100_KP_MKIN_0 | WAKEUP_ON_LEVEL_HIGH,
322 GPIO101_KP_MKIN_1 | WAKEUP_ON_LEVEL_HIGH,
323 GPIO102_KP_MKIN_2 | WAKEUP_ON_LEVEL_HIGH,
324 GPIO97_KP_MKIN_3 | WAKEUP_ON_LEVEL_HIGH,
325 GPIO98_KP_MKIN_4 | WAKEUP_ON_LEVEL_HIGH,
326 GPIO103_KP_MKOUT_0,
327 GPIO104_KP_MKOUT_1,
328 GPIO105_KP_MKOUT_2,
329 GPIO106_KP_MKOUT_3,
330 GPIO107_KP_MKOUT_4,
331 GPIO108_KP_MKOUT_5,
332
333 /* WLAN */
334 GPIO89_GPIO, /* RESET */
335 GPIO33_GPIO, /* WAKEUP */
336 GPIO94_GPIO | WAKEUP_ON_LEVEL_HIGH, /* HOSTWAKE */
337
338 /* MMC CS */
339 GPIO20_GPIO,
340};
341#endif
342
343#ifdef CONFIG_MACH_EZX_E2
344static unsigned long e2_pin_config[] __initdata = {
345 /* keypad */
346 GPIO100_KP_MKIN_0 | WAKEUP_ON_LEVEL_HIGH,
347 GPIO101_KP_MKIN_1 | WAKEUP_ON_LEVEL_HIGH,
348 GPIO102_KP_MKIN_2 | WAKEUP_ON_LEVEL_HIGH,
349 GPIO97_KP_MKIN_3 | WAKEUP_ON_LEVEL_HIGH,
350 GPIO98_KP_MKIN_4 | WAKEUP_ON_LEVEL_HIGH,
351 GPIO103_KP_MKOUT_0,
352 GPIO104_KP_MKOUT_1,
353 GPIO105_KP_MKOUT_2,
354 GPIO106_KP_MKOUT_3,
355 GPIO107_KP_MKOUT_4,
356 GPIO108_KP_MKOUT_5,
357};
358#endif
359
360#ifdef CONFIG_MACH_EZX_E6
361static unsigned long e6_pin_config[] __initdata = {
362 /* keypad */
363 GPIO100_KP_MKIN_0 | WAKEUP_ON_LEVEL_HIGH,
364 GPIO101_KP_MKIN_1 | WAKEUP_ON_LEVEL_HIGH,
365 GPIO102_KP_MKIN_2 | WAKEUP_ON_LEVEL_HIGH,
366 GPIO97_KP_MKIN_3 | WAKEUP_ON_LEVEL_HIGH,
367 GPIO98_KP_MKIN_4 | WAKEUP_ON_LEVEL_HIGH,
368 GPIO103_KP_MKOUT_0,
369 GPIO104_KP_MKOUT_1,
370 GPIO105_KP_MKOUT_2,
371 GPIO106_KP_MKOUT_3,
372 GPIO107_KP_MKOUT_4,
373 GPIO108_KP_MKOUT_5,
374};
375#endif
376
Stefan Schmidtfe9490c2008-12-08 15:58:09 +0100377/* KEYPAD */
378#ifdef CONFIG_MACH_EZX_A780
379static unsigned int a780_key_map[] = {
380 KEY(0, 0, KEY_SEND),
381 KEY(0, 1, KEY_BACK),
382 KEY(0, 2, KEY_END),
383 KEY(0, 3, KEY_PAGEUP),
384 KEY(0, 4, KEY_UP),
385
386 KEY(1, 0, KEY_NUMERIC_1),
387 KEY(1, 1, KEY_NUMERIC_2),
388 KEY(1, 2, KEY_NUMERIC_3),
389 KEY(1, 3, KEY_SELECT),
390 KEY(1, 4, KEY_KPENTER),
391
392 KEY(2, 0, KEY_NUMERIC_4),
393 KEY(2, 1, KEY_NUMERIC_5),
394 KEY(2, 2, KEY_NUMERIC_6),
395 KEY(2, 3, KEY_RECORD),
396 KEY(2, 4, KEY_LEFT),
397
398 KEY(3, 0, KEY_NUMERIC_7),
399 KEY(3, 1, KEY_NUMERIC_8),
400 KEY(3, 2, KEY_NUMERIC_9),
401 KEY(3, 3, KEY_HOME),
402 KEY(3, 4, KEY_RIGHT),
403
404 KEY(4, 0, KEY_NUMERIC_STAR),
405 KEY(4, 1, KEY_NUMERIC_0),
406 KEY(4, 2, KEY_NUMERIC_POUND),
407 KEY(4, 3, KEY_PAGEDOWN),
408 KEY(4, 4, KEY_DOWN),
409};
410
411static struct pxa27x_keypad_platform_data a780_keypad_platform_data = {
412 .matrix_key_rows = 5,
413 .matrix_key_cols = 5,
414 .matrix_key_map = a780_key_map,
415 .matrix_key_map_size = ARRAY_SIZE(a780_key_map),
416
417 .direct_key_map = { KEY_CAMERA },
418 .direct_key_num = 1,
419
420 .debounce_interval = 30,
421};
422#endif /* CONFIG_MACH_EZX_A780 */
423
424#ifdef CONFIG_MACH_EZX_E680
425static unsigned int e680_key_map[] = {
426 KEY(0, 0, KEY_UP),
427 KEY(0, 1, KEY_RIGHT),
428 KEY(0, 2, KEY_RESERVED),
429 KEY(0, 3, KEY_SEND),
430
431 KEY(1, 0, KEY_DOWN),
432 KEY(1, 1, KEY_LEFT),
433 KEY(1, 2, KEY_PAGEUP),
434 KEY(1, 3, KEY_PAGEDOWN),
435
436 KEY(2, 0, KEY_RESERVED),
437 KEY(2, 1, KEY_RESERVED),
438 KEY(2, 2, KEY_RESERVED),
439 KEY(2, 3, KEY_KPENTER),
440};
441
442static struct pxa27x_keypad_platform_data e680_keypad_platform_data = {
443 .matrix_key_rows = 3,
444 .matrix_key_cols = 4,
445 .matrix_key_map = e680_key_map,
446 .matrix_key_map_size = ARRAY_SIZE(e680_key_map),
447
448 .direct_key_map = {
449 KEY_CAMERA,
450 KEY_RESERVED,
451 KEY_RESERVED,
452 KEY_F1,
453 KEY_CANCEL,
454 KEY_F2,
455 },
456 .direct_key_num = 6,
457
458 .debounce_interval = 30,
459};
460#endif /* CONFIG_MACH_EZX_E680 */
461
462#ifdef CONFIG_MACH_EZX_A1200
463static unsigned int a1200_key_map[] = {
464 KEY(0, 0, KEY_RESERVED),
465 KEY(0, 1, KEY_RIGHT),
466 KEY(0, 2, KEY_PAGEDOWN),
467 KEY(0, 3, KEY_RESERVED),
468 KEY(0, 4, KEY_RESERVED),
469 KEY(0, 5, KEY_RESERVED),
470
471 KEY(1, 0, KEY_RESERVED),
472 KEY(1, 1, KEY_DOWN),
473 KEY(1, 2, KEY_CAMERA),
474 KEY(1, 3, KEY_RESERVED),
475 KEY(1, 4, KEY_RESERVED),
476 KEY(1, 5, KEY_RESERVED),
477
478 KEY(2, 0, KEY_RESERVED),
479 KEY(2, 1, KEY_KPENTER),
480 KEY(2, 2, KEY_RECORD),
481 KEY(2, 3, KEY_RESERVED),
482 KEY(2, 4, KEY_RESERVED),
483 KEY(2, 5, KEY_SELECT),
484
485 KEY(3, 0, KEY_RESERVED),
486 KEY(3, 1, KEY_UP),
487 KEY(3, 2, KEY_SEND),
488 KEY(3, 3, KEY_RESERVED),
489 KEY(3, 4, KEY_RESERVED),
490 KEY(3, 5, KEY_RESERVED),
491
492 KEY(4, 0, KEY_RESERVED),
493 KEY(4, 1, KEY_LEFT),
494 KEY(4, 2, KEY_PAGEUP),
495 KEY(4, 3, KEY_RESERVED),
496 KEY(4, 4, KEY_RESERVED),
497 KEY(4, 5, KEY_RESERVED),
498};
499
500static struct pxa27x_keypad_platform_data a1200_keypad_platform_data = {
501 .matrix_key_rows = 5,
502 .matrix_key_cols = 6,
503 .matrix_key_map = a1200_key_map,
504 .matrix_key_map_size = ARRAY_SIZE(a1200_key_map),
505
506 .debounce_interval = 30,
507};
508#endif /* CONFIG_MACH_EZX_A1200 */
509
510#ifdef CONFIG_MACH_EZX_E6
511static unsigned int e6_key_map[] = {
512 KEY(0, 0, KEY_RESERVED),
513 KEY(0, 1, KEY_RIGHT),
514 KEY(0, 2, KEY_PAGEDOWN),
515 KEY(0, 3, KEY_RESERVED),
516 KEY(0, 4, KEY_RESERVED),
517 KEY(0, 5, KEY_NEXTSONG),
518
519 KEY(1, 0, KEY_RESERVED),
520 KEY(1, 1, KEY_DOWN),
521 KEY(1, 2, KEY_PROG1),
522 KEY(1, 3, KEY_RESERVED),
523 KEY(1, 4, KEY_RESERVED),
524 KEY(1, 5, KEY_RESERVED),
525
526 KEY(2, 0, KEY_RESERVED),
527 KEY(2, 1, KEY_ENTER),
528 KEY(2, 2, KEY_CAMERA),
529 KEY(2, 3, KEY_RESERVED),
530 KEY(2, 4, KEY_RESERVED),
531 KEY(2, 5, KEY_WWW),
532
533 KEY(3, 0, KEY_RESERVED),
534 KEY(3, 1, KEY_UP),
535 KEY(3, 2, KEY_SEND),
536 KEY(3, 3, KEY_RESERVED),
537 KEY(3, 4, KEY_RESERVED),
538 KEY(3, 5, KEY_PLAYPAUSE),
539
540 KEY(4, 0, KEY_RESERVED),
541 KEY(4, 1, KEY_LEFT),
542 KEY(4, 2, KEY_PAGEUP),
543 KEY(4, 3, KEY_RESERVED),
544 KEY(4, 4, KEY_RESERVED),
545 KEY(4, 5, KEY_PREVIOUSSONG),
546};
547
548static struct pxa27x_keypad_platform_data e6_keypad_platform_data = {
549 .matrix_key_rows = 5,
550 .matrix_key_cols = 6,
551 .matrix_key_map = e6_key_map,
552 .matrix_key_map_size = ARRAY_SIZE(e6_key_map),
553
554 .debounce_interval = 30,
555};
556#endif /* CONFIG_MACH_EZX_E6 */
557
558#ifdef CONFIG_MACH_EZX_A910
559static unsigned int a910_key_map[] = {
560 KEY(0, 0, KEY_NUMERIC_6),
561 KEY(0, 1, KEY_RIGHT),
562 KEY(0, 2, KEY_PAGEDOWN),
563 KEY(0, 3, KEY_KPENTER),
564 KEY(0, 4, KEY_NUMERIC_5),
565 KEY(0, 5, KEY_CAMERA),
566
567 KEY(1, 0, KEY_NUMERIC_8),
568 KEY(1, 1, KEY_DOWN),
569 KEY(1, 2, KEY_RESERVED),
570 KEY(1, 3, KEY_F1), /* Left SoftKey */
571 KEY(1, 4, KEY_NUMERIC_STAR),
572 KEY(1, 5, KEY_RESERVED),
573
574 KEY(2, 0, KEY_NUMERIC_7),
575 KEY(2, 1, KEY_NUMERIC_9),
576 KEY(2, 2, KEY_RECORD),
577 KEY(2, 3, KEY_F2), /* Right SoftKey */
578 KEY(2, 4, KEY_BACK),
579 KEY(2, 5, KEY_SELECT),
580
581 KEY(3, 0, KEY_NUMERIC_2),
582 KEY(3, 1, KEY_UP),
583 KEY(3, 2, KEY_SEND),
584 KEY(3, 3, KEY_NUMERIC_0),
585 KEY(3, 4, KEY_NUMERIC_1),
586 KEY(3, 5, KEY_RECORD),
587
588 KEY(4, 0, KEY_NUMERIC_4),
589 KEY(4, 1, KEY_LEFT),
590 KEY(4, 2, KEY_PAGEUP),
591 KEY(4, 3, KEY_NUMERIC_POUND),
592 KEY(4, 4, KEY_NUMERIC_3),
593 KEY(4, 5, KEY_RESERVED),
594};
595
596static struct pxa27x_keypad_platform_data a910_keypad_platform_data = {
597 .matrix_key_rows = 5,
598 .matrix_key_cols = 6,
599 .matrix_key_map = a910_key_map,
600 .matrix_key_map_size = ARRAY_SIZE(a910_key_map),
601
602 .debounce_interval = 30,
603};
604#endif /* CONFIG_MACH_EZX_A910 */
605
606#ifdef CONFIG_MACH_EZX_E2
607static unsigned int e2_key_map[] = {
608 KEY(0, 0, KEY_NUMERIC_6),
609 KEY(0, 1, KEY_RIGHT),
610 KEY(0, 2, KEY_NUMERIC_9),
611 KEY(0, 3, KEY_NEXTSONG),
612 KEY(0, 4, KEY_NUMERIC_5),
613 KEY(0, 5, KEY_F1), /* Left SoftKey */
614
615 KEY(1, 0, KEY_NUMERIC_8),
616 KEY(1, 1, KEY_DOWN),
617 KEY(1, 2, KEY_RESERVED),
618 KEY(1, 3, KEY_PAGEUP),
619 KEY(1, 4, KEY_NUMERIC_STAR),
620 KEY(1, 5, KEY_F2), /* Right SoftKey */
621
622 KEY(2, 0, KEY_NUMERIC_7),
623 KEY(2, 1, KEY_KPENTER),
624 KEY(2, 2, KEY_RECORD),
625 KEY(2, 3, KEY_PAGEDOWN),
626 KEY(2, 4, KEY_BACK),
627 KEY(2, 5, KEY_NUMERIC_0),
628
629 KEY(3, 0, KEY_NUMERIC_2),
630 KEY(3, 1, KEY_UP),
631 KEY(3, 2, KEY_SEND),
632 KEY(3, 3, KEY_PLAYPAUSE),
633 KEY(3, 4, KEY_NUMERIC_1),
634 KEY(3, 5, KEY_SOUND), /* Music SoftKey */
635
636 KEY(4, 0, KEY_NUMERIC_4),
637 KEY(4, 1, KEY_LEFT),
638 KEY(4, 2, KEY_NUMERIC_POUND),
639 KEY(4, 3, KEY_PREVIOUSSONG),
640 KEY(4, 4, KEY_NUMERIC_3),
641 KEY(4, 5, KEY_RESERVED),
642};
643
644static struct pxa27x_keypad_platform_data e2_keypad_platform_data = {
645 .matrix_key_rows = 5,
646 .matrix_key_cols = 6,
647 .matrix_key_map = e2_key_map,
648 .matrix_key_map_size = ARRAY_SIZE(e2_key_map),
649
650 .debounce_interval = 30,
651};
652#endif /* CONFIG_MACH_EZX_E2 */
653
Stefan Schmidt9078ac22008-12-08 15:58:08 +0100654#ifdef CONFIG_MACH_EZX_A780
655static void __init a780_init(void)
Stefan Schmidt9ab24e42008-07-09 08:08:17 +0100656{
657 pxa2xx_mfp_config(ARRAY_AND_SIZE(ezx_pin_config));
Stefan Schmidt9078ac22008-12-08 15:58:08 +0100658 pxa2xx_mfp_config(ARRAY_AND_SIZE(gen1_pin_config));
659 pxa2xx_mfp_config(ARRAY_AND_SIZE(a780_pin_config));
660
Stefan Schmidt9ab24e42008-07-09 08:08:17 +0100661 pxa_set_i2c_info(NULL);
Stefan Schmidt9078ac22008-12-08 15:58:08 +0100662
663 set_pxa_fb_info(&ezx_fb_info_1);
Stefan Schmidt9ab24e42008-07-09 08:08:17 +0100664
Stefan Schmidtfe9490c2008-12-08 15:58:09 +0100665 pxa_set_keypad_info(&a780_keypad_platform_data);
666
Stefan Schmidt9ab24e42008-07-09 08:08:17 +0100667 platform_add_devices(devices, ARRAY_SIZE(devices));
668}
669
Stefan Schmidt9ab24e42008-07-09 08:08:17 +0100670MACHINE_START(EZX_A780, "Motorola EZX A780")
671 .phys_io = 0x40000000,
672 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
Stefan Schmidt9ab24e42008-07-09 08:08:17 +0100673 .boot_params = 0xa0000100,
674 .map_io = pxa_map_io,
675 .init_irq = pxa27x_init_irq,
676 .timer = &pxa_timer,
Stefan Schmidt9078ac22008-12-08 15:58:08 +0100677 .init_machine = a780_init,
Stefan Schmidt9ab24e42008-07-09 08:08:17 +0100678MACHINE_END
679#endif
680
681#ifdef CONFIG_MACH_EZX_E680
Stefan Schmidtbc09cf62008-12-08 15:58:10 +0100682static struct i2c_board_info __initdata e680_i2c_board_info[] = {
683 { I2C_BOARD_INFO("tea5767", 0x81) },
684};
685
Stefan Schmidt9078ac22008-12-08 15:58:08 +0100686static void __init e680_init(void)
687{
688 pxa2xx_mfp_config(ARRAY_AND_SIZE(ezx_pin_config));
689 pxa2xx_mfp_config(ARRAY_AND_SIZE(gen1_pin_config));
690 pxa2xx_mfp_config(ARRAY_AND_SIZE(e680_pin_config));
691
692 pxa_set_i2c_info(NULL);
Stefan Schmidtbc09cf62008-12-08 15:58:10 +0100693 i2c_register_board_info(0, ARRAY_AND_SIZE(e680_i2c_board_info));
Stefan Schmidt9078ac22008-12-08 15:58:08 +0100694
695 set_pxa_fb_info(&ezx_fb_info_1);
696
Stefan Schmidtfe9490c2008-12-08 15:58:09 +0100697 pxa_set_keypad_info(&e680_keypad_platform_data);
698
Stefan Schmidt9078ac22008-12-08 15:58:08 +0100699 platform_add_devices(devices, ARRAY_SIZE(devices));
700}
701
Stefan Schmidt9ab24e42008-07-09 08:08:17 +0100702MACHINE_START(EZX_E680, "Motorola EZX E680")
703 .phys_io = 0x40000000,
704 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
Stefan Schmidt9ab24e42008-07-09 08:08:17 +0100705 .boot_params = 0xa0000100,
706 .map_io = pxa_map_io,
707 .init_irq = pxa27x_init_irq,
708 .timer = &pxa_timer,
Stefan Schmidt9078ac22008-12-08 15:58:08 +0100709 .init_machine = e680_init,
Stefan Schmidt9ab24e42008-07-09 08:08:17 +0100710MACHINE_END
711#endif
712
713#ifdef CONFIG_MACH_EZX_A1200
Stefan Schmidtbc09cf62008-12-08 15:58:10 +0100714static struct i2c_board_info __initdata a1200_i2c_board_info[] = {
715 { I2C_BOARD_INFO("tea5767", 0x81) },
716};
717
Stefan Schmidt9078ac22008-12-08 15:58:08 +0100718static void __init a1200_init(void)
719{
720 pxa2xx_mfp_config(ARRAY_AND_SIZE(ezx_pin_config));
721 pxa2xx_mfp_config(ARRAY_AND_SIZE(gen2_pin_config));
722 pxa2xx_mfp_config(ARRAY_AND_SIZE(a1200_pin_config));
723
724 pxa_set_i2c_info(NULL);
Stefan Schmidtbc09cf62008-12-08 15:58:10 +0100725 i2c_register_board_info(0, ARRAY_AND_SIZE(a1200_i2c_board_info));
Stefan Schmidt9078ac22008-12-08 15:58:08 +0100726
727 set_pxa_fb_info(&ezx_fb_info_2);
728
Stefan Schmidtfe9490c2008-12-08 15:58:09 +0100729 pxa_set_keypad_info(&a1200_keypad_platform_data);
730
Stefan Schmidt9078ac22008-12-08 15:58:08 +0100731 platform_add_devices(devices, ARRAY_SIZE(devices));
732}
733
Stefan Schmidt9ab24e42008-07-09 08:08:17 +0100734MACHINE_START(EZX_A1200, "Motorola EZX A1200")
735 .phys_io = 0x40000000,
736 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
Stefan Schmidt9ab24e42008-07-09 08:08:17 +0100737 .boot_params = 0xa0000100,
738 .map_io = pxa_map_io,
739 .init_irq = pxa27x_init_irq,
740 .timer = &pxa_timer,
Stefan Schmidt9078ac22008-12-08 15:58:08 +0100741 .init_machine = a1200_init,
Stefan Schmidt9ab24e42008-07-09 08:08:17 +0100742MACHINE_END
743#endif
744
745#ifdef CONFIG_MACH_EZX_A910
Stefan Schmidt9078ac22008-12-08 15:58:08 +0100746static void __init a910_init(void)
747{
748 pxa2xx_mfp_config(ARRAY_AND_SIZE(ezx_pin_config));
749 pxa2xx_mfp_config(ARRAY_AND_SIZE(gen2_pin_config));
750 pxa2xx_mfp_config(ARRAY_AND_SIZE(a910_pin_config));
751
752 pxa_set_i2c_info(NULL);
753
754 set_pxa_fb_info(&ezx_fb_info_2);
755
Stefan Schmidtfe9490c2008-12-08 15:58:09 +0100756 pxa_set_keypad_info(&a910_keypad_platform_data);
757
Stefan Schmidt9078ac22008-12-08 15:58:08 +0100758 platform_add_devices(devices, ARRAY_SIZE(devices));
759}
760
Stefan Schmidt9ab24e42008-07-09 08:08:17 +0100761MACHINE_START(EZX_A910, "Motorola EZX A910")
762 .phys_io = 0x40000000,
763 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
Stefan Schmidt9ab24e42008-07-09 08:08:17 +0100764 .boot_params = 0xa0000100,
765 .map_io = pxa_map_io,
766 .init_irq = pxa27x_init_irq,
767 .timer = &pxa_timer,
Stefan Schmidt9078ac22008-12-08 15:58:08 +0100768 .init_machine = a910_init,
Stefan Schmidt9ab24e42008-07-09 08:08:17 +0100769MACHINE_END
770#endif
771
772#ifdef CONFIG_MACH_EZX_E6
Stefan Schmidtbc09cf62008-12-08 15:58:10 +0100773static struct i2c_board_info __initdata e6_i2c_board_info[] = {
774 { I2C_BOARD_INFO("tea5767", 0x81) },
775};
776
Stefan Schmidt9078ac22008-12-08 15:58:08 +0100777static void __init e6_init(void)
778{
779 pxa2xx_mfp_config(ARRAY_AND_SIZE(ezx_pin_config));
780 pxa2xx_mfp_config(ARRAY_AND_SIZE(gen2_pin_config));
781 pxa2xx_mfp_config(ARRAY_AND_SIZE(e6_pin_config));
782
783 pxa_set_i2c_info(NULL);
Stefan Schmidtbc09cf62008-12-08 15:58:10 +0100784 i2c_register_board_info(0, ARRAY_AND_SIZE(e6_i2c_board_info));
Stefan Schmidt9078ac22008-12-08 15:58:08 +0100785
786 set_pxa_fb_info(&ezx_fb_info_2);
787
Stefan Schmidtfe9490c2008-12-08 15:58:09 +0100788 pxa_set_keypad_info(&e6_keypad_platform_data);
789
Stefan Schmidt9078ac22008-12-08 15:58:08 +0100790 platform_add_devices(devices, ARRAY_SIZE(devices));
791}
792
Stefan Schmidt9ab24e42008-07-09 08:08:17 +0100793MACHINE_START(EZX_E6, "Motorola EZX E6")
794 .phys_io = 0x40000000,
795 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
Stefan Schmidt9ab24e42008-07-09 08:08:17 +0100796 .boot_params = 0xa0000100,
797 .map_io = pxa_map_io,
798 .init_irq = pxa27x_init_irq,
799 .timer = &pxa_timer,
Stefan Schmidt9078ac22008-12-08 15:58:08 +0100800 .init_machine = e6_init,
Stefan Schmidt9ab24e42008-07-09 08:08:17 +0100801MACHINE_END
802#endif
803
804#ifdef CONFIG_MACH_EZX_E2
Stefan Schmidtbc09cf62008-12-08 15:58:10 +0100805static struct i2c_board_info __initdata e2_i2c_board_info[] = {
806 { I2C_BOARD_INFO("tea5767", 0x81) },
807};
808
Stefan Schmidt9078ac22008-12-08 15:58:08 +0100809static void __init e2_init(void)
810{
811 pxa2xx_mfp_config(ARRAY_AND_SIZE(ezx_pin_config));
812 pxa2xx_mfp_config(ARRAY_AND_SIZE(gen2_pin_config));
813 pxa2xx_mfp_config(ARRAY_AND_SIZE(e2_pin_config));
814
815 pxa_set_i2c_info(NULL);
Stefan Schmidtbc09cf62008-12-08 15:58:10 +0100816 i2c_register_board_info(0, ARRAY_AND_SIZE(e2_i2c_board_info));
Stefan Schmidt9078ac22008-12-08 15:58:08 +0100817
818 set_pxa_fb_info(&ezx_fb_info_2);
819
Stefan Schmidtfe9490c2008-12-08 15:58:09 +0100820 pxa_set_keypad_info(&e2_keypad_platform_data);
821
Stefan Schmidt9078ac22008-12-08 15:58:08 +0100822 platform_add_devices(devices, ARRAY_SIZE(devices));
823}
824
Stefan Schmidt9ab24e42008-07-09 08:08:17 +0100825MACHINE_START(EZX_E2, "Motorola EZX E2")
826 .phys_io = 0x40000000,
827 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
Stefan Schmidt9ab24e42008-07-09 08:08:17 +0100828 .boot_params = 0xa0000100,
829 .map_io = pxa_map_io,
830 .init_irq = pxa27x_init_irq,
831 .timer = &pxa_timer,
Stefan Schmidt9078ac22008-12-08 15:58:08 +0100832 .init_machine = e2_init,
Stefan Schmidt9ab24e42008-07-09 08:08:17 +0100833MACHINE_END
834#endif