2 * ezx.c - Common code for the EZX platform.
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>
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.
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>
19 #include <linux/input.h>
20 #include <linux/gpio_keys.h>
22 #include <asm/setup.h>
23 #include <asm/mach-types.h>
24 #include <asm/mach/arch.h>
26 #include <mach/pxa27x.h>
27 #include <mach/pxafb.h>
28 #include <mach/ohci.h>
30 #include <mach/hardware.h>
31 #include <mach/pxa27x_keypad.h>
36 #define GPIO12_A780_FLIP_LID 12
37 #define GPIO15_A1200_FLIP_LID 15
38 #define GPIO15_A910_FLIP_LID 15
39 #define GPIO12_E680_LOCK_SWITCH 12
40 #define GPIO15_E6_LOCK_SWITCH 15
42 static struct platform_pwm_backlight_data ezx_backlight_data = {
44 .max_brightness = 1023,
45 .dft_brightness = 1023,
46 .pwm_period_ns = 78770,
49 static struct platform_device ezx_backlight_device = {
50 .name = "pwm-backlight",
52 .parent = &pxa27x_device_pwm0.dev,
53 .platform_data = &ezx_backlight_data,
57 static struct pxafb_mode_info mode_ezx_old = {
71 static struct pxafb_mach_info ezx_fb_info_1 = {
72 .modes = &mode_ezx_old,
74 .lcd_conn = LCD_COLOR_TFT_16BPP,
77 static struct pxafb_mode_info mode_72r89803y01 = {
92 static struct pxafb_mach_info ezx_fb_info_2 = {
93 .modes = &mode_72r89803y01,
95 .lcd_conn = LCD_COLOR_TFT_18BPP,
98 static struct platform_device *ezx_devices[] __initdata = {
99 &ezx_backlight_device,
102 static unsigned long ezx_pin_config[] __initdata = {
120 GPIO24_GPIO, /* pcap chip select */
121 GPIO1_GPIO | WAKEUP_ON_EDGE_RISE, /* pcap interrupt */
122 GPIO4_GPIO | MFP_LPM_DRIVE_HIGH, /* WDI_AP */
123 GPIO55_GPIO | MFP_LPM_DRIVE_HIGH, /* SYS_RESTART */
132 GPIO11_GPIO, /* mmc detect */
134 /* usb to external transceiver */
142 /* usb to Neptune GSM chip */
151 #if defined(CONFIG_MACH_EZX_A780) || defined(CONFIG_MACH_EZX_E680)
152 static unsigned long gen1_pin_config[] __initdata = {
153 /* flip / lockswitch */
154 GPIO12_GPIO | WAKEUP_ON_EDGE_BOTH,
156 /* bluetooth (bcm2035) */
157 GPIO14_GPIO | WAKEUP_ON_EDGE_RISE, /* HOSTWAKE */
158 GPIO48_GPIO, /* RESET */
159 GPIO28_GPIO, /* WAKEUP */
161 /* Neptune handshake */
162 GPIO0_GPIO | WAKEUP_ON_EDGE_FALL, /* BP_RDY */
163 GPIO57_GPIO | MFP_LPM_DRIVE_HIGH, /* AP_RDY */
164 GPIO13_GPIO | WAKEUP_ON_EDGE_BOTH, /* WDI */
165 GPIO3_GPIO | WAKEUP_ON_EDGE_BOTH, /* WDI2 */
166 GPIO82_GPIO | MFP_LPM_DRIVE_HIGH, /* RESET */
167 GPIO99_GPIO | MFP_LPM_DRIVE_HIGH, /* TC_MM_EN */
175 /* ssp2 pins to in */
176 GPIO22_GPIO, /* SSP2_SCLK */
177 GPIO37_GPIO, /* SSP2_SFRM */
178 GPIO38_GPIO, /* SSP2_TXD */
179 GPIO88_GPIO, /* SSP2_RXD */
194 GPIO50_GPIO, /* CAM_EN */
195 GPIO19_GPIO, /* CAM_RST */
198 GPIO120_GPIO, /* EMU_MUX1 */
199 GPIO119_GPIO, /* EMU_MUX2 */
200 GPIO86_GPIO, /* SNP_INT_CTL */
201 GPIO87_GPIO, /* SNP_INT_IN */
205 #if defined(CONFIG_MACH_EZX_A1200) || defined(CONFIG_MACH_EZX_A910) || \
206 defined(CONFIG_MACH_EZX_E2) || defined(CONFIG_MACH_EZX_E6)
207 static unsigned long gen2_pin_config[] __initdata = {
208 /* flip / lockswitch */
209 GPIO15_GPIO | WAKEUP_ON_EDGE_BOTH,
212 GPIO10_GPIO | WAKEUP_ON_EDGE_RISE,
214 /* bluetooth (bcm2045) */
215 GPIO13_GPIO | WAKEUP_ON_EDGE_RISE, /* HOSTWAKE */
216 GPIO37_GPIO, /* RESET */
217 GPIO57_GPIO, /* WAKEUP */
219 /* Neptune handshake */
220 GPIO0_GPIO | WAKEUP_ON_EDGE_FALL, /* BP_RDY */
221 GPIO96_GPIO | MFP_LPM_DRIVE_HIGH, /* AP_RDY */
222 GPIO3_GPIO | WAKEUP_ON_EDGE_FALL, /* WDI */
223 GPIO116_GPIO | MFP_LPM_DRIVE_HIGH, /* RESET */
224 GPIO41_GPIO, /* BP_FLASH */
232 /* ssp2 pins to in */
233 GPIO22_GPIO, /* SSP2_SCLK */
234 GPIO14_GPIO, /* SSP2_SFRM */
235 GPIO38_GPIO, /* SSP2_TXD */
236 GPIO88_GPIO, /* SSP2_RXD */
251 GPIO50_GPIO, /* CAM_EN */
252 GPIO28_GPIO, /* CAM_RST */
253 GPIO17_GPIO, /* CAM_FLASH */
257 #ifdef CONFIG_MACH_EZX_A780
258 static unsigned long a780_pin_config[] __initdata = {
260 GPIO93_KP_DKIN_0 | WAKEUP_ON_LEVEL_HIGH,
261 GPIO100_KP_MKIN_0 | WAKEUP_ON_LEVEL_HIGH,
262 GPIO101_KP_MKIN_1 | WAKEUP_ON_LEVEL_HIGH,
263 GPIO102_KP_MKIN_2 | WAKEUP_ON_LEVEL_HIGH,
264 GPIO97_KP_MKIN_3 | WAKEUP_ON_LEVEL_HIGH,
265 GPIO98_KP_MKIN_4 | WAKEUP_ON_LEVEL_HIGH,
272 /* attenuate sound */
277 #ifdef CONFIG_MACH_EZX_E680
278 static unsigned long e680_pin_config[] __initdata = {
280 GPIO93_KP_DKIN_0 | WAKEUP_ON_LEVEL_HIGH,
281 GPIO96_KP_DKIN_3 | WAKEUP_ON_LEVEL_HIGH,
282 GPIO97_KP_DKIN_4 | WAKEUP_ON_LEVEL_HIGH,
283 GPIO98_KP_DKIN_5 | WAKEUP_ON_LEVEL_HIGH,
284 GPIO100_KP_MKIN_0 | WAKEUP_ON_LEVEL_HIGH,
285 GPIO101_KP_MKIN_1 | WAKEUP_ON_LEVEL_HIGH,
286 GPIO102_KP_MKIN_2 | WAKEUP_ON_LEVEL_HIGH,
293 GPIO79_GPIO, /* VA_SEL_BUL */
294 GPIO80_GPIO, /* FLT_SEL_BUL */
295 GPIO78_GPIO, /* MIDI_RESET */
296 GPIO33_GPIO, /* MIDI_CS */
297 GPIO15_GPIO, /* MIDI_IRQ */
298 GPIO49_GPIO, /* MIDI_NPWE */
299 GPIO18_GPIO, /* MIDI_RDY */
307 #ifdef CONFIG_MACH_EZX_A1200
308 static unsigned long a1200_pin_config[] __initdata = {
310 GPIO100_KP_MKIN_0 | WAKEUP_ON_LEVEL_HIGH,
311 GPIO101_KP_MKIN_1 | WAKEUP_ON_LEVEL_HIGH,
312 GPIO102_KP_MKIN_2 | WAKEUP_ON_LEVEL_HIGH,
313 GPIO97_KP_MKIN_3 | WAKEUP_ON_LEVEL_HIGH,
314 GPIO98_KP_MKIN_4 | WAKEUP_ON_LEVEL_HIGH,
324 #ifdef CONFIG_MACH_EZX_A910
325 static unsigned long a910_pin_config[] __initdata = {
327 GPIO100_KP_MKIN_0 | WAKEUP_ON_LEVEL_HIGH,
328 GPIO101_KP_MKIN_1 | WAKEUP_ON_LEVEL_HIGH,
329 GPIO102_KP_MKIN_2 | WAKEUP_ON_LEVEL_HIGH,
330 GPIO97_KP_MKIN_3 | WAKEUP_ON_LEVEL_HIGH,
331 GPIO98_KP_MKIN_4 | WAKEUP_ON_LEVEL_HIGH,
340 GPIO89_GPIO, /* RESET */
341 GPIO33_GPIO, /* WAKEUP */
342 GPIO94_GPIO | WAKEUP_ON_LEVEL_HIGH, /* HOSTWAKE */
349 #ifdef CONFIG_MACH_EZX_E2
350 static unsigned long e2_pin_config[] __initdata = {
352 GPIO100_KP_MKIN_0 | WAKEUP_ON_LEVEL_HIGH,
353 GPIO101_KP_MKIN_1 | WAKEUP_ON_LEVEL_HIGH,
354 GPIO102_KP_MKIN_2 | WAKEUP_ON_LEVEL_HIGH,
355 GPIO97_KP_MKIN_3 | WAKEUP_ON_LEVEL_HIGH,
356 GPIO98_KP_MKIN_4 | WAKEUP_ON_LEVEL_HIGH,
366 #ifdef CONFIG_MACH_EZX_E6
367 static unsigned long e6_pin_config[] __initdata = {
369 GPIO100_KP_MKIN_0 | WAKEUP_ON_LEVEL_HIGH,
370 GPIO101_KP_MKIN_1 | WAKEUP_ON_LEVEL_HIGH,
371 GPIO102_KP_MKIN_2 | WAKEUP_ON_LEVEL_HIGH,
372 GPIO97_KP_MKIN_3 | WAKEUP_ON_LEVEL_HIGH,
373 GPIO98_KP_MKIN_4 | WAKEUP_ON_LEVEL_HIGH,
384 #ifdef CONFIG_MACH_EZX_A780
385 static unsigned int a780_key_map[] = {
389 KEY(0, 3, KEY_PAGEUP),
392 KEY(1, 0, KEY_NUMERIC_1),
393 KEY(1, 1, KEY_NUMERIC_2),
394 KEY(1, 2, KEY_NUMERIC_3),
395 KEY(1, 3, KEY_SELECT),
396 KEY(1, 4, KEY_KPENTER),
398 KEY(2, 0, KEY_NUMERIC_4),
399 KEY(2, 1, KEY_NUMERIC_5),
400 KEY(2, 2, KEY_NUMERIC_6),
401 KEY(2, 3, KEY_RECORD),
404 KEY(3, 0, KEY_NUMERIC_7),
405 KEY(3, 1, KEY_NUMERIC_8),
406 KEY(3, 2, KEY_NUMERIC_9),
408 KEY(3, 4, KEY_RIGHT),
410 KEY(4, 0, KEY_NUMERIC_STAR),
411 KEY(4, 1, KEY_NUMERIC_0),
412 KEY(4, 2, KEY_NUMERIC_POUND),
413 KEY(4, 3, KEY_PAGEDOWN),
417 static struct pxa27x_keypad_platform_data a780_keypad_platform_data = {
418 .matrix_key_rows = 5,
419 .matrix_key_cols = 5,
420 .matrix_key_map = a780_key_map,
421 .matrix_key_map_size = ARRAY_SIZE(a780_key_map),
423 .direct_key_map = { KEY_CAMERA },
426 .debounce_interval = 30,
428 #endif /* CONFIG_MACH_EZX_A780 */
430 #ifdef CONFIG_MACH_EZX_E680
431 static unsigned int e680_key_map[] = {
433 KEY(0, 1, KEY_RIGHT),
434 KEY(0, 2, KEY_RESERVED),
439 KEY(1, 2, KEY_PAGEUP),
440 KEY(1, 3, KEY_PAGEDOWN),
442 KEY(2, 0, KEY_RESERVED),
443 KEY(2, 1, KEY_RESERVED),
444 KEY(2, 2, KEY_RESERVED),
445 KEY(2, 3, KEY_KPENTER),
448 static struct pxa27x_keypad_platform_data e680_keypad_platform_data = {
449 .matrix_key_rows = 3,
450 .matrix_key_cols = 4,
451 .matrix_key_map = e680_key_map,
452 .matrix_key_map_size = ARRAY_SIZE(e680_key_map),
464 .debounce_interval = 30,
466 #endif /* CONFIG_MACH_EZX_E680 */
468 #ifdef CONFIG_MACH_EZX_A1200
469 static unsigned int a1200_key_map[] = {
470 KEY(0, 0, KEY_RESERVED),
471 KEY(0, 1, KEY_RIGHT),
472 KEY(0, 2, KEY_PAGEDOWN),
473 KEY(0, 3, KEY_RESERVED),
474 KEY(0, 4, KEY_RESERVED),
475 KEY(0, 5, KEY_RESERVED),
477 KEY(1, 0, KEY_RESERVED),
479 KEY(1, 2, KEY_CAMERA),
480 KEY(1, 3, KEY_RESERVED),
481 KEY(1, 4, KEY_RESERVED),
482 KEY(1, 5, KEY_RESERVED),
484 KEY(2, 0, KEY_RESERVED),
485 KEY(2, 1, KEY_KPENTER),
486 KEY(2, 2, KEY_RECORD),
487 KEY(2, 3, KEY_RESERVED),
488 KEY(2, 4, KEY_RESERVED),
489 KEY(2, 5, KEY_SELECT),
491 KEY(3, 0, KEY_RESERVED),
494 KEY(3, 3, KEY_RESERVED),
495 KEY(3, 4, KEY_RESERVED),
496 KEY(3, 5, KEY_RESERVED),
498 KEY(4, 0, KEY_RESERVED),
500 KEY(4, 2, KEY_PAGEUP),
501 KEY(4, 3, KEY_RESERVED),
502 KEY(4, 4, KEY_RESERVED),
503 KEY(4, 5, KEY_RESERVED),
506 static struct pxa27x_keypad_platform_data a1200_keypad_platform_data = {
507 .matrix_key_rows = 5,
508 .matrix_key_cols = 6,
509 .matrix_key_map = a1200_key_map,
510 .matrix_key_map_size = ARRAY_SIZE(a1200_key_map),
512 .debounce_interval = 30,
514 #endif /* CONFIG_MACH_EZX_A1200 */
516 #ifdef CONFIG_MACH_EZX_E6
517 static unsigned int e6_key_map[] = {
518 KEY(0, 0, KEY_RESERVED),
519 KEY(0, 1, KEY_RIGHT),
520 KEY(0, 2, KEY_PAGEDOWN),
521 KEY(0, 3, KEY_RESERVED),
522 KEY(0, 4, KEY_RESERVED),
523 KEY(0, 5, KEY_NEXTSONG),
525 KEY(1, 0, KEY_RESERVED),
527 KEY(1, 2, KEY_PROG1),
528 KEY(1, 3, KEY_RESERVED),
529 KEY(1, 4, KEY_RESERVED),
530 KEY(1, 5, KEY_RESERVED),
532 KEY(2, 0, KEY_RESERVED),
533 KEY(2, 1, KEY_ENTER),
534 KEY(2, 2, KEY_CAMERA),
535 KEY(2, 3, KEY_RESERVED),
536 KEY(2, 4, KEY_RESERVED),
539 KEY(3, 0, KEY_RESERVED),
542 KEY(3, 3, KEY_RESERVED),
543 KEY(3, 4, KEY_RESERVED),
544 KEY(3, 5, KEY_PLAYPAUSE),
546 KEY(4, 0, KEY_RESERVED),
548 KEY(4, 2, KEY_PAGEUP),
549 KEY(4, 3, KEY_RESERVED),
550 KEY(4, 4, KEY_RESERVED),
551 KEY(4, 5, KEY_PREVIOUSSONG),
554 static struct pxa27x_keypad_platform_data e6_keypad_platform_data = {
555 .matrix_key_rows = 5,
556 .matrix_key_cols = 6,
557 .matrix_key_map = e6_key_map,
558 .matrix_key_map_size = ARRAY_SIZE(e6_key_map),
560 .debounce_interval = 30,
562 #endif /* CONFIG_MACH_EZX_E6 */
564 #ifdef CONFIG_MACH_EZX_A910
565 static unsigned int a910_key_map[] = {
566 KEY(0, 0, KEY_NUMERIC_6),
567 KEY(0, 1, KEY_RIGHT),
568 KEY(0, 2, KEY_PAGEDOWN),
569 KEY(0, 3, KEY_KPENTER),
570 KEY(0, 4, KEY_NUMERIC_5),
571 KEY(0, 5, KEY_CAMERA),
573 KEY(1, 0, KEY_NUMERIC_8),
575 KEY(1, 2, KEY_RESERVED),
576 KEY(1, 3, KEY_F1), /* Left SoftKey */
577 KEY(1, 4, KEY_NUMERIC_STAR),
578 KEY(1, 5, KEY_RESERVED),
580 KEY(2, 0, KEY_NUMERIC_7),
581 KEY(2, 1, KEY_NUMERIC_9),
582 KEY(2, 2, KEY_RECORD),
583 KEY(2, 3, KEY_F2), /* Right SoftKey */
585 KEY(2, 5, KEY_SELECT),
587 KEY(3, 0, KEY_NUMERIC_2),
590 KEY(3, 3, KEY_NUMERIC_0),
591 KEY(3, 4, KEY_NUMERIC_1),
592 KEY(3, 5, KEY_RECORD),
594 KEY(4, 0, KEY_NUMERIC_4),
596 KEY(4, 2, KEY_PAGEUP),
597 KEY(4, 3, KEY_NUMERIC_POUND),
598 KEY(4, 4, KEY_NUMERIC_3),
599 KEY(4, 5, KEY_RESERVED),
602 static struct pxa27x_keypad_platform_data a910_keypad_platform_data = {
603 .matrix_key_rows = 5,
604 .matrix_key_cols = 6,
605 .matrix_key_map = a910_key_map,
606 .matrix_key_map_size = ARRAY_SIZE(a910_key_map),
608 .debounce_interval = 30,
610 #endif /* CONFIG_MACH_EZX_A910 */
612 #ifdef CONFIG_MACH_EZX_E2
613 static unsigned int e2_key_map[] = {
614 KEY(0, 0, KEY_NUMERIC_6),
615 KEY(0, 1, KEY_RIGHT),
616 KEY(0, 2, KEY_NUMERIC_9),
617 KEY(0, 3, KEY_NEXTSONG),
618 KEY(0, 4, KEY_NUMERIC_5),
619 KEY(0, 5, KEY_F1), /* Left SoftKey */
621 KEY(1, 0, KEY_NUMERIC_8),
623 KEY(1, 2, KEY_RESERVED),
624 KEY(1, 3, KEY_PAGEUP),
625 KEY(1, 4, KEY_NUMERIC_STAR),
626 KEY(1, 5, KEY_F2), /* Right SoftKey */
628 KEY(2, 0, KEY_NUMERIC_7),
629 KEY(2, 1, KEY_KPENTER),
630 KEY(2, 2, KEY_RECORD),
631 KEY(2, 3, KEY_PAGEDOWN),
633 KEY(2, 5, KEY_NUMERIC_0),
635 KEY(3, 0, KEY_NUMERIC_2),
638 KEY(3, 3, KEY_PLAYPAUSE),
639 KEY(3, 4, KEY_NUMERIC_1),
640 KEY(3, 5, KEY_SOUND), /* Music SoftKey */
642 KEY(4, 0, KEY_NUMERIC_4),
644 KEY(4, 2, KEY_NUMERIC_POUND),
645 KEY(4, 3, KEY_PREVIOUSSONG),
646 KEY(4, 4, KEY_NUMERIC_3),
647 KEY(4, 5, KEY_RESERVED),
650 static struct pxa27x_keypad_platform_data e2_keypad_platform_data = {
651 .matrix_key_rows = 5,
652 .matrix_key_cols = 6,
653 .matrix_key_map = e2_key_map,
654 .matrix_key_map_size = ARRAY_SIZE(e2_key_map),
656 .debounce_interval = 30,
658 #endif /* CONFIG_MACH_EZX_E2 */
660 #ifdef CONFIG_MACH_EZX_A780
662 static struct gpio_keys_button a780_buttons[] = {
665 .gpio = GPIO12_A780_FLIP_LID,
667 .desc = "A780 flip lid",
673 static struct gpio_keys_platform_data a780_gpio_keys_platform_data = {
674 .buttons = a780_buttons,
675 .nbuttons = ARRAY_SIZE(a780_buttons),
678 static struct platform_device a780_gpio_keys = {
682 .platform_data = &a780_gpio_keys_platform_data,
686 static struct platform_device *a780_devices[] __initdata = {
690 static void __init a780_init(void)
692 pxa2xx_mfp_config(ARRAY_AND_SIZE(ezx_pin_config));
693 pxa2xx_mfp_config(ARRAY_AND_SIZE(gen1_pin_config));
694 pxa2xx_mfp_config(ARRAY_AND_SIZE(a780_pin_config));
696 pxa_set_i2c_info(NULL);
698 set_pxa_fb_info(&ezx_fb_info_1);
700 pxa_set_keypad_info(&a780_keypad_platform_data);
702 platform_add_devices(ARRAY_AND_SIZE(ezx_devices));
703 platform_add_devices(ARRAY_AND_SIZE(a780_devices));
706 MACHINE_START(EZX_A780, "Motorola EZX A780")
707 .phys_io = 0x40000000,
708 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
709 .boot_params = 0xa0000100,
710 .map_io = pxa_map_io,
711 .init_irq = pxa27x_init_irq,
713 .init_machine = a780_init,
717 #ifdef CONFIG_MACH_EZX_E680
719 static struct gpio_keys_button e680_buttons[] = {
721 .code = KEY_SCREENLOCK,
722 .gpio = GPIO12_E680_LOCK_SWITCH,
724 .desc = "E680 lock switch",
730 static struct gpio_keys_platform_data e680_gpio_keys_platform_data = {
731 .buttons = e680_buttons,
732 .nbuttons = ARRAY_SIZE(e680_buttons),
735 static struct platform_device e680_gpio_keys = {
739 .platform_data = &e680_gpio_keys_platform_data,
743 static struct i2c_board_info __initdata e680_i2c_board_info[] = {
744 { I2C_BOARD_INFO("tea5767", 0x81) },
747 static struct platform_device *e680_devices[] __initdata = {
751 static void __init e680_init(void)
753 pxa2xx_mfp_config(ARRAY_AND_SIZE(ezx_pin_config));
754 pxa2xx_mfp_config(ARRAY_AND_SIZE(gen1_pin_config));
755 pxa2xx_mfp_config(ARRAY_AND_SIZE(e680_pin_config));
757 pxa_set_i2c_info(NULL);
758 i2c_register_board_info(0, ARRAY_AND_SIZE(e680_i2c_board_info));
760 set_pxa_fb_info(&ezx_fb_info_1);
762 pxa_set_keypad_info(&e680_keypad_platform_data);
764 platform_add_devices(ARRAY_AND_SIZE(ezx_devices));
765 platform_add_devices(ARRAY_AND_SIZE(e680_devices));
768 MACHINE_START(EZX_E680, "Motorola EZX E680")
769 .phys_io = 0x40000000,
770 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
771 .boot_params = 0xa0000100,
772 .map_io = pxa_map_io,
773 .init_irq = pxa27x_init_irq,
775 .init_machine = e680_init,
779 #ifdef CONFIG_MACH_EZX_A1200
781 static struct gpio_keys_button a1200_buttons[] = {
784 .gpio = GPIO15_A1200_FLIP_LID,
786 .desc = "A1200 flip lid",
792 static struct gpio_keys_platform_data a1200_gpio_keys_platform_data = {
793 .buttons = a1200_buttons,
794 .nbuttons = ARRAY_SIZE(a1200_buttons),
797 static struct platform_device a1200_gpio_keys = {
801 .platform_data = &a1200_gpio_keys_platform_data,
805 static struct i2c_board_info __initdata a1200_i2c_board_info[] = {
806 { I2C_BOARD_INFO("tea5767", 0x81) },
809 static struct platform_device *a1200_devices[] __initdata = {
813 static void __init a1200_init(void)
815 pxa2xx_mfp_config(ARRAY_AND_SIZE(ezx_pin_config));
816 pxa2xx_mfp_config(ARRAY_AND_SIZE(gen2_pin_config));
817 pxa2xx_mfp_config(ARRAY_AND_SIZE(a1200_pin_config));
819 pxa_set_i2c_info(NULL);
820 i2c_register_board_info(0, ARRAY_AND_SIZE(a1200_i2c_board_info));
822 set_pxa_fb_info(&ezx_fb_info_2);
824 pxa_set_keypad_info(&a1200_keypad_platform_data);
826 platform_add_devices(ARRAY_AND_SIZE(ezx_devices));
827 platform_add_devices(ARRAY_AND_SIZE(a1200_devices));
830 MACHINE_START(EZX_A1200, "Motorola EZX A1200")
831 .phys_io = 0x40000000,
832 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
833 .boot_params = 0xa0000100,
834 .map_io = pxa_map_io,
835 .init_irq = pxa27x_init_irq,
837 .init_machine = a1200_init,
841 #ifdef CONFIG_MACH_EZX_A910
843 static struct gpio_keys_button a910_buttons[] = {
846 .gpio = GPIO15_A910_FLIP_LID,
848 .desc = "A910 flip lid",
854 static struct gpio_keys_platform_data a910_gpio_keys_platform_data = {
855 .buttons = a910_buttons,
856 .nbuttons = ARRAY_SIZE(a910_buttons),
859 static struct platform_device a910_gpio_keys = {
863 .platform_data = &a910_gpio_keys_platform_data,
867 static struct platform_device *a910_devices[] __initdata = {
871 static void __init a910_init(void)
873 pxa2xx_mfp_config(ARRAY_AND_SIZE(ezx_pin_config));
874 pxa2xx_mfp_config(ARRAY_AND_SIZE(gen2_pin_config));
875 pxa2xx_mfp_config(ARRAY_AND_SIZE(a910_pin_config));
877 pxa_set_i2c_info(NULL);
879 set_pxa_fb_info(&ezx_fb_info_2);
881 pxa_set_keypad_info(&a910_keypad_platform_data);
883 platform_add_devices(ARRAY_AND_SIZE(ezx_devices));
884 platform_add_devices(ARRAY_AND_SIZE(a910_devices));
887 MACHINE_START(EZX_A910, "Motorola EZX A910")
888 .phys_io = 0x40000000,
889 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
890 .boot_params = 0xa0000100,
891 .map_io = pxa_map_io,
892 .init_irq = pxa27x_init_irq,
894 .init_machine = a910_init,
898 #ifdef CONFIG_MACH_EZX_E6
900 static struct gpio_keys_button e6_buttons[] = {
902 .code = KEY_SCREENLOCK,
903 .gpio = GPIO15_E6_LOCK_SWITCH,
905 .desc = "E6 lock switch",
911 static struct gpio_keys_platform_data e6_gpio_keys_platform_data = {
912 .buttons = e6_buttons,
913 .nbuttons = ARRAY_SIZE(e6_buttons),
916 static struct platform_device e6_gpio_keys = {
920 .platform_data = &e6_gpio_keys_platform_data,
924 static struct i2c_board_info __initdata e6_i2c_board_info[] = {
925 { I2C_BOARD_INFO("tea5767", 0x81) },
928 static struct platform_device *e6_devices[] __initdata = {
932 static void __init e6_init(void)
934 pxa2xx_mfp_config(ARRAY_AND_SIZE(ezx_pin_config));
935 pxa2xx_mfp_config(ARRAY_AND_SIZE(gen2_pin_config));
936 pxa2xx_mfp_config(ARRAY_AND_SIZE(e6_pin_config));
938 pxa_set_i2c_info(NULL);
939 i2c_register_board_info(0, ARRAY_AND_SIZE(e6_i2c_board_info));
941 set_pxa_fb_info(&ezx_fb_info_2);
943 pxa_set_keypad_info(&e6_keypad_platform_data);
945 platform_add_devices(ARRAY_AND_SIZE(ezx_devices));
946 platform_add_devices(ARRAY_AND_SIZE(e6_devices));
949 MACHINE_START(EZX_E6, "Motorola EZX E6")
950 .phys_io = 0x40000000,
951 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
952 .boot_params = 0xa0000100,
953 .map_io = pxa_map_io,
954 .init_irq = pxa27x_init_irq,
956 .init_machine = e6_init,
960 #ifdef CONFIG_MACH_EZX_E2
961 static struct i2c_board_info __initdata e2_i2c_board_info[] = {
962 { I2C_BOARD_INFO("tea5767", 0x81) },
965 static struct platform_device *e2_devices[] __initdata = {
968 static void __init e2_init(void)
970 pxa2xx_mfp_config(ARRAY_AND_SIZE(ezx_pin_config));
971 pxa2xx_mfp_config(ARRAY_AND_SIZE(gen2_pin_config));
972 pxa2xx_mfp_config(ARRAY_AND_SIZE(e2_pin_config));
974 pxa_set_i2c_info(NULL);
975 i2c_register_board_info(0, ARRAY_AND_SIZE(e2_i2c_board_info));
977 set_pxa_fb_info(&ezx_fb_info_2);
979 pxa_set_keypad_info(&e2_keypad_platform_data);
981 platform_add_devices(ARRAY_AND_SIZE(ezx_devices));
982 platform_add_devices(ARRAY_AND_SIZE(e2_devices));
985 MACHINE_START(EZX_E2, "Motorola EZX E2")
986 .phys_io = 0x40000000,
987 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
988 .boot_params = 0xa0000100,
989 .map_io = pxa_map_io,
990 .init_irq = pxa27x_init_irq,
992 .init_machine = e2_init,