Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0-only
0002 /*
0003  *  ezx.c - Common code for the EZX platform.
0004  *
0005  *  Copyright (C) 2005-2006 Harald Welte <laforge@openezx.org>,
0006  *        2007-2008 Daniel Ribeiro <drwyrm@gmail.com>,
0007  *        2007-2008 Stefan Schmidt <stefan@datenfreihafen.org>
0008  */
0009 
0010 #include <linux/kernel.h>
0011 #include <linux/init.h>
0012 #include <linux/platform_device.h>
0013 #include <linux/delay.h>
0014 #include <linux/pwm.h>
0015 #include <linux/pwm_backlight.h>
0016 #include <linux/regulator/machine.h>
0017 #include <linux/regulator/fixed.h>
0018 #include <linux/input.h>
0019 #include <linux/gpio.h>
0020 #include <linux/gpio/machine.h>
0021 #include <linux/gpio_keys.h>
0022 #include <linux/leds-lp3944.h>
0023 #include <linux/platform_data/i2c-pxa.h>
0024 
0025 #include <asm/setup.h>
0026 #include <asm/mach-types.h>
0027 #include <asm/mach/arch.h>
0028 
0029 #include "pxa27x.h"
0030 #include <linux/platform_data/video-pxafb.h>
0031 #include <linux/platform_data/usb-ohci-pxa27x.h>
0032 #include <linux/platform_data/keypad-pxa27x.h>
0033 #include <linux/platform_data/media/camera-pxa.h>
0034 
0035 #include "devices.h"
0036 #include "generic.h"
0037 
0038 #define EZX_NR_IRQS         (IRQ_BOARD_START + 24)
0039 
0040 #define GPIO12_A780_FLIP_LID        12
0041 #define GPIO15_A1200_FLIP_LID       15
0042 #define GPIO15_A910_FLIP_LID        15
0043 #define GPIO12_E680_LOCK_SWITCH     12
0044 #define GPIO15_E6_LOCK_SWITCH       15
0045 #define GPIO50_nCAM_EN          50
0046 #define GPIO19_GEN1_CAM_RST     19
0047 #define GPIO28_GEN2_CAM_RST     28
0048 
0049 static struct pwm_lookup ezx_pwm_lookup[] __maybe_unused = {
0050     PWM_LOOKUP("pxa27x-pwm.0", 0, "pwm-backlight.0", NULL, 78700,
0051            PWM_POLARITY_NORMAL),
0052 };
0053 
0054 static struct platform_pwm_backlight_data ezx_backlight_data = {
0055     .max_brightness = 1023,
0056     .dft_brightness = 1023,
0057 };
0058 
0059 static struct platform_device ezx_backlight_device = {
0060     .name       = "pwm-backlight",
0061     .dev        = {
0062         .parent = &pxa27x_device_pwm0.dev,
0063         .platform_data = &ezx_backlight_data,
0064     },
0065 };
0066 
0067 static struct pxafb_mode_info mode_ezx_old = {
0068     .pixclock       = 150000,
0069     .xres           = 240,
0070     .yres           = 320,
0071     .bpp            = 16,
0072     .hsync_len      = 10,
0073     .left_margin        = 20,
0074     .right_margin       = 10,
0075     .vsync_len      = 2,
0076     .upper_margin       = 3,
0077     .lower_margin       = 2,
0078     .sync           = 0,
0079 };
0080 
0081 static struct pxafb_mach_info ezx_fb_info_1 __maybe_unused = {
0082     .modes      = &mode_ezx_old,
0083     .num_modes  = 1,
0084     .lcd_conn   = LCD_COLOR_TFT_16BPP,
0085 };
0086 
0087 static struct pxafb_mode_info mode_72r89803y01 = {
0088     .pixclock       = 192308,
0089     .xres           = 240,
0090     .yres           = 320,
0091     .bpp            = 32,
0092     .depth          = 18,
0093     .hsync_len      = 10,
0094     .left_margin        = 20,
0095     .right_margin       = 10,
0096     .vsync_len      = 2,
0097     .upper_margin       = 3,
0098     .lower_margin       = 2,
0099     .sync           = 0,
0100 };
0101 
0102 static struct pxafb_mach_info ezx_fb_info_2 __maybe_unused = {
0103     .modes      = &mode_72r89803y01,
0104     .num_modes  = 1,
0105     .lcd_conn   = LCD_COLOR_TFT_18BPP,
0106 };
0107 
0108 static struct platform_device *ezx_devices[] __initdata __maybe_unused = {
0109     &ezx_backlight_device,
0110 };
0111 
0112 static unsigned long ezx_pin_config[] __initdata __maybe_unused = {
0113     /* PWM backlight */
0114     GPIO16_PWM0_OUT,
0115 
0116     /* BTUART */
0117     GPIO42_BTUART_RXD,
0118     GPIO43_BTUART_TXD,
0119     GPIO44_BTUART_CTS,
0120     GPIO45_BTUART_RTS,
0121 
0122     /* I2C */
0123     GPIO117_I2C_SCL,
0124     GPIO118_I2C_SDA,
0125 
0126     /* PCAP SSP */
0127     GPIO29_SSP1_SCLK,
0128     GPIO25_SSP1_TXD,
0129     GPIO26_SSP1_RXD,
0130     GPIO24_GPIO,                /* pcap chip select */
0131     GPIO1_GPIO | WAKEUP_ON_EDGE_RISE,   /* pcap interrupt */
0132     GPIO4_GPIO | MFP_LPM_DRIVE_HIGH,    /* WDI_AP */
0133     GPIO55_GPIO | MFP_LPM_DRIVE_HIGH,   /* SYS_RESTART */
0134 
0135     /* MMC */
0136     GPIO32_MMC_CLK,
0137     GPIO92_MMC_DAT_0,
0138     GPIO109_MMC_DAT_1,
0139     GPIO110_MMC_DAT_2,
0140     GPIO111_MMC_DAT_3,
0141     GPIO112_MMC_CMD,
0142     GPIO11_GPIO,                /* mmc detect */
0143 
0144     /* usb to external transceiver */
0145     GPIO34_USB_P2_2,
0146     GPIO35_USB_P2_1,
0147     GPIO36_USB_P2_4,
0148     GPIO39_USB_P2_6,
0149     GPIO40_USB_P2_5,
0150     GPIO53_USB_P2_3,
0151 
0152     /* usb to Neptune GSM chip */
0153     GPIO30_USB_P3_2,
0154     GPIO31_USB_P3_6,
0155     GPIO90_USB_P3_5,
0156     GPIO91_USB_P3_1,
0157     GPIO56_USB_P3_4,
0158     GPIO113_USB_P3_3,
0159 };
0160 
0161 #if defined(CONFIG_MACH_EZX_A780) || defined(CONFIG_MACH_EZX_E680)
0162 static unsigned long gen1_pin_config[] __initdata = {
0163     /* flip / lockswitch */
0164     GPIO12_GPIO | WAKEUP_ON_EDGE_BOTH,
0165 
0166     /* bluetooth (bcm2035) */
0167     GPIO14_GPIO | WAKEUP_ON_EDGE_RISE,  /* HOSTWAKE */
0168     GPIO48_GPIO,                /* RESET */
0169     GPIO28_GPIO,                /* WAKEUP */
0170 
0171     /* Neptune handshake */
0172     GPIO0_GPIO | WAKEUP_ON_EDGE_FALL,   /* BP_RDY */
0173     GPIO57_GPIO | MFP_LPM_DRIVE_HIGH,   /* AP_RDY */
0174     GPIO13_GPIO | WAKEUP_ON_EDGE_BOTH,  /* WDI */
0175     GPIO3_GPIO | WAKEUP_ON_EDGE_BOTH,   /* WDI2 */
0176     GPIO82_GPIO | MFP_LPM_DRIVE_HIGH,   /* RESET */
0177     GPIO99_GPIO | MFP_LPM_DRIVE_HIGH,   /* TC_MM_EN */
0178 
0179     /* sound */
0180     GPIO52_SSP3_SCLK,
0181     GPIO83_SSP3_SFRM,
0182     GPIO81_SSP3_TXD,
0183     GPIO89_SSP3_RXD,
0184 
0185     /* ssp2 pins to in */
0186     GPIO22_GPIO,                /* SSP2_SCLK */
0187     GPIO37_GPIO,                /* SSP2_SFRM */
0188     GPIO38_GPIO,                /* SSP2_TXD */
0189     GPIO88_GPIO,                /* SSP2_RXD */
0190 
0191     /* camera */
0192     GPIO23_CIF_MCLK,
0193     GPIO54_CIF_PCLK,
0194     GPIO85_CIF_LV,
0195     GPIO84_CIF_FV,
0196     GPIO27_CIF_DD_0,
0197     GPIO114_CIF_DD_1,
0198     GPIO51_CIF_DD_2,
0199     GPIO115_CIF_DD_3,
0200     GPIO95_CIF_DD_4,
0201     GPIO94_CIF_DD_5,
0202     GPIO17_CIF_DD_6,
0203     GPIO108_CIF_DD_7,
0204     GPIO50_GPIO | MFP_LPM_DRIVE_HIGH,   /* CAM_EN */
0205     GPIO19_GPIO | MFP_LPM_DRIVE_HIGH,   /* CAM_RST */
0206 
0207     /* EMU */
0208     GPIO120_GPIO,               /* EMU_MUX1 */
0209     GPIO119_GPIO,               /* EMU_MUX2 */
0210     GPIO86_GPIO,                /* SNP_INT_CTL */
0211     GPIO87_GPIO,                /* SNP_INT_IN */
0212 };
0213 #endif
0214 
0215 #if defined(CONFIG_MACH_EZX_A1200) || defined(CONFIG_MACH_EZX_A910) || \
0216     defined(CONFIG_MACH_EZX_E2) || defined(CONFIG_MACH_EZX_E6)
0217 static unsigned long gen2_pin_config[] __initdata = {
0218     /* flip / lockswitch */
0219     GPIO15_GPIO | WAKEUP_ON_EDGE_BOTH,
0220 
0221     /* EOC */
0222     GPIO10_GPIO | WAKEUP_ON_EDGE_RISE,
0223 
0224     /* bluetooth (bcm2045) */
0225     GPIO13_GPIO | WAKEUP_ON_EDGE_RISE,  /* HOSTWAKE */
0226     GPIO37_GPIO,                /* RESET */
0227     GPIO57_GPIO,                /* WAKEUP */
0228 
0229     /* Neptune handshake */
0230     GPIO0_GPIO | WAKEUP_ON_EDGE_FALL,   /* BP_RDY */
0231     GPIO96_GPIO | MFP_LPM_DRIVE_HIGH,   /* AP_RDY */
0232     GPIO3_GPIO | WAKEUP_ON_EDGE_FALL,   /* WDI */
0233     GPIO116_GPIO | MFP_LPM_DRIVE_HIGH,  /* RESET */
0234     GPIO41_GPIO,                /* BP_FLASH */
0235 
0236     /* sound */
0237     GPIO52_SSP3_SCLK,
0238     GPIO83_SSP3_SFRM,
0239     GPIO81_SSP3_TXD,
0240     GPIO82_SSP3_RXD,
0241 
0242     /* ssp2 pins to in */
0243     GPIO22_GPIO,                /* SSP2_SCLK */
0244     GPIO14_GPIO,                /* SSP2_SFRM */
0245     GPIO38_GPIO,                /* SSP2_TXD */
0246     GPIO88_GPIO,                /* SSP2_RXD */
0247 
0248     /* camera */
0249     GPIO23_CIF_MCLK,
0250     GPIO54_CIF_PCLK,
0251     GPIO85_CIF_LV,
0252     GPIO84_CIF_FV,
0253     GPIO27_CIF_DD_0,
0254     GPIO114_CIF_DD_1,
0255     GPIO51_CIF_DD_2,
0256     GPIO115_CIF_DD_3,
0257     GPIO95_CIF_DD_4,
0258     GPIO48_CIF_DD_5,
0259     GPIO93_CIF_DD_6,
0260     GPIO12_CIF_DD_7,
0261     GPIO50_GPIO | MFP_LPM_DRIVE_HIGH,   /* CAM_EN */
0262     GPIO28_GPIO | MFP_LPM_DRIVE_HIGH,   /* CAM_RST */
0263     GPIO17_GPIO,                /* CAM_FLASH */
0264 };
0265 #endif
0266 
0267 #ifdef CONFIG_MACH_EZX_A780
0268 static unsigned long a780_pin_config[] __initdata = {
0269     /* keypad */
0270     GPIO93_KP_DKIN_0 | WAKEUP_ON_LEVEL_HIGH,
0271     GPIO100_KP_MKIN_0 | WAKEUP_ON_LEVEL_HIGH,
0272     GPIO101_KP_MKIN_1 | WAKEUP_ON_LEVEL_HIGH,
0273     GPIO102_KP_MKIN_2 | WAKEUP_ON_LEVEL_HIGH,
0274     GPIO97_KP_MKIN_3 | WAKEUP_ON_LEVEL_HIGH,
0275     GPIO98_KP_MKIN_4 | WAKEUP_ON_LEVEL_HIGH,
0276     GPIO103_KP_MKOUT_0,
0277     GPIO104_KP_MKOUT_1,
0278     GPIO105_KP_MKOUT_2,
0279     GPIO106_KP_MKOUT_3,
0280     GPIO107_KP_MKOUT_4,
0281 
0282     /* attenuate sound */
0283     GPIO96_GPIO,
0284 };
0285 #endif
0286 
0287 #ifdef CONFIG_MACH_EZX_E680
0288 static unsigned long e680_pin_config[] __initdata = {
0289     /* keypad */
0290     GPIO93_KP_DKIN_0 | WAKEUP_ON_LEVEL_HIGH,
0291     GPIO96_KP_DKIN_3 | WAKEUP_ON_LEVEL_HIGH,
0292     GPIO97_KP_DKIN_4 | WAKEUP_ON_LEVEL_HIGH,
0293     GPIO98_KP_DKIN_5 | WAKEUP_ON_LEVEL_HIGH,
0294     GPIO100_KP_MKIN_0 | WAKEUP_ON_LEVEL_HIGH,
0295     GPIO101_KP_MKIN_1 | WAKEUP_ON_LEVEL_HIGH,
0296     GPIO102_KP_MKIN_2 | WAKEUP_ON_LEVEL_HIGH,
0297     GPIO103_KP_MKOUT_0,
0298     GPIO104_KP_MKOUT_1,
0299     GPIO105_KP_MKOUT_2,
0300     GPIO106_KP_MKOUT_3,
0301 
0302     /* MIDI */
0303     GPIO79_GPIO,                /* VA_SEL_BUL */
0304     GPIO80_GPIO,                /* FLT_SEL_BUL */
0305     GPIO78_GPIO,                /* MIDI_RESET */
0306     GPIO33_GPIO,                /* MIDI_CS */
0307     GPIO15_GPIO,                /* MIDI_IRQ */
0308     GPIO49_GPIO,                /* MIDI_NPWE */
0309     GPIO18_GPIO,                /* MIDI_RDY */
0310 
0311     /* leds */
0312     GPIO46_GPIO,
0313     GPIO47_GPIO,
0314 };
0315 #endif
0316 
0317 #ifdef CONFIG_MACH_EZX_A1200
0318 static unsigned long a1200_pin_config[] __initdata = {
0319     /* keypad */
0320     GPIO100_KP_MKIN_0 | WAKEUP_ON_LEVEL_HIGH,
0321     GPIO101_KP_MKIN_1 | WAKEUP_ON_LEVEL_HIGH,
0322     GPIO102_KP_MKIN_2 | WAKEUP_ON_LEVEL_HIGH,
0323     GPIO97_KP_MKIN_3 | WAKEUP_ON_LEVEL_HIGH,
0324     GPIO98_KP_MKIN_4 | WAKEUP_ON_LEVEL_HIGH,
0325     GPIO103_KP_MKOUT_0,
0326     GPIO104_KP_MKOUT_1,
0327     GPIO105_KP_MKOUT_2,
0328     GPIO106_KP_MKOUT_3,
0329     GPIO107_KP_MKOUT_4,
0330     GPIO108_KP_MKOUT_5,
0331 };
0332 #endif
0333 
0334 #ifdef CONFIG_MACH_EZX_A910
0335 static unsigned long a910_pin_config[] __initdata = {
0336     /* keypad */
0337     GPIO100_KP_MKIN_0 | WAKEUP_ON_LEVEL_HIGH,
0338     GPIO101_KP_MKIN_1 | WAKEUP_ON_LEVEL_HIGH,
0339     GPIO102_KP_MKIN_2 | WAKEUP_ON_LEVEL_HIGH,
0340     GPIO97_KP_MKIN_3 | WAKEUP_ON_LEVEL_HIGH,
0341     GPIO98_KP_MKIN_4 | WAKEUP_ON_LEVEL_HIGH,
0342     GPIO103_KP_MKOUT_0,
0343     GPIO104_KP_MKOUT_1,
0344     GPIO105_KP_MKOUT_2,
0345     GPIO106_KP_MKOUT_3,
0346     GPIO107_KP_MKOUT_4,
0347     GPIO108_KP_MKOUT_5,
0348 
0349     /* WLAN */
0350     GPIO89_GPIO,                /* RESET */
0351     GPIO33_GPIO,                /* WAKEUP */
0352     GPIO94_GPIO | WAKEUP_ON_LEVEL_HIGH, /* HOSTWAKE */
0353 
0354     /* MMC CS */
0355     GPIO20_GPIO,
0356 };
0357 #endif
0358 
0359 #ifdef CONFIG_MACH_EZX_E2
0360 static unsigned long e2_pin_config[] __initdata = {
0361     /* keypad */
0362     GPIO100_KP_MKIN_0 | WAKEUP_ON_LEVEL_HIGH,
0363     GPIO101_KP_MKIN_1 | WAKEUP_ON_LEVEL_HIGH,
0364     GPIO102_KP_MKIN_2 | WAKEUP_ON_LEVEL_HIGH,
0365     GPIO97_KP_MKIN_3 | WAKEUP_ON_LEVEL_HIGH,
0366     GPIO98_KP_MKIN_4 | WAKEUP_ON_LEVEL_HIGH,
0367     GPIO103_KP_MKOUT_0,
0368     GPIO104_KP_MKOUT_1,
0369     GPIO105_KP_MKOUT_2,
0370     GPIO106_KP_MKOUT_3,
0371     GPIO107_KP_MKOUT_4,
0372     GPIO108_KP_MKOUT_5,
0373 };
0374 #endif
0375 
0376 #ifdef CONFIG_MACH_EZX_E6
0377 static unsigned long e6_pin_config[] __initdata = {
0378     /* keypad */
0379     GPIO100_KP_MKIN_0 | WAKEUP_ON_LEVEL_HIGH,
0380     GPIO101_KP_MKIN_1 | WAKEUP_ON_LEVEL_HIGH,
0381     GPIO102_KP_MKIN_2 | WAKEUP_ON_LEVEL_HIGH,
0382     GPIO97_KP_MKIN_3 | WAKEUP_ON_LEVEL_HIGH,
0383     GPIO98_KP_MKIN_4 | WAKEUP_ON_LEVEL_HIGH,
0384     GPIO103_KP_MKOUT_0,
0385     GPIO104_KP_MKOUT_1,
0386     GPIO105_KP_MKOUT_2,
0387     GPIO106_KP_MKOUT_3,
0388     GPIO107_KP_MKOUT_4,
0389     GPIO108_KP_MKOUT_5,
0390 };
0391 #endif
0392 
0393 /* KEYPAD */
0394 #ifdef CONFIG_MACH_EZX_A780
0395 static const unsigned int a780_key_map[] = {
0396     KEY(0, 0, KEY_SEND),
0397     KEY(0, 1, KEY_BACK),
0398     KEY(0, 2, KEY_END),
0399     KEY(0, 3, KEY_PAGEUP),
0400     KEY(0, 4, KEY_UP),
0401 
0402     KEY(1, 0, KEY_NUMERIC_1),
0403     KEY(1, 1, KEY_NUMERIC_2),
0404     KEY(1, 2, KEY_NUMERIC_3),
0405     KEY(1, 3, KEY_SELECT),
0406     KEY(1, 4, KEY_KPENTER),
0407 
0408     KEY(2, 0, KEY_NUMERIC_4),
0409     KEY(2, 1, KEY_NUMERIC_5),
0410     KEY(2, 2, KEY_NUMERIC_6),
0411     KEY(2, 3, KEY_RECORD),
0412     KEY(2, 4, KEY_LEFT),
0413 
0414     KEY(3, 0, KEY_NUMERIC_7),
0415     KEY(3, 1, KEY_NUMERIC_8),
0416     KEY(3, 2, KEY_NUMERIC_9),
0417     KEY(3, 3, KEY_HOME),
0418     KEY(3, 4, KEY_RIGHT),
0419 
0420     KEY(4, 0, KEY_NUMERIC_STAR),
0421     KEY(4, 1, KEY_NUMERIC_0),
0422     KEY(4, 2, KEY_NUMERIC_POUND),
0423     KEY(4, 3, KEY_PAGEDOWN),
0424     KEY(4, 4, KEY_DOWN),
0425 };
0426 
0427 static struct matrix_keymap_data a780_matrix_keymap_data = {
0428     .keymap         = a780_key_map,
0429     .keymap_size        = ARRAY_SIZE(a780_key_map),
0430 };
0431 
0432 static struct pxa27x_keypad_platform_data a780_keypad_platform_data = {
0433     .matrix_key_rows = 5,
0434     .matrix_key_cols = 5,
0435     .matrix_keymap_data = &a780_matrix_keymap_data,
0436 
0437     .direct_key_map = { KEY_CAMERA },
0438     .direct_key_num = 1,
0439 
0440     .debounce_interval = 30,
0441 };
0442 #endif /* CONFIG_MACH_EZX_A780 */
0443 
0444 #ifdef CONFIG_MACH_EZX_E680
0445 static const unsigned int e680_key_map[] = {
0446     KEY(0, 0, KEY_UP),
0447     KEY(0, 1, KEY_RIGHT),
0448     KEY(0, 2, KEY_RESERVED),
0449     KEY(0, 3, KEY_SEND),
0450 
0451     KEY(1, 0, KEY_DOWN),
0452     KEY(1, 1, KEY_LEFT),
0453     KEY(1, 2, KEY_PAGEUP),
0454     KEY(1, 3, KEY_PAGEDOWN),
0455 
0456     KEY(2, 0, KEY_RESERVED),
0457     KEY(2, 1, KEY_RESERVED),
0458     KEY(2, 2, KEY_RESERVED),
0459     KEY(2, 3, KEY_KPENTER),
0460 };
0461 
0462 static struct matrix_keymap_data e680_matrix_keymap_data = {
0463     .keymap         = e680_key_map,
0464     .keymap_size        = ARRAY_SIZE(e680_key_map),
0465 };
0466 
0467 static struct pxa27x_keypad_platform_data e680_keypad_platform_data = {
0468     .matrix_key_rows = 3,
0469     .matrix_key_cols = 4,
0470     .matrix_keymap_data = &e680_matrix_keymap_data,
0471 
0472     .direct_key_map = {
0473         KEY_CAMERA,
0474         KEY_RESERVED,
0475         KEY_RESERVED,
0476         KEY_F1,
0477         KEY_CANCEL,
0478         KEY_F2,
0479     },
0480     .direct_key_num = 6,
0481 
0482     .debounce_interval = 30,
0483 };
0484 #endif /* CONFIG_MACH_EZX_E680 */
0485 
0486 #ifdef CONFIG_MACH_EZX_A1200
0487 static const unsigned int a1200_key_map[] = {
0488     KEY(0, 0, KEY_RESERVED),
0489     KEY(0, 1, KEY_RIGHT),
0490     KEY(0, 2, KEY_PAGEDOWN),
0491     KEY(0, 3, KEY_RESERVED),
0492     KEY(0, 4, KEY_RESERVED),
0493     KEY(0, 5, KEY_RESERVED),
0494 
0495     KEY(1, 0, KEY_RESERVED),
0496     KEY(1, 1, KEY_DOWN),
0497     KEY(1, 2, KEY_CAMERA),
0498     KEY(1, 3, KEY_RESERVED),
0499     KEY(1, 4, KEY_RESERVED),
0500     KEY(1, 5, KEY_RESERVED),
0501 
0502     KEY(2, 0, KEY_RESERVED),
0503     KEY(2, 1, KEY_KPENTER),
0504     KEY(2, 2, KEY_RECORD),
0505     KEY(2, 3, KEY_RESERVED),
0506     KEY(2, 4, KEY_RESERVED),
0507     KEY(2, 5, KEY_SELECT),
0508 
0509     KEY(3, 0, KEY_RESERVED),
0510     KEY(3, 1, KEY_UP),
0511     KEY(3, 2, KEY_SEND),
0512     KEY(3, 3, KEY_RESERVED),
0513     KEY(3, 4, KEY_RESERVED),
0514     KEY(3, 5, KEY_RESERVED),
0515 
0516     KEY(4, 0, KEY_RESERVED),
0517     KEY(4, 1, KEY_LEFT),
0518     KEY(4, 2, KEY_PAGEUP),
0519     KEY(4, 3, KEY_RESERVED),
0520     KEY(4, 4, KEY_RESERVED),
0521     KEY(4, 5, KEY_RESERVED),
0522 };
0523 
0524 static struct matrix_keymap_data a1200_matrix_keymap_data = {
0525     .keymap         = a1200_key_map,
0526     .keymap_size        = ARRAY_SIZE(a1200_key_map),
0527 };
0528 
0529 static struct pxa27x_keypad_platform_data a1200_keypad_platform_data = {
0530     .matrix_key_rows = 5,
0531     .matrix_key_cols = 6,
0532     .matrix_keymap_data = &a1200_matrix_keymap_data,
0533 
0534     .debounce_interval = 30,
0535 };
0536 #endif /* CONFIG_MACH_EZX_A1200 */
0537 
0538 #ifdef CONFIG_MACH_EZX_E6
0539 static const unsigned int e6_key_map[] = {
0540     KEY(0, 0, KEY_RESERVED),
0541     KEY(0, 1, KEY_RIGHT),
0542     KEY(0, 2, KEY_PAGEDOWN),
0543     KEY(0, 3, KEY_RESERVED),
0544     KEY(0, 4, KEY_RESERVED),
0545     KEY(0, 5, KEY_NEXTSONG),
0546 
0547     KEY(1, 0, KEY_RESERVED),
0548     KEY(1, 1, KEY_DOWN),
0549     KEY(1, 2, KEY_PROG1),
0550     KEY(1, 3, KEY_RESERVED),
0551     KEY(1, 4, KEY_RESERVED),
0552     KEY(1, 5, KEY_RESERVED),
0553 
0554     KEY(2, 0, KEY_RESERVED),
0555     KEY(2, 1, KEY_ENTER),
0556     KEY(2, 2, KEY_CAMERA),
0557     KEY(2, 3, KEY_RESERVED),
0558     KEY(2, 4, KEY_RESERVED),
0559     KEY(2, 5, KEY_WWW),
0560 
0561     KEY(3, 0, KEY_RESERVED),
0562     KEY(3, 1, KEY_UP),
0563     KEY(3, 2, KEY_SEND),
0564     KEY(3, 3, KEY_RESERVED),
0565     KEY(3, 4, KEY_RESERVED),
0566     KEY(3, 5, KEY_PLAYPAUSE),
0567 
0568     KEY(4, 0, KEY_RESERVED),
0569     KEY(4, 1, KEY_LEFT),
0570     KEY(4, 2, KEY_PAGEUP),
0571     KEY(4, 3, KEY_RESERVED),
0572     KEY(4, 4, KEY_RESERVED),
0573     KEY(4, 5, KEY_PREVIOUSSONG),
0574 };
0575 
0576 static struct matrix_keymap_data e6_keymap_data = {
0577     .keymap         = e6_key_map,
0578     .keymap_size        = ARRAY_SIZE(e6_key_map),
0579 };
0580 
0581 static struct pxa27x_keypad_platform_data e6_keypad_platform_data = {
0582     .matrix_key_rows = 5,
0583     .matrix_key_cols = 6,
0584     .matrix_keymap_data = &e6_keymap_data,
0585 
0586     .debounce_interval = 30,
0587 };
0588 #endif /* CONFIG_MACH_EZX_E6 */
0589 
0590 #ifdef CONFIG_MACH_EZX_A910
0591 static const unsigned int a910_key_map[] = {
0592     KEY(0, 0, KEY_NUMERIC_6),
0593     KEY(0, 1, KEY_RIGHT),
0594     KEY(0, 2, KEY_PAGEDOWN),
0595     KEY(0, 3, KEY_KPENTER),
0596     KEY(0, 4, KEY_NUMERIC_5),
0597     KEY(0, 5, KEY_CAMERA),
0598 
0599     KEY(1, 0, KEY_NUMERIC_8),
0600     KEY(1, 1, KEY_DOWN),
0601     KEY(1, 2, KEY_RESERVED),
0602     KEY(1, 3, KEY_F1), /* Left SoftKey */
0603     KEY(1, 4, KEY_NUMERIC_STAR),
0604     KEY(1, 5, KEY_RESERVED),
0605 
0606     KEY(2, 0, KEY_NUMERIC_7),
0607     KEY(2, 1, KEY_NUMERIC_9),
0608     KEY(2, 2, KEY_RECORD),
0609     KEY(2, 3, KEY_F2), /* Right SoftKey */
0610     KEY(2, 4, KEY_BACK),
0611     KEY(2, 5, KEY_SELECT),
0612 
0613     KEY(3, 0, KEY_NUMERIC_2),
0614     KEY(3, 1, KEY_UP),
0615     KEY(3, 2, KEY_SEND),
0616     KEY(3, 3, KEY_NUMERIC_0),
0617     KEY(3, 4, KEY_NUMERIC_1),
0618     KEY(3, 5, KEY_RECORD),
0619 
0620     KEY(4, 0, KEY_NUMERIC_4),
0621     KEY(4, 1, KEY_LEFT),
0622     KEY(4, 2, KEY_PAGEUP),
0623     KEY(4, 3, KEY_NUMERIC_POUND),
0624     KEY(4, 4, KEY_NUMERIC_3),
0625     KEY(4, 5, KEY_RESERVED),
0626 };
0627 
0628 static struct matrix_keymap_data a910_matrix_keymap_data = {
0629     .keymap         = a910_key_map,
0630     .keymap_size        = ARRAY_SIZE(a910_key_map),
0631 };
0632 
0633 static struct pxa27x_keypad_platform_data a910_keypad_platform_data = {
0634     .matrix_key_rows = 5,
0635     .matrix_key_cols = 6,
0636     .matrix_keymap_data = &a910_matrix_keymap_data,
0637 
0638     .debounce_interval = 30,
0639 };
0640 #endif /* CONFIG_MACH_EZX_A910 */
0641 
0642 #ifdef CONFIG_MACH_EZX_E2
0643 static const unsigned int e2_key_map[] = {
0644     KEY(0, 0, KEY_NUMERIC_6),
0645     KEY(0, 1, KEY_RIGHT),
0646     KEY(0, 2, KEY_NUMERIC_9),
0647     KEY(0, 3, KEY_NEXTSONG),
0648     KEY(0, 4, KEY_NUMERIC_5),
0649     KEY(0, 5, KEY_F1), /* Left SoftKey */
0650 
0651     KEY(1, 0, KEY_NUMERIC_8),
0652     KEY(1, 1, KEY_DOWN),
0653     KEY(1, 2, KEY_RESERVED),
0654     KEY(1, 3, KEY_PAGEUP),
0655     KEY(1, 4, KEY_NUMERIC_STAR),
0656     KEY(1, 5, KEY_F2), /* Right SoftKey */
0657 
0658     KEY(2, 0, KEY_NUMERIC_7),
0659     KEY(2, 1, KEY_KPENTER),
0660     KEY(2, 2, KEY_RECORD),
0661     KEY(2, 3, KEY_PAGEDOWN),
0662     KEY(2, 4, KEY_BACK),
0663     KEY(2, 5, KEY_NUMERIC_0),
0664 
0665     KEY(3, 0, KEY_NUMERIC_2),
0666     KEY(3, 1, KEY_UP),
0667     KEY(3, 2, KEY_SEND),
0668     KEY(3, 3, KEY_PLAYPAUSE),
0669     KEY(3, 4, KEY_NUMERIC_1),
0670     KEY(3, 5, KEY_SOUND), /* Music SoftKey */
0671 
0672     KEY(4, 0, KEY_NUMERIC_4),
0673     KEY(4, 1, KEY_LEFT),
0674     KEY(4, 2, KEY_NUMERIC_POUND),
0675     KEY(4, 3, KEY_PREVIOUSSONG),
0676     KEY(4, 4, KEY_NUMERIC_3),
0677     KEY(4, 5, KEY_RESERVED),
0678 };
0679 
0680 static struct matrix_keymap_data e2_matrix_keymap_data = {
0681     .keymap         = e2_key_map,
0682     .keymap_size        = ARRAY_SIZE(e2_key_map),
0683 };
0684 
0685 static struct pxa27x_keypad_platform_data e2_keypad_platform_data = {
0686     .matrix_key_rows = 5,
0687     .matrix_key_cols = 6,
0688     .matrix_keymap_data = &e2_matrix_keymap_data,
0689 
0690     .debounce_interval = 30,
0691 };
0692 #endif /* CONFIG_MACH_EZX_E2 */
0693 
0694 #if defined(CONFIG_MACH_EZX_A780) || defined(CONFIG_MACH_EZX_A910)
0695 /* camera */
0696 static struct regulator_consumer_supply camera_regulator_supplies[] = {
0697     REGULATOR_SUPPLY("vdd", "0-005d"),
0698 };
0699 
0700 static struct regulator_init_data camera_regulator_initdata = {
0701     .consumer_supplies = camera_regulator_supplies,
0702     .num_consumer_supplies = ARRAY_SIZE(camera_regulator_supplies),
0703     .constraints = {
0704         .valid_ops_mask = REGULATOR_CHANGE_STATUS,
0705     },
0706 };
0707 
0708 static struct fixed_voltage_config camera_regulator_config = {
0709     .supply_name        = "camera_vdd",
0710     .microvolts     = 2800000,
0711     .init_data      = &camera_regulator_initdata,
0712 };
0713 
0714 static struct platform_device camera_supply_regulator_device = {
0715     .name   = "reg-fixed-voltage",
0716     .id = 1,
0717     .dev    = {
0718         .platform_data = &camera_regulator_config,
0719     },
0720 };
0721 
0722 static struct gpiod_lookup_table camera_supply_gpiod_table = {
0723     .dev_id = "reg-fixed-voltage.1",
0724     .table = {
0725         GPIO_LOOKUP("gpio-pxa", GPIO50_nCAM_EN,
0726                 NULL, GPIO_ACTIVE_LOW),
0727         { },
0728     },
0729 };
0730 #endif
0731 
0732 #ifdef CONFIG_MACH_EZX_A780
0733 /* gpio_keys */
0734 static struct gpio_keys_button a780_buttons[] = {
0735     [0] = {
0736         .code       = SW_LID,
0737         .gpio       = GPIO12_A780_FLIP_LID,
0738         .active_low = 0,
0739         .desc       = "A780 flip lid",
0740         .type       = EV_SW,
0741         .wakeup     = 1,
0742     },
0743 };
0744 
0745 static struct gpio_keys_platform_data a780_gpio_keys_platform_data = {
0746     .buttons  = a780_buttons,
0747     .nbuttons = ARRAY_SIZE(a780_buttons),
0748 };
0749 
0750 static struct platform_device a780_gpio_keys = {
0751     .name = "gpio-keys",
0752     .id   = -1,
0753     .dev  = {
0754         .platform_data = &a780_gpio_keys_platform_data,
0755     },
0756 };
0757 
0758 /* camera */
0759 static int a780_camera_reset(struct device *dev)
0760 {
0761     gpio_set_value(GPIO19_GEN1_CAM_RST, 0);
0762     msleep(10);
0763     gpio_set_value(GPIO19_GEN1_CAM_RST, 1);
0764 
0765     return 0;
0766 }
0767 
0768 static int a780_camera_init(void)
0769 {
0770     int err;
0771 
0772     /*
0773      * GPIO50_nCAM_EN is active low
0774      * GPIO19_GEN1_CAM_RST is active on rising edge
0775      */
0776     err = gpio_request(GPIO19_GEN1_CAM_RST, "CAM_RST");
0777     if (err) {
0778         pr_err("%s: Failed to request CAM_RST\n", __func__);
0779         return err;
0780     }
0781 
0782     gpio_direction_output(GPIO19_GEN1_CAM_RST, 0);
0783     a780_camera_reset(NULL);
0784 
0785     return 0;
0786 }
0787 
0788 struct pxacamera_platform_data a780_pxacamera_platform_data = {
0789     .flags  = PXA_CAMERA_MASTER | PXA_CAMERA_DATAWIDTH_8 |
0790         PXA_CAMERA_PCLK_EN | PXA_CAMERA_MCLK_EN |
0791         PXA_CAMERA_PCP,
0792     .mclk_10khz = 5000,
0793     .sensor_i2c_adapter_id = 0,
0794     .sensor_i2c_address = 0x5d,
0795 };
0796 
0797 static struct i2c_board_info a780_i2c_board_info[] = {
0798     {
0799         I2C_BOARD_INFO("mt9m111", 0x5d),
0800     },
0801 };
0802 
0803 static struct platform_device *a780_devices[] __initdata = {
0804     &a780_gpio_keys,
0805     &camera_supply_regulator_device,
0806 };
0807 
0808 static void __init a780_init(void)
0809 {
0810     pxa2xx_mfp_config(ARRAY_AND_SIZE(ezx_pin_config));
0811     pxa2xx_mfp_config(ARRAY_AND_SIZE(gen1_pin_config));
0812     pxa2xx_mfp_config(ARRAY_AND_SIZE(a780_pin_config));
0813 
0814     pxa_set_ffuart_info(NULL);
0815     pxa_set_btuart_info(NULL);
0816     pxa_set_stuart_info(NULL);
0817 
0818     pxa_set_i2c_info(NULL);
0819     i2c_register_board_info(0, ARRAY_AND_SIZE(a780_i2c_board_info));
0820 
0821     pxa_set_fb_info(NULL, &ezx_fb_info_1);
0822 
0823     pxa_set_keypad_info(&a780_keypad_platform_data);
0824 
0825     if (a780_camera_init() == 0)
0826         pxa_set_camera_info(&a780_pxacamera_platform_data);
0827 
0828     gpiod_add_lookup_table(&camera_supply_gpiod_table);
0829     pwm_add_table(ezx_pwm_lookup, ARRAY_SIZE(ezx_pwm_lookup));
0830     platform_add_devices(ARRAY_AND_SIZE(ezx_devices));
0831     platform_add_devices(ARRAY_AND_SIZE(a780_devices));
0832     regulator_has_full_constraints();
0833 }
0834 
0835 MACHINE_START(EZX_A780, "Motorola EZX A780")
0836     .atag_offset    = 0x100,
0837     .map_io         = pxa27x_map_io,
0838     .nr_irqs    = EZX_NR_IRQS,
0839     .init_irq       = pxa27x_init_irq,
0840     .handle_irq       = pxa27x_handle_irq,
0841     .init_time  = pxa_timer_init,
0842     .init_machine   = a780_init,
0843     .restart    = pxa_restart,
0844 MACHINE_END
0845 #endif
0846 
0847 #ifdef CONFIG_MACH_EZX_E680
0848 /* gpio_keys */
0849 static struct gpio_keys_button e680_buttons[] = {
0850     [0] = {
0851         .code       = KEY_SCREENLOCK,
0852         .gpio       = GPIO12_E680_LOCK_SWITCH,
0853         .active_low = 0,
0854         .desc       = "E680 lock switch",
0855         .type       = EV_KEY,
0856         .wakeup     = 1,
0857     },
0858 };
0859 
0860 static struct gpio_keys_platform_data e680_gpio_keys_platform_data = {
0861     .buttons  = e680_buttons,
0862     .nbuttons = ARRAY_SIZE(e680_buttons),
0863 };
0864 
0865 static struct platform_device e680_gpio_keys = {
0866     .name = "gpio-keys",
0867     .id   = -1,
0868     .dev  = {
0869         .platform_data = &e680_gpio_keys_platform_data,
0870     },
0871 };
0872 
0873 static struct i2c_board_info __initdata e680_i2c_board_info[] = {
0874     { I2C_BOARD_INFO("tea5767", 0x81) },
0875 };
0876 
0877 static struct platform_device *e680_devices[] __initdata = {
0878     &e680_gpio_keys,
0879 };
0880 
0881 static void __init e680_init(void)
0882 {
0883     pxa2xx_mfp_config(ARRAY_AND_SIZE(ezx_pin_config));
0884     pxa2xx_mfp_config(ARRAY_AND_SIZE(gen1_pin_config));
0885     pxa2xx_mfp_config(ARRAY_AND_SIZE(e680_pin_config));
0886 
0887     pxa_set_ffuart_info(NULL);
0888     pxa_set_btuart_info(NULL);
0889     pxa_set_stuart_info(NULL);
0890 
0891     pxa_set_i2c_info(NULL);
0892     i2c_register_board_info(0, ARRAY_AND_SIZE(e680_i2c_board_info));
0893 
0894     pxa_set_fb_info(NULL, &ezx_fb_info_1);
0895 
0896     pxa_set_keypad_info(&e680_keypad_platform_data);
0897 
0898     pwm_add_table(ezx_pwm_lookup, ARRAY_SIZE(ezx_pwm_lookup));
0899     platform_add_devices(ARRAY_AND_SIZE(ezx_devices));
0900     platform_add_devices(ARRAY_AND_SIZE(e680_devices));
0901 }
0902 
0903 MACHINE_START(EZX_E680, "Motorola EZX E680")
0904     .atag_offset    = 0x100,
0905     .map_io         = pxa27x_map_io,
0906     .nr_irqs    = EZX_NR_IRQS,
0907     .init_irq       = pxa27x_init_irq,
0908     .handle_irq       = pxa27x_handle_irq,
0909     .init_time  = pxa_timer_init,
0910     .init_machine   = e680_init,
0911     .restart    = pxa_restart,
0912 MACHINE_END
0913 #endif
0914 
0915 #ifdef CONFIG_MACH_EZX_A1200
0916 /* gpio_keys */
0917 static struct gpio_keys_button a1200_buttons[] = {
0918     [0] = {
0919         .code       = SW_LID,
0920         .gpio       = GPIO15_A1200_FLIP_LID,
0921         .active_low = 0,
0922         .desc       = "A1200 flip lid",
0923         .type       = EV_SW,
0924         .wakeup     = 1,
0925     },
0926 };
0927 
0928 static struct gpio_keys_platform_data a1200_gpio_keys_platform_data = {
0929     .buttons  = a1200_buttons,
0930     .nbuttons = ARRAY_SIZE(a1200_buttons),
0931 };
0932 
0933 static struct platform_device a1200_gpio_keys = {
0934     .name = "gpio-keys",
0935     .id   = -1,
0936     .dev  = {
0937         .platform_data = &a1200_gpio_keys_platform_data,
0938     },
0939 };
0940 
0941 static struct i2c_board_info __initdata a1200_i2c_board_info[] = {
0942     { I2C_BOARD_INFO("tea5767", 0x81) },
0943 };
0944 
0945 static struct platform_device *a1200_devices[] __initdata = {
0946     &a1200_gpio_keys,
0947 };
0948 
0949 static void __init a1200_init(void)
0950 {
0951     pxa2xx_mfp_config(ARRAY_AND_SIZE(ezx_pin_config));
0952     pxa2xx_mfp_config(ARRAY_AND_SIZE(gen2_pin_config));
0953     pxa2xx_mfp_config(ARRAY_AND_SIZE(a1200_pin_config));
0954 
0955     pxa_set_ffuart_info(NULL);
0956     pxa_set_btuart_info(NULL);
0957     pxa_set_stuart_info(NULL);
0958 
0959     pxa_set_i2c_info(NULL);
0960     i2c_register_board_info(0, ARRAY_AND_SIZE(a1200_i2c_board_info));
0961 
0962     pxa_set_fb_info(NULL, &ezx_fb_info_2);
0963 
0964     pxa_set_keypad_info(&a1200_keypad_platform_data);
0965 
0966     pwm_add_table(ezx_pwm_lookup, ARRAY_SIZE(ezx_pwm_lookup));
0967     platform_add_devices(ARRAY_AND_SIZE(ezx_devices));
0968     platform_add_devices(ARRAY_AND_SIZE(a1200_devices));
0969 }
0970 
0971 MACHINE_START(EZX_A1200, "Motorola EZX A1200")
0972     .atag_offset    = 0x100,
0973     .map_io         = pxa27x_map_io,
0974     .nr_irqs    = EZX_NR_IRQS,
0975     .init_irq       = pxa27x_init_irq,
0976     .handle_irq       = pxa27x_handle_irq,
0977     .init_time  = pxa_timer_init,
0978     .init_machine   = a1200_init,
0979     .restart    = pxa_restart,
0980 MACHINE_END
0981 #endif
0982 
0983 #ifdef CONFIG_MACH_EZX_A910
0984 /* gpio_keys */
0985 static struct gpio_keys_button a910_buttons[] = {
0986     [0] = {
0987         .code       = SW_LID,
0988         .gpio       = GPIO15_A910_FLIP_LID,
0989         .active_low = 0,
0990         .desc       = "A910 flip lid",
0991         .type       = EV_SW,
0992         .wakeup     = 1,
0993     },
0994 };
0995 
0996 static struct gpio_keys_platform_data a910_gpio_keys_platform_data = {
0997     .buttons  = a910_buttons,
0998     .nbuttons = ARRAY_SIZE(a910_buttons),
0999 };
1000 
1001 static struct platform_device a910_gpio_keys = {
1002     .name = "gpio-keys",
1003     .id   = -1,
1004     .dev  = {
1005         .platform_data = &a910_gpio_keys_platform_data,
1006     },
1007 };
1008 
1009 /* camera */
1010 static int a910_camera_reset(struct device *dev)
1011 {
1012     gpio_set_value(GPIO28_GEN2_CAM_RST, 0);
1013     msleep(10);
1014     gpio_set_value(GPIO28_GEN2_CAM_RST, 1);
1015 
1016     return 0;
1017 }
1018 
1019 static int a910_camera_init(void)
1020 {
1021     int err;
1022 
1023     /*
1024      * GPIO50_nCAM_EN is active low
1025      * GPIO28_GEN2_CAM_RST is active on rising edge
1026      */
1027     err = gpio_request(GPIO28_GEN2_CAM_RST, "CAM_RST");
1028     if (err) {
1029         pr_err("%s: Failed to request CAM_RST\n", __func__);
1030         return err;
1031     }
1032 
1033     gpio_direction_output(GPIO28_GEN2_CAM_RST, 0);
1034     a910_camera_reset(NULL);
1035 
1036     return 0;
1037 }
1038 
1039 struct pxacamera_platform_data a910_pxacamera_platform_data = {
1040     .flags  = PXA_CAMERA_MASTER | PXA_CAMERA_DATAWIDTH_8 |
1041         PXA_CAMERA_PCLK_EN | PXA_CAMERA_MCLK_EN |
1042         PXA_CAMERA_PCP,
1043     .mclk_10khz = 5000,
1044     .sensor_i2c_adapter_id = 0,
1045     .sensor_i2c_address = 0x5d,
1046 };
1047 
1048 /* leds-lp3944 */
1049 static struct lp3944_platform_data a910_lp3944_leds = {
1050     .leds_size = LP3944_LEDS_MAX,
1051     .leds = {
1052         [0] = {
1053             .name = "a910:red:",
1054             .status = LP3944_LED_STATUS_OFF,
1055             .type = LP3944_LED_TYPE_LED,
1056         },
1057         [1] = {
1058             .name = "a910:green:",
1059             .status = LP3944_LED_STATUS_OFF,
1060             .type = LP3944_LED_TYPE_LED,
1061         },
1062         [2] {
1063             .name = "a910:blue:",
1064             .status = LP3944_LED_STATUS_OFF,
1065             .type = LP3944_LED_TYPE_LED,
1066         },
1067         /* Leds 3 and 4 are used as display power switches */
1068         [3] = {
1069             .name = "a910::cli_display",
1070             .status = LP3944_LED_STATUS_OFF,
1071             .type = LP3944_LED_TYPE_LED_INVERTED
1072         },
1073         [4] = {
1074             .name = "a910::main_display",
1075             .status = LP3944_LED_STATUS_ON,
1076             .type = LP3944_LED_TYPE_LED_INVERTED
1077         },
1078         [5] = { .type = LP3944_LED_TYPE_NONE },
1079         [6] = {
1080             .name = "a910::torch",
1081             .status = LP3944_LED_STATUS_OFF,
1082             .type = LP3944_LED_TYPE_LED,
1083         },
1084         [7] = {
1085             .name = "a910::flash",
1086             .status = LP3944_LED_STATUS_OFF,
1087             .type = LP3944_LED_TYPE_LED_INVERTED,
1088         },
1089     },
1090 };
1091 
1092 static struct i2c_board_info __initdata a910_i2c_board_info[] = {
1093     {
1094         I2C_BOARD_INFO("lp3944", 0x60),
1095         .platform_data = &a910_lp3944_leds,
1096     },
1097     {
1098         I2C_BOARD_INFO("mt9m111", 0x5d),
1099     },
1100 };
1101 
1102 static struct platform_device *a910_devices[] __initdata = {
1103     &a910_gpio_keys,
1104     &camera_supply_regulator_device,
1105 };
1106 
1107 static void __init a910_init(void)
1108 {
1109     pxa2xx_mfp_config(ARRAY_AND_SIZE(ezx_pin_config));
1110     pxa2xx_mfp_config(ARRAY_AND_SIZE(gen2_pin_config));
1111     pxa2xx_mfp_config(ARRAY_AND_SIZE(a910_pin_config));
1112 
1113     pxa_set_ffuart_info(NULL);
1114     pxa_set_btuart_info(NULL);
1115     pxa_set_stuart_info(NULL);
1116 
1117     pxa_set_i2c_info(NULL);
1118     i2c_register_board_info(0, ARRAY_AND_SIZE(a910_i2c_board_info));
1119 
1120     pxa_set_fb_info(NULL, &ezx_fb_info_2);
1121 
1122     pxa_set_keypad_info(&a910_keypad_platform_data);
1123 
1124     if (a910_camera_init() == 0)
1125         pxa_set_camera_info(&a910_pxacamera_platform_data);
1126 
1127     gpiod_add_lookup_table(&camera_supply_gpiod_table);
1128     pwm_add_table(ezx_pwm_lookup, ARRAY_SIZE(ezx_pwm_lookup));
1129     platform_add_devices(ARRAY_AND_SIZE(ezx_devices));
1130     platform_add_devices(ARRAY_AND_SIZE(a910_devices));
1131     regulator_has_full_constraints();
1132 }
1133 
1134 MACHINE_START(EZX_A910, "Motorola EZX A910")
1135     .atag_offset    = 0x100,
1136     .map_io         = pxa27x_map_io,
1137     .nr_irqs    = EZX_NR_IRQS,
1138     .init_irq       = pxa27x_init_irq,
1139     .handle_irq       = pxa27x_handle_irq,
1140     .init_time  = pxa_timer_init,
1141     .init_machine   = a910_init,
1142     .restart    = pxa_restart,
1143 MACHINE_END
1144 #endif
1145 
1146 #ifdef CONFIG_MACH_EZX_E6
1147 /* gpio_keys */
1148 static struct gpio_keys_button e6_buttons[] = {
1149     [0] = {
1150         .code       = KEY_SCREENLOCK,
1151         .gpio       = GPIO15_E6_LOCK_SWITCH,
1152         .active_low = 0,
1153         .desc       = "E6 lock switch",
1154         .type       = EV_KEY,
1155         .wakeup     = 1,
1156     },
1157 };
1158 
1159 static struct gpio_keys_platform_data e6_gpio_keys_platform_data = {
1160     .buttons  = e6_buttons,
1161     .nbuttons = ARRAY_SIZE(e6_buttons),
1162 };
1163 
1164 static struct platform_device e6_gpio_keys = {
1165     .name = "gpio-keys",
1166     .id   = -1,
1167     .dev  = {
1168         .platform_data = &e6_gpio_keys_platform_data,
1169     },
1170 };
1171 
1172 static struct i2c_board_info __initdata e6_i2c_board_info[] = {
1173     { I2C_BOARD_INFO("tea5767", 0x81) },
1174 };
1175 
1176 static struct platform_device *e6_devices[] __initdata = {
1177     &e6_gpio_keys,
1178 };
1179 
1180 static void __init e6_init(void)
1181 {
1182     pxa2xx_mfp_config(ARRAY_AND_SIZE(ezx_pin_config));
1183     pxa2xx_mfp_config(ARRAY_AND_SIZE(gen2_pin_config));
1184     pxa2xx_mfp_config(ARRAY_AND_SIZE(e6_pin_config));
1185 
1186     pxa_set_ffuart_info(NULL);
1187     pxa_set_btuart_info(NULL);
1188     pxa_set_stuart_info(NULL);
1189 
1190     pxa_set_i2c_info(NULL);
1191     i2c_register_board_info(0, ARRAY_AND_SIZE(e6_i2c_board_info));
1192 
1193     pxa_set_fb_info(NULL, &ezx_fb_info_2);
1194 
1195     pxa_set_keypad_info(&e6_keypad_platform_data);
1196 
1197     pwm_add_table(ezx_pwm_lookup, ARRAY_SIZE(ezx_pwm_lookup));
1198     platform_add_devices(ARRAY_AND_SIZE(ezx_devices));
1199     platform_add_devices(ARRAY_AND_SIZE(e6_devices));
1200 }
1201 
1202 MACHINE_START(EZX_E6, "Motorola EZX E6")
1203     .atag_offset    = 0x100,
1204     .map_io         = pxa27x_map_io,
1205     .nr_irqs    = EZX_NR_IRQS,
1206     .init_irq       = pxa27x_init_irq,
1207     .handle_irq       = pxa27x_handle_irq,
1208     .init_time  = pxa_timer_init,
1209     .init_machine   = e6_init,
1210     .restart    = pxa_restart,
1211 MACHINE_END
1212 #endif
1213 
1214 #ifdef CONFIG_MACH_EZX_E2
1215 static struct i2c_board_info __initdata e2_i2c_board_info[] = {
1216     { I2C_BOARD_INFO("tea5767", 0x81) },
1217 };
1218 
1219 static struct platform_device *e2_devices[] __initdata = {
1220 };
1221 
1222 static void __init e2_init(void)
1223 {
1224     pxa2xx_mfp_config(ARRAY_AND_SIZE(ezx_pin_config));
1225     pxa2xx_mfp_config(ARRAY_AND_SIZE(gen2_pin_config));
1226     pxa2xx_mfp_config(ARRAY_AND_SIZE(e2_pin_config));
1227 
1228     pxa_set_ffuart_info(NULL);
1229     pxa_set_btuart_info(NULL);
1230     pxa_set_stuart_info(NULL);
1231 
1232     pxa_set_i2c_info(NULL);
1233     i2c_register_board_info(0, ARRAY_AND_SIZE(e2_i2c_board_info));
1234 
1235     pxa_set_fb_info(NULL, &ezx_fb_info_2);
1236 
1237     pxa_set_keypad_info(&e2_keypad_platform_data);
1238 
1239     pwm_add_table(ezx_pwm_lookup, ARRAY_SIZE(ezx_pwm_lookup));
1240     platform_add_devices(ARRAY_AND_SIZE(ezx_devices));
1241     platform_add_devices(ARRAY_AND_SIZE(e2_devices));
1242 }
1243 
1244 MACHINE_START(EZX_E2, "Motorola EZX E2")
1245     .atag_offset    = 0x100,
1246     .map_io         = pxa27x_map_io,
1247     .nr_irqs    = EZX_NR_IRQS,
1248     .init_irq       = pxa27x_init_irq,
1249     .handle_irq       = pxa27x_handle_irq,
1250     .init_time  = pxa_timer_init,
1251     .init_machine   = e2_init,
1252     .restart    = pxa_restart,
1253 MACHINE_END
1254 #endif