Stefan Schmidt | 9ab24e4 | 2008-07-09 08:08:17 +0100 | [diff] [blame] | 1 | /* |
| 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 Schmidt | fe9490c | 2008-12-08 15:58:09 +0100 | [diff] [blame] | 19 | #include <linux/input.h> |
Antonio Ospite | 405ac40 | 2009-11-12 15:47:04 +0100 | [diff] [blame] | 20 | #include <linux/gpio.h> |
Antonio Ospite | 1ce2c51 | 2009-06-01 12:26:58 +0200 | [diff] [blame] | 21 | #include <linux/gpio_keys.h> |
Antonio Ospite | 87303b8 | 2009-11-03 17:45:33 +0100 | [diff] [blame] | 22 | #include <linux/leds-lp3944.h> |
Sebastian Andrzej Siewior | b459396 | 2011-02-23 12:38:16 +0100 | [diff] [blame] | 23 | #include <linux/i2c/pxa-i2c.h> |
Stefan Schmidt | 9ab24e4 | 2008-07-09 08:08:17 +0100 | [diff] [blame] | 24 | |
Antonio Ospite | 405ac40 | 2009-11-12 15:47:04 +0100 | [diff] [blame] | 25 | #include <media/soc_camera.h> |
| 26 | |
Stefan Schmidt | 9ab24e4 | 2008-07-09 08:08:17 +0100 | [diff] [blame] | 27 | #include <asm/setup.h> |
Eric Miao | 51c6298 | 2009-01-02 23:17:22 +0800 | [diff] [blame] | 28 | #include <asm/mach-types.h> |
| 29 | #include <asm/mach/arch.h> |
| 30 | |
| 31 | #include <mach/pxa27x.h> |
Arnd Bergmann | 293b2da | 2012-08-24 15:16:48 +0200 | [diff] [blame] | 32 | #include <linux/platform_data/video-pxafb.h> |
| 33 | #include <linux/platform_data/usb-ohci-pxa27x.h> |
Russell King | 05678a9 | 2008-11-28 16:04:54 +0000 | [diff] [blame] | 34 | #include <mach/hardware.h> |
Arnd Bergmann | 293b2da | 2012-08-24 15:16:48 +0200 | [diff] [blame] | 35 | #include <linux/platform_data/keypad-pxa27x.h> |
| 36 | #include <linux/platform_data/camera-pxa.h> |
Stefan Schmidt | 9ab24e4 | 2008-07-09 08:08:17 +0100 | [diff] [blame] | 37 | |
Stefan Schmidt | 9ab24e4 | 2008-07-09 08:08:17 +0100 | [diff] [blame] | 38 | #include "devices.h" |
| 39 | #include "generic.h" |
| 40 | |
Haojian Zhuang | 6ac6b81 | 2010-08-20 15:23:59 +0800 | [diff] [blame] | 41 | #define EZX_NR_IRQS (IRQ_BOARD_START + 24) |
| 42 | |
Antonio Ospite | 1ce2c51 | 2009-06-01 12:26:58 +0200 | [diff] [blame] | 43 | #define GPIO12_A780_FLIP_LID 12 |
| 44 | #define GPIO15_A1200_FLIP_LID 15 |
| 45 | #define GPIO15_A910_FLIP_LID 15 |
| 46 | #define GPIO12_E680_LOCK_SWITCH 12 |
| 47 | #define GPIO15_E6_LOCK_SWITCH 15 |
Antonio Ospite | 405ac40 | 2009-11-12 15:47:04 +0100 | [diff] [blame] | 48 | #define GPIO50_nCAM_EN 50 |
| 49 | #define GPIO19_GEN1_CAM_RST 19 |
| 50 | #define GPIO28_GEN2_CAM_RST 28 |
Antonio Ospite | 1ce2c51 | 2009-06-01 12:26:58 +0200 | [diff] [blame] | 51 | |
Stefan Schmidt | 9ab24e4 | 2008-07-09 08:08:17 +0100 | [diff] [blame] | 52 | static struct platform_pwm_backlight_data ezx_backlight_data = { |
| 53 | .pwm_id = 0, |
| 54 | .max_brightness = 1023, |
| 55 | .dft_brightness = 1023, |
| 56 | .pwm_period_ns = 78770, |
| 57 | }; |
| 58 | |
| 59 | static struct platform_device ezx_backlight_device = { |
| 60 | .name = "pwm-backlight", |
| 61 | .dev = { |
| 62 | .parent = &pxa27x_device_pwm0.dev, |
| 63 | .platform_data = &ezx_backlight_data, |
| 64 | }, |
| 65 | }; |
| 66 | |
| 67 | static struct pxafb_mode_info mode_ezx_old = { |
| 68 | .pixclock = 150000, |
| 69 | .xres = 240, |
| 70 | .yres = 320, |
| 71 | .bpp = 16, |
| 72 | .hsync_len = 10, |
| 73 | .left_margin = 20, |
| 74 | .right_margin = 10, |
| 75 | .vsync_len = 2, |
| 76 | .upper_margin = 3, |
| 77 | .lower_margin = 2, |
| 78 | .sync = 0, |
| 79 | }; |
| 80 | |
| 81 | static struct pxafb_mach_info ezx_fb_info_1 = { |
| 82 | .modes = &mode_ezx_old, |
| 83 | .num_modes = 1, |
| 84 | .lcd_conn = LCD_COLOR_TFT_16BPP, |
| 85 | }; |
| 86 | |
| 87 | static struct pxafb_mode_info mode_72r89803y01 = { |
| 88 | .pixclock = 192308, |
| 89 | .xres = 240, |
| 90 | .yres = 320, |
| 91 | .bpp = 32, |
| 92 | .depth = 18, |
| 93 | .hsync_len = 10, |
| 94 | .left_margin = 20, |
| 95 | .right_margin = 10, |
| 96 | .vsync_len = 2, |
| 97 | .upper_margin = 3, |
| 98 | .lower_margin = 2, |
| 99 | .sync = 0, |
| 100 | }; |
| 101 | |
| 102 | static struct pxafb_mach_info ezx_fb_info_2 = { |
| 103 | .modes = &mode_72r89803y01, |
| 104 | .num_modes = 1, |
| 105 | .lcd_conn = LCD_COLOR_TFT_18BPP, |
| 106 | }; |
| 107 | |
Antonio Ospite | 1ce2c51 | 2009-06-01 12:26:58 +0200 | [diff] [blame] | 108 | static struct platform_device *ezx_devices[] __initdata = { |
Stefan Schmidt | 9ab24e4 | 2008-07-09 08:08:17 +0100 | [diff] [blame] | 109 | &ezx_backlight_device, |
| 110 | }; |
| 111 | |
| 112 | static unsigned long ezx_pin_config[] __initdata = { |
| 113 | /* PWM backlight */ |
| 114 | GPIO16_PWM0_OUT, |
| 115 | |
| 116 | /* BTUART */ |
| 117 | GPIO42_BTUART_RXD, |
| 118 | GPIO43_BTUART_TXD, |
| 119 | GPIO44_BTUART_CTS, |
| 120 | GPIO45_BTUART_RTS, |
| 121 | |
Eric Miao | 6f584cf | 2008-11-28 16:00:24 +0800 | [diff] [blame] | 122 | /* I2C */ |
| 123 | GPIO117_I2C_SCL, |
| 124 | GPIO118_I2C_SDA, |
Stefan Schmidt | 9078ac2 | 2008-12-08 15:58:08 +0100 | [diff] [blame] | 125 | |
| 126 | /* PCAP SSP */ |
| 127 | GPIO29_SSP1_SCLK, |
| 128 | GPIO25_SSP1_TXD, |
| 129 | GPIO26_SSP1_RXD, |
| 130 | GPIO24_GPIO, /* pcap chip select */ |
Daniel Ribeiro | ff71338 | 2009-05-15 06:33:50 -0300 | [diff] [blame] | 131 | GPIO1_GPIO | WAKEUP_ON_EDGE_RISE, /* pcap interrupt */ |
| 132 | GPIO4_GPIO | MFP_LPM_DRIVE_HIGH, /* WDI_AP */ |
| 133 | GPIO55_GPIO | MFP_LPM_DRIVE_HIGH, /* SYS_RESTART */ |
Stefan Schmidt | 9078ac2 | 2008-12-08 15:58:08 +0100 | [diff] [blame] | 134 | |
| 135 | /* MMC */ |
| 136 | GPIO32_MMC_CLK, |
| 137 | GPIO92_MMC_DAT_0, |
| 138 | GPIO109_MMC_DAT_1, |
| 139 | GPIO110_MMC_DAT_2, |
| 140 | GPIO111_MMC_DAT_3, |
| 141 | GPIO112_MMC_CMD, |
| 142 | GPIO11_GPIO, /* mmc detect */ |
| 143 | |
| 144 | /* usb to external transceiver */ |
| 145 | GPIO34_USB_P2_2, |
| 146 | GPIO35_USB_P2_1, |
| 147 | GPIO36_USB_P2_4, |
| 148 | GPIO39_USB_P2_6, |
| 149 | GPIO40_USB_P2_5, |
| 150 | GPIO53_USB_P2_3, |
| 151 | |
| 152 | /* usb to Neptune GSM chip */ |
| 153 | GPIO30_USB_P3_2, |
| 154 | GPIO31_USB_P3_6, |
| 155 | GPIO90_USB_P3_5, |
| 156 | GPIO91_USB_P3_1, |
| 157 | GPIO56_USB_P3_4, |
| 158 | GPIO113_USB_P3_3, |
Stefan Schmidt | 9ab24e4 | 2008-07-09 08:08:17 +0100 | [diff] [blame] | 159 | }; |
| 160 | |
Stefan Schmidt | 9078ac2 | 2008-12-08 15:58:08 +0100 | [diff] [blame] | 161 | #if defined(CONFIG_MACH_EZX_A780) || defined(CONFIG_MACH_EZX_E680) |
| 162 | static unsigned long gen1_pin_config[] __initdata = { |
| 163 | /* flip / lockswitch */ |
Daniel Ribeiro | ff71338 | 2009-05-15 06:33:50 -0300 | [diff] [blame] | 164 | GPIO12_GPIO | WAKEUP_ON_EDGE_BOTH, |
Stefan Schmidt | 9078ac2 | 2008-12-08 15:58:08 +0100 | [diff] [blame] | 165 | |
| 166 | /* bluetooth (bcm2035) */ |
Daniel Ribeiro | ff71338 | 2009-05-15 06:33:50 -0300 | [diff] [blame] | 167 | GPIO14_GPIO | WAKEUP_ON_EDGE_RISE, /* HOSTWAKE */ |
Stefan Schmidt | 9078ac2 | 2008-12-08 15:58:08 +0100 | [diff] [blame] | 168 | GPIO48_GPIO, /* RESET */ |
| 169 | GPIO28_GPIO, /* WAKEUP */ |
| 170 | |
| 171 | /* Neptune handshake */ |
Daniel Ribeiro | ff71338 | 2009-05-15 06:33:50 -0300 | [diff] [blame] | 172 | GPIO0_GPIO | WAKEUP_ON_EDGE_FALL, /* BP_RDY */ |
| 173 | GPIO57_GPIO | MFP_LPM_DRIVE_HIGH, /* AP_RDY */ |
| 174 | GPIO13_GPIO | WAKEUP_ON_EDGE_BOTH, /* WDI */ |
| 175 | GPIO3_GPIO | WAKEUP_ON_EDGE_BOTH, /* WDI2 */ |
| 176 | GPIO82_GPIO | MFP_LPM_DRIVE_HIGH, /* RESET */ |
| 177 | GPIO99_GPIO | MFP_LPM_DRIVE_HIGH, /* TC_MM_EN */ |
Stefan Schmidt | 9078ac2 | 2008-12-08 15:58:08 +0100 | [diff] [blame] | 178 | |
| 179 | /* sound */ |
| 180 | GPIO52_SSP3_SCLK, |
| 181 | GPIO83_SSP3_SFRM, |
| 182 | GPIO81_SSP3_TXD, |
| 183 | GPIO89_SSP3_RXD, |
| 184 | |
| 185 | /* ssp2 pins to in */ |
| 186 | GPIO22_GPIO, /* SSP2_SCLK */ |
| 187 | GPIO37_GPIO, /* SSP2_SFRM */ |
| 188 | GPIO38_GPIO, /* SSP2_TXD */ |
| 189 | GPIO88_GPIO, /* SSP2_RXD */ |
| 190 | |
| 191 | /* camera */ |
| 192 | GPIO23_CIF_MCLK, |
| 193 | GPIO54_CIF_PCLK, |
| 194 | GPIO85_CIF_LV, |
| 195 | GPIO84_CIF_FV, |
| 196 | GPIO27_CIF_DD_0, |
| 197 | GPIO114_CIF_DD_1, |
| 198 | GPIO51_CIF_DD_2, |
| 199 | GPIO115_CIF_DD_3, |
| 200 | GPIO95_CIF_DD_4, |
| 201 | GPIO94_CIF_DD_5, |
| 202 | GPIO17_CIF_DD_6, |
| 203 | GPIO108_CIF_DD_7, |
Antonio Ospite | 405ac40 | 2009-11-12 15:47:04 +0100 | [diff] [blame] | 204 | GPIO50_GPIO | MFP_LPM_DRIVE_HIGH, /* CAM_EN */ |
| 205 | GPIO19_GPIO | MFP_LPM_DRIVE_HIGH, /* CAM_RST */ |
Stefan Schmidt | 9078ac2 | 2008-12-08 15:58:08 +0100 | [diff] [blame] | 206 | |
| 207 | /* EMU */ |
| 208 | GPIO120_GPIO, /* EMU_MUX1 */ |
| 209 | GPIO119_GPIO, /* EMU_MUX2 */ |
| 210 | GPIO86_GPIO, /* SNP_INT_CTL */ |
| 211 | GPIO87_GPIO, /* SNP_INT_IN */ |
| 212 | }; |
| 213 | #endif |
| 214 | |
| 215 | #if defined(CONFIG_MACH_EZX_A1200) || defined(CONFIG_MACH_EZX_A910) || \ |
| 216 | defined(CONFIG_MACH_EZX_E2) || defined(CONFIG_MACH_EZX_E6) |
| 217 | static unsigned long gen2_pin_config[] __initdata = { |
| 218 | /* flip / lockswitch */ |
Daniel Ribeiro | ff71338 | 2009-05-15 06:33:50 -0300 | [diff] [blame] | 219 | GPIO15_GPIO | WAKEUP_ON_EDGE_BOTH, |
Stefan Schmidt | 9078ac2 | 2008-12-08 15:58:08 +0100 | [diff] [blame] | 220 | |
| 221 | /* EOC */ |
Daniel Ribeiro | ff71338 | 2009-05-15 06:33:50 -0300 | [diff] [blame] | 222 | GPIO10_GPIO | WAKEUP_ON_EDGE_RISE, |
Stefan Schmidt | 9078ac2 | 2008-12-08 15:58:08 +0100 | [diff] [blame] | 223 | |
| 224 | /* bluetooth (bcm2045) */ |
Daniel Ribeiro | ff71338 | 2009-05-15 06:33:50 -0300 | [diff] [blame] | 225 | GPIO13_GPIO | WAKEUP_ON_EDGE_RISE, /* HOSTWAKE */ |
Stefan Schmidt | 9078ac2 | 2008-12-08 15:58:08 +0100 | [diff] [blame] | 226 | GPIO37_GPIO, /* RESET */ |
| 227 | GPIO57_GPIO, /* WAKEUP */ |
| 228 | |
| 229 | /* Neptune handshake */ |
Daniel Ribeiro | ff71338 | 2009-05-15 06:33:50 -0300 | [diff] [blame] | 230 | GPIO0_GPIO | WAKEUP_ON_EDGE_FALL, /* BP_RDY */ |
| 231 | GPIO96_GPIO | MFP_LPM_DRIVE_HIGH, /* AP_RDY */ |
| 232 | GPIO3_GPIO | WAKEUP_ON_EDGE_FALL, /* WDI */ |
| 233 | GPIO116_GPIO | MFP_LPM_DRIVE_HIGH, /* RESET */ |
Stefan Schmidt | 9078ac2 | 2008-12-08 15:58:08 +0100 | [diff] [blame] | 234 | GPIO41_GPIO, /* BP_FLASH */ |
| 235 | |
| 236 | /* sound */ |
| 237 | GPIO52_SSP3_SCLK, |
| 238 | GPIO83_SSP3_SFRM, |
| 239 | GPIO81_SSP3_TXD, |
| 240 | GPIO82_SSP3_RXD, |
| 241 | |
| 242 | /* ssp2 pins to in */ |
| 243 | GPIO22_GPIO, /* SSP2_SCLK */ |
| 244 | GPIO14_GPIO, /* SSP2_SFRM */ |
| 245 | GPIO38_GPIO, /* SSP2_TXD */ |
| 246 | GPIO88_GPIO, /* SSP2_RXD */ |
| 247 | |
| 248 | /* camera */ |
| 249 | GPIO23_CIF_MCLK, |
| 250 | GPIO54_CIF_PCLK, |
| 251 | GPIO85_CIF_LV, |
| 252 | GPIO84_CIF_FV, |
| 253 | GPIO27_CIF_DD_0, |
| 254 | GPIO114_CIF_DD_1, |
| 255 | GPIO51_CIF_DD_2, |
| 256 | GPIO115_CIF_DD_3, |
| 257 | GPIO95_CIF_DD_4, |
| 258 | GPIO48_CIF_DD_5, |
| 259 | GPIO93_CIF_DD_6, |
| 260 | GPIO12_CIF_DD_7, |
Antonio Ospite | 405ac40 | 2009-11-12 15:47:04 +0100 | [diff] [blame] | 261 | GPIO50_GPIO | MFP_LPM_DRIVE_HIGH, /* CAM_EN */ |
| 262 | GPIO28_GPIO | MFP_LPM_DRIVE_HIGH, /* CAM_RST */ |
Stefan Schmidt | 9078ac2 | 2008-12-08 15:58:08 +0100 | [diff] [blame] | 263 | GPIO17_GPIO, /* CAM_FLASH */ |
| 264 | }; |
| 265 | #endif |
| 266 | |
| 267 | #ifdef CONFIG_MACH_EZX_A780 |
| 268 | static unsigned long a780_pin_config[] __initdata = { |
| 269 | /* keypad */ |
| 270 | GPIO93_KP_DKIN_0 | WAKEUP_ON_LEVEL_HIGH, |
| 271 | GPIO100_KP_MKIN_0 | WAKEUP_ON_LEVEL_HIGH, |
| 272 | GPIO101_KP_MKIN_1 | WAKEUP_ON_LEVEL_HIGH, |
| 273 | GPIO102_KP_MKIN_2 | WAKEUP_ON_LEVEL_HIGH, |
| 274 | GPIO97_KP_MKIN_3 | WAKEUP_ON_LEVEL_HIGH, |
| 275 | GPIO98_KP_MKIN_4 | WAKEUP_ON_LEVEL_HIGH, |
| 276 | GPIO103_KP_MKOUT_0, |
| 277 | GPIO104_KP_MKOUT_1, |
| 278 | GPIO105_KP_MKOUT_2, |
| 279 | GPIO106_KP_MKOUT_3, |
| 280 | GPIO107_KP_MKOUT_4, |
| 281 | |
| 282 | /* attenuate sound */ |
| 283 | GPIO96_GPIO, |
| 284 | }; |
| 285 | #endif |
| 286 | |
| 287 | #ifdef CONFIG_MACH_EZX_E680 |
| 288 | static unsigned long e680_pin_config[] __initdata = { |
| 289 | /* keypad */ |
| 290 | GPIO93_KP_DKIN_0 | WAKEUP_ON_LEVEL_HIGH, |
| 291 | GPIO96_KP_DKIN_3 | WAKEUP_ON_LEVEL_HIGH, |
| 292 | GPIO97_KP_DKIN_4 | WAKEUP_ON_LEVEL_HIGH, |
| 293 | GPIO98_KP_DKIN_5 | WAKEUP_ON_LEVEL_HIGH, |
| 294 | GPIO100_KP_MKIN_0 | WAKEUP_ON_LEVEL_HIGH, |
| 295 | GPIO101_KP_MKIN_1 | WAKEUP_ON_LEVEL_HIGH, |
| 296 | GPIO102_KP_MKIN_2 | WAKEUP_ON_LEVEL_HIGH, |
| 297 | GPIO103_KP_MKOUT_0, |
| 298 | GPIO104_KP_MKOUT_1, |
| 299 | GPIO105_KP_MKOUT_2, |
| 300 | GPIO106_KP_MKOUT_3, |
| 301 | |
| 302 | /* MIDI */ |
| 303 | GPIO79_GPIO, /* VA_SEL_BUL */ |
| 304 | GPIO80_GPIO, /* FLT_SEL_BUL */ |
| 305 | GPIO78_GPIO, /* MIDI_RESET */ |
| 306 | GPIO33_GPIO, /* MIDI_CS */ |
| 307 | GPIO15_GPIO, /* MIDI_IRQ */ |
| 308 | GPIO49_GPIO, /* MIDI_NPWE */ |
| 309 | GPIO18_GPIO, /* MIDI_RDY */ |
| 310 | |
| 311 | /* leds */ |
| 312 | GPIO46_GPIO, |
| 313 | GPIO47_GPIO, |
| 314 | }; |
| 315 | #endif |
| 316 | |
| 317 | #ifdef CONFIG_MACH_EZX_A1200 |
| 318 | static unsigned long a1200_pin_config[] __initdata = { |
| 319 | /* keypad */ |
| 320 | GPIO100_KP_MKIN_0 | WAKEUP_ON_LEVEL_HIGH, |
| 321 | GPIO101_KP_MKIN_1 | WAKEUP_ON_LEVEL_HIGH, |
| 322 | GPIO102_KP_MKIN_2 | WAKEUP_ON_LEVEL_HIGH, |
| 323 | GPIO97_KP_MKIN_3 | WAKEUP_ON_LEVEL_HIGH, |
| 324 | GPIO98_KP_MKIN_4 | WAKEUP_ON_LEVEL_HIGH, |
| 325 | GPIO103_KP_MKOUT_0, |
| 326 | GPIO104_KP_MKOUT_1, |
| 327 | GPIO105_KP_MKOUT_2, |
| 328 | GPIO106_KP_MKOUT_3, |
| 329 | GPIO107_KP_MKOUT_4, |
| 330 | GPIO108_KP_MKOUT_5, |
| 331 | }; |
| 332 | #endif |
| 333 | |
| 334 | #ifdef CONFIG_MACH_EZX_A910 |
| 335 | static unsigned long a910_pin_config[] __initdata = { |
| 336 | /* keypad */ |
| 337 | GPIO100_KP_MKIN_0 | WAKEUP_ON_LEVEL_HIGH, |
| 338 | GPIO101_KP_MKIN_1 | WAKEUP_ON_LEVEL_HIGH, |
| 339 | GPIO102_KP_MKIN_2 | WAKEUP_ON_LEVEL_HIGH, |
| 340 | GPIO97_KP_MKIN_3 | WAKEUP_ON_LEVEL_HIGH, |
| 341 | GPIO98_KP_MKIN_4 | WAKEUP_ON_LEVEL_HIGH, |
| 342 | GPIO103_KP_MKOUT_0, |
| 343 | GPIO104_KP_MKOUT_1, |
| 344 | GPIO105_KP_MKOUT_2, |
| 345 | GPIO106_KP_MKOUT_3, |
| 346 | GPIO107_KP_MKOUT_4, |
| 347 | GPIO108_KP_MKOUT_5, |
| 348 | |
| 349 | /* WLAN */ |
| 350 | GPIO89_GPIO, /* RESET */ |
| 351 | GPIO33_GPIO, /* WAKEUP */ |
| 352 | GPIO94_GPIO | WAKEUP_ON_LEVEL_HIGH, /* HOSTWAKE */ |
| 353 | |
| 354 | /* MMC CS */ |
| 355 | GPIO20_GPIO, |
| 356 | }; |
| 357 | #endif |
| 358 | |
| 359 | #ifdef CONFIG_MACH_EZX_E2 |
| 360 | static unsigned long e2_pin_config[] __initdata = { |
| 361 | /* keypad */ |
| 362 | GPIO100_KP_MKIN_0 | WAKEUP_ON_LEVEL_HIGH, |
| 363 | GPIO101_KP_MKIN_1 | WAKEUP_ON_LEVEL_HIGH, |
| 364 | GPIO102_KP_MKIN_2 | WAKEUP_ON_LEVEL_HIGH, |
| 365 | GPIO97_KP_MKIN_3 | WAKEUP_ON_LEVEL_HIGH, |
| 366 | GPIO98_KP_MKIN_4 | WAKEUP_ON_LEVEL_HIGH, |
| 367 | GPIO103_KP_MKOUT_0, |
| 368 | GPIO104_KP_MKOUT_1, |
| 369 | GPIO105_KP_MKOUT_2, |
| 370 | GPIO106_KP_MKOUT_3, |
| 371 | GPIO107_KP_MKOUT_4, |
| 372 | GPIO108_KP_MKOUT_5, |
| 373 | }; |
| 374 | #endif |
| 375 | |
| 376 | #ifdef CONFIG_MACH_EZX_E6 |
| 377 | static unsigned long e6_pin_config[] __initdata = { |
| 378 | /* keypad */ |
| 379 | GPIO100_KP_MKIN_0 | WAKEUP_ON_LEVEL_HIGH, |
| 380 | GPIO101_KP_MKIN_1 | WAKEUP_ON_LEVEL_HIGH, |
| 381 | GPIO102_KP_MKIN_2 | WAKEUP_ON_LEVEL_HIGH, |
| 382 | GPIO97_KP_MKIN_3 | WAKEUP_ON_LEVEL_HIGH, |
| 383 | GPIO98_KP_MKIN_4 | WAKEUP_ON_LEVEL_HIGH, |
| 384 | GPIO103_KP_MKOUT_0, |
| 385 | GPIO104_KP_MKOUT_1, |
| 386 | GPIO105_KP_MKOUT_2, |
| 387 | GPIO106_KP_MKOUT_3, |
| 388 | GPIO107_KP_MKOUT_4, |
| 389 | GPIO108_KP_MKOUT_5, |
| 390 | }; |
| 391 | #endif |
| 392 | |
Stefan Schmidt | fe9490c | 2008-12-08 15:58:09 +0100 | [diff] [blame] | 393 | /* KEYPAD */ |
| 394 | #ifdef CONFIG_MACH_EZX_A780 |
Chao Xie | 0a085a9 | 2013-05-05 20:24:58 -0700 | [diff] [blame^] | 395 | static const unsigned int a780_key_map[] = { |
Stefan Schmidt | fe9490c | 2008-12-08 15:58:09 +0100 | [diff] [blame] | 396 | KEY(0, 0, KEY_SEND), |
| 397 | KEY(0, 1, KEY_BACK), |
| 398 | KEY(0, 2, KEY_END), |
| 399 | KEY(0, 3, KEY_PAGEUP), |
| 400 | KEY(0, 4, KEY_UP), |
| 401 | |
| 402 | KEY(1, 0, KEY_NUMERIC_1), |
| 403 | KEY(1, 1, KEY_NUMERIC_2), |
| 404 | KEY(1, 2, KEY_NUMERIC_3), |
| 405 | KEY(1, 3, KEY_SELECT), |
| 406 | KEY(1, 4, KEY_KPENTER), |
| 407 | |
| 408 | KEY(2, 0, KEY_NUMERIC_4), |
| 409 | KEY(2, 1, KEY_NUMERIC_5), |
| 410 | KEY(2, 2, KEY_NUMERIC_6), |
| 411 | KEY(2, 3, KEY_RECORD), |
| 412 | KEY(2, 4, KEY_LEFT), |
| 413 | |
| 414 | KEY(3, 0, KEY_NUMERIC_7), |
| 415 | KEY(3, 1, KEY_NUMERIC_8), |
| 416 | KEY(3, 2, KEY_NUMERIC_9), |
| 417 | KEY(3, 3, KEY_HOME), |
| 418 | KEY(3, 4, KEY_RIGHT), |
| 419 | |
| 420 | KEY(4, 0, KEY_NUMERIC_STAR), |
| 421 | KEY(4, 1, KEY_NUMERIC_0), |
| 422 | KEY(4, 2, KEY_NUMERIC_POUND), |
| 423 | KEY(4, 3, KEY_PAGEDOWN), |
| 424 | KEY(4, 4, KEY_DOWN), |
| 425 | }; |
| 426 | |
Chao Xie | 0a085a9 | 2013-05-05 20:24:58 -0700 | [diff] [blame^] | 427 | static struct matrix_keymap_data a780_matrix_keymap_data = { |
| 428 | .keymap = a780_key_map, |
| 429 | .keymap_size = ARRAY_SIZE(a780_key_map), |
| 430 | }; |
| 431 | |
Stefan Schmidt | fe9490c | 2008-12-08 15:58:09 +0100 | [diff] [blame] | 432 | static struct pxa27x_keypad_platform_data a780_keypad_platform_data = { |
| 433 | .matrix_key_rows = 5, |
| 434 | .matrix_key_cols = 5, |
Chao Xie | 0a085a9 | 2013-05-05 20:24:58 -0700 | [diff] [blame^] | 435 | .matrix_keymap_data = &a780_matrix_keymap_data, |
Stefan Schmidt | fe9490c | 2008-12-08 15:58:09 +0100 | [diff] [blame] | 436 | |
| 437 | .direct_key_map = { KEY_CAMERA }, |
| 438 | .direct_key_num = 1, |
| 439 | |
| 440 | .debounce_interval = 30, |
| 441 | }; |
| 442 | #endif /* CONFIG_MACH_EZX_A780 */ |
| 443 | |
| 444 | #ifdef CONFIG_MACH_EZX_E680 |
Chao Xie | 0a085a9 | 2013-05-05 20:24:58 -0700 | [diff] [blame^] | 445 | static const unsigned int e680_key_map[] = { |
Stefan Schmidt | fe9490c | 2008-12-08 15:58:09 +0100 | [diff] [blame] | 446 | KEY(0, 0, KEY_UP), |
| 447 | KEY(0, 1, KEY_RIGHT), |
| 448 | KEY(0, 2, KEY_RESERVED), |
| 449 | KEY(0, 3, KEY_SEND), |
| 450 | |
| 451 | KEY(1, 0, KEY_DOWN), |
| 452 | KEY(1, 1, KEY_LEFT), |
| 453 | KEY(1, 2, KEY_PAGEUP), |
| 454 | KEY(1, 3, KEY_PAGEDOWN), |
| 455 | |
| 456 | KEY(2, 0, KEY_RESERVED), |
| 457 | KEY(2, 1, KEY_RESERVED), |
| 458 | KEY(2, 2, KEY_RESERVED), |
| 459 | KEY(2, 3, KEY_KPENTER), |
| 460 | }; |
| 461 | |
Chao Xie | 0a085a9 | 2013-05-05 20:24:58 -0700 | [diff] [blame^] | 462 | static struct matrix_keymap_data e680_matrix_keymap_data = { |
| 463 | .keymap = e680_key_map, |
| 464 | .keymap_size = ARRAY_SIZE(e680_key_map), |
| 465 | }; |
| 466 | |
Stefan Schmidt | fe9490c | 2008-12-08 15:58:09 +0100 | [diff] [blame] | 467 | static struct pxa27x_keypad_platform_data e680_keypad_platform_data = { |
| 468 | .matrix_key_rows = 3, |
| 469 | .matrix_key_cols = 4, |
Chao Xie | 0a085a9 | 2013-05-05 20:24:58 -0700 | [diff] [blame^] | 470 | .matrix_keymap_data = &e680_matrix_keymap_data, |
Stefan Schmidt | fe9490c | 2008-12-08 15:58:09 +0100 | [diff] [blame] | 471 | |
| 472 | .direct_key_map = { |
| 473 | KEY_CAMERA, |
| 474 | KEY_RESERVED, |
| 475 | KEY_RESERVED, |
| 476 | KEY_F1, |
| 477 | KEY_CANCEL, |
| 478 | KEY_F2, |
| 479 | }, |
| 480 | .direct_key_num = 6, |
| 481 | |
| 482 | .debounce_interval = 30, |
| 483 | }; |
| 484 | #endif /* CONFIG_MACH_EZX_E680 */ |
| 485 | |
| 486 | #ifdef CONFIG_MACH_EZX_A1200 |
Chao Xie | 0a085a9 | 2013-05-05 20:24:58 -0700 | [diff] [blame^] | 487 | static const unsigned int a1200_key_map[] = { |
Stefan Schmidt | fe9490c | 2008-12-08 15:58:09 +0100 | [diff] [blame] | 488 | KEY(0, 0, KEY_RESERVED), |
| 489 | KEY(0, 1, KEY_RIGHT), |
| 490 | KEY(0, 2, KEY_PAGEDOWN), |
| 491 | KEY(0, 3, KEY_RESERVED), |
| 492 | KEY(0, 4, KEY_RESERVED), |
| 493 | KEY(0, 5, KEY_RESERVED), |
| 494 | |
| 495 | KEY(1, 0, KEY_RESERVED), |
| 496 | KEY(1, 1, KEY_DOWN), |
| 497 | KEY(1, 2, KEY_CAMERA), |
| 498 | KEY(1, 3, KEY_RESERVED), |
| 499 | KEY(1, 4, KEY_RESERVED), |
| 500 | KEY(1, 5, KEY_RESERVED), |
| 501 | |
| 502 | KEY(2, 0, KEY_RESERVED), |
| 503 | KEY(2, 1, KEY_KPENTER), |
| 504 | KEY(2, 2, KEY_RECORD), |
| 505 | KEY(2, 3, KEY_RESERVED), |
| 506 | KEY(2, 4, KEY_RESERVED), |
| 507 | KEY(2, 5, KEY_SELECT), |
| 508 | |
| 509 | KEY(3, 0, KEY_RESERVED), |
| 510 | KEY(3, 1, KEY_UP), |
| 511 | KEY(3, 2, KEY_SEND), |
| 512 | KEY(3, 3, KEY_RESERVED), |
| 513 | KEY(3, 4, KEY_RESERVED), |
| 514 | KEY(3, 5, KEY_RESERVED), |
| 515 | |
| 516 | KEY(4, 0, KEY_RESERVED), |
| 517 | KEY(4, 1, KEY_LEFT), |
| 518 | KEY(4, 2, KEY_PAGEUP), |
| 519 | KEY(4, 3, KEY_RESERVED), |
| 520 | KEY(4, 4, KEY_RESERVED), |
| 521 | KEY(4, 5, KEY_RESERVED), |
| 522 | }; |
| 523 | |
Chao Xie | 0a085a9 | 2013-05-05 20:24:58 -0700 | [diff] [blame^] | 524 | static struct matrix_keymap_data a1200_matrix_keymap_data = { |
| 525 | .keymap = a1200_key_map, |
| 526 | .keymap_size = ARRAY_SIZE(a1200_key_map), |
| 527 | }; |
| 528 | |
Stefan Schmidt | fe9490c | 2008-12-08 15:58:09 +0100 | [diff] [blame] | 529 | static struct pxa27x_keypad_platform_data a1200_keypad_platform_data = { |
| 530 | .matrix_key_rows = 5, |
| 531 | .matrix_key_cols = 6, |
Chao Xie | 0a085a9 | 2013-05-05 20:24:58 -0700 | [diff] [blame^] | 532 | .matrix_keymap_data = &a1200_matrix_keymap_data, |
Stefan Schmidt | fe9490c | 2008-12-08 15:58:09 +0100 | [diff] [blame] | 533 | |
| 534 | .debounce_interval = 30, |
| 535 | }; |
| 536 | #endif /* CONFIG_MACH_EZX_A1200 */ |
| 537 | |
| 538 | #ifdef CONFIG_MACH_EZX_E6 |
Chao Xie | 0a085a9 | 2013-05-05 20:24:58 -0700 | [diff] [blame^] | 539 | static const unsigned int e6_key_map[] = { |
Stefan Schmidt | fe9490c | 2008-12-08 15:58:09 +0100 | [diff] [blame] | 540 | KEY(0, 0, KEY_RESERVED), |
| 541 | KEY(0, 1, KEY_RIGHT), |
| 542 | KEY(0, 2, KEY_PAGEDOWN), |
| 543 | KEY(0, 3, KEY_RESERVED), |
| 544 | KEY(0, 4, KEY_RESERVED), |
| 545 | KEY(0, 5, KEY_NEXTSONG), |
| 546 | |
| 547 | KEY(1, 0, KEY_RESERVED), |
| 548 | KEY(1, 1, KEY_DOWN), |
| 549 | KEY(1, 2, KEY_PROG1), |
| 550 | KEY(1, 3, KEY_RESERVED), |
| 551 | KEY(1, 4, KEY_RESERVED), |
| 552 | KEY(1, 5, KEY_RESERVED), |
| 553 | |
| 554 | KEY(2, 0, KEY_RESERVED), |
| 555 | KEY(2, 1, KEY_ENTER), |
| 556 | KEY(2, 2, KEY_CAMERA), |
| 557 | KEY(2, 3, KEY_RESERVED), |
| 558 | KEY(2, 4, KEY_RESERVED), |
| 559 | KEY(2, 5, KEY_WWW), |
| 560 | |
| 561 | KEY(3, 0, KEY_RESERVED), |
| 562 | KEY(3, 1, KEY_UP), |
| 563 | KEY(3, 2, KEY_SEND), |
| 564 | KEY(3, 3, KEY_RESERVED), |
| 565 | KEY(3, 4, KEY_RESERVED), |
| 566 | KEY(3, 5, KEY_PLAYPAUSE), |
| 567 | |
| 568 | KEY(4, 0, KEY_RESERVED), |
| 569 | KEY(4, 1, KEY_LEFT), |
| 570 | KEY(4, 2, KEY_PAGEUP), |
| 571 | KEY(4, 3, KEY_RESERVED), |
| 572 | KEY(4, 4, KEY_RESERVED), |
| 573 | KEY(4, 5, KEY_PREVIOUSSONG), |
| 574 | }; |
| 575 | |
Chao Xie | 0a085a9 | 2013-05-05 20:24:58 -0700 | [diff] [blame^] | 576 | static struct matrix_keymap_data e6_keymap_data = { |
| 577 | .keymap = e6_key_map, |
| 578 | .keymap_size = ARRAY_SIZE(e6_key_map), |
| 579 | }; |
| 580 | |
Stefan Schmidt | fe9490c | 2008-12-08 15:58:09 +0100 | [diff] [blame] | 581 | static struct pxa27x_keypad_platform_data e6_keypad_platform_data = { |
| 582 | .matrix_key_rows = 5, |
| 583 | .matrix_key_cols = 6, |
Chao Xie | 0a085a9 | 2013-05-05 20:24:58 -0700 | [diff] [blame^] | 584 | .matrix_keymap_data = &e6_keymap_data, |
Stefan Schmidt | fe9490c | 2008-12-08 15:58:09 +0100 | [diff] [blame] | 585 | |
| 586 | .debounce_interval = 30, |
| 587 | }; |
| 588 | #endif /* CONFIG_MACH_EZX_E6 */ |
| 589 | |
| 590 | #ifdef CONFIG_MACH_EZX_A910 |
Chao Xie | 0a085a9 | 2013-05-05 20:24:58 -0700 | [diff] [blame^] | 591 | static const unsigned int a910_key_map[] = { |
Stefan Schmidt | fe9490c | 2008-12-08 15:58:09 +0100 | [diff] [blame] | 592 | KEY(0, 0, KEY_NUMERIC_6), |
| 593 | KEY(0, 1, KEY_RIGHT), |
| 594 | KEY(0, 2, KEY_PAGEDOWN), |
| 595 | KEY(0, 3, KEY_KPENTER), |
| 596 | KEY(0, 4, KEY_NUMERIC_5), |
| 597 | KEY(0, 5, KEY_CAMERA), |
| 598 | |
| 599 | KEY(1, 0, KEY_NUMERIC_8), |
| 600 | KEY(1, 1, KEY_DOWN), |
| 601 | KEY(1, 2, KEY_RESERVED), |
| 602 | KEY(1, 3, KEY_F1), /* Left SoftKey */ |
| 603 | KEY(1, 4, KEY_NUMERIC_STAR), |
| 604 | KEY(1, 5, KEY_RESERVED), |
| 605 | |
| 606 | KEY(2, 0, KEY_NUMERIC_7), |
| 607 | KEY(2, 1, KEY_NUMERIC_9), |
| 608 | KEY(2, 2, KEY_RECORD), |
| 609 | KEY(2, 3, KEY_F2), /* Right SoftKey */ |
| 610 | KEY(2, 4, KEY_BACK), |
| 611 | KEY(2, 5, KEY_SELECT), |
| 612 | |
| 613 | KEY(3, 0, KEY_NUMERIC_2), |
| 614 | KEY(3, 1, KEY_UP), |
| 615 | KEY(3, 2, KEY_SEND), |
| 616 | KEY(3, 3, KEY_NUMERIC_0), |
| 617 | KEY(3, 4, KEY_NUMERIC_1), |
| 618 | KEY(3, 5, KEY_RECORD), |
| 619 | |
| 620 | KEY(4, 0, KEY_NUMERIC_4), |
| 621 | KEY(4, 1, KEY_LEFT), |
| 622 | KEY(4, 2, KEY_PAGEUP), |
| 623 | KEY(4, 3, KEY_NUMERIC_POUND), |
| 624 | KEY(4, 4, KEY_NUMERIC_3), |
| 625 | KEY(4, 5, KEY_RESERVED), |
| 626 | }; |
| 627 | |
Chao Xie | 0a085a9 | 2013-05-05 20:24:58 -0700 | [diff] [blame^] | 628 | static struct matrix_keymap_data a910_matrix_keymap_data = { |
| 629 | .keymap = a910_key_map, |
| 630 | .keymap_size = ARRAY_SIZE(a910_key_map), |
| 631 | }; |
| 632 | |
Stefan Schmidt | fe9490c | 2008-12-08 15:58:09 +0100 | [diff] [blame] | 633 | static struct pxa27x_keypad_platform_data a910_keypad_platform_data = { |
| 634 | .matrix_key_rows = 5, |
| 635 | .matrix_key_cols = 6, |
Chao Xie | 0a085a9 | 2013-05-05 20:24:58 -0700 | [diff] [blame^] | 636 | .matrix_keymap_data = &a910_matrix_keymap_data, |
Stefan Schmidt | fe9490c | 2008-12-08 15:58:09 +0100 | [diff] [blame] | 637 | |
| 638 | .debounce_interval = 30, |
| 639 | }; |
| 640 | #endif /* CONFIG_MACH_EZX_A910 */ |
| 641 | |
| 642 | #ifdef CONFIG_MACH_EZX_E2 |
Chao Xie | 0a085a9 | 2013-05-05 20:24:58 -0700 | [diff] [blame^] | 643 | static const unsigned int e2_key_map[] = { |
Stefan Schmidt | fe9490c | 2008-12-08 15:58:09 +0100 | [diff] [blame] | 644 | KEY(0, 0, KEY_NUMERIC_6), |
| 645 | KEY(0, 1, KEY_RIGHT), |
| 646 | KEY(0, 2, KEY_NUMERIC_9), |
| 647 | KEY(0, 3, KEY_NEXTSONG), |
| 648 | KEY(0, 4, KEY_NUMERIC_5), |
| 649 | KEY(0, 5, KEY_F1), /* Left SoftKey */ |
| 650 | |
| 651 | KEY(1, 0, KEY_NUMERIC_8), |
| 652 | KEY(1, 1, KEY_DOWN), |
| 653 | KEY(1, 2, KEY_RESERVED), |
| 654 | KEY(1, 3, KEY_PAGEUP), |
| 655 | KEY(1, 4, KEY_NUMERIC_STAR), |
| 656 | KEY(1, 5, KEY_F2), /* Right SoftKey */ |
| 657 | |
| 658 | KEY(2, 0, KEY_NUMERIC_7), |
| 659 | KEY(2, 1, KEY_KPENTER), |
| 660 | KEY(2, 2, KEY_RECORD), |
| 661 | KEY(2, 3, KEY_PAGEDOWN), |
| 662 | KEY(2, 4, KEY_BACK), |
| 663 | KEY(2, 5, KEY_NUMERIC_0), |
| 664 | |
| 665 | KEY(3, 0, KEY_NUMERIC_2), |
| 666 | KEY(3, 1, KEY_UP), |
| 667 | KEY(3, 2, KEY_SEND), |
| 668 | KEY(3, 3, KEY_PLAYPAUSE), |
| 669 | KEY(3, 4, KEY_NUMERIC_1), |
| 670 | KEY(3, 5, KEY_SOUND), /* Music SoftKey */ |
| 671 | |
| 672 | KEY(4, 0, KEY_NUMERIC_4), |
| 673 | KEY(4, 1, KEY_LEFT), |
| 674 | KEY(4, 2, KEY_NUMERIC_POUND), |
| 675 | KEY(4, 3, KEY_PREVIOUSSONG), |
| 676 | KEY(4, 4, KEY_NUMERIC_3), |
| 677 | KEY(4, 5, KEY_RESERVED), |
| 678 | }; |
| 679 | |
Chao Xie | 0a085a9 | 2013-05-05 20:24:58 -0700 | [diff] [blame^] | 680 | static struct matrix_keymap_data e2_matrix_keymap_data = { |
| 681 | .keymap = e2_key_map, |
| 682 | .keymap_size = ARRAY_SIZE(e2_key_map), |
| 683 | }; |
| 684 | |
Stefan Schmidt | fe9490c | 2008-12-08 15:58:09 +0100 | [diff] [blame] | 685 | static struct pxa27x_keypad_platform_data e2_keypad_platform_data = { |
| 686 | .matrix_key_rows = 5, |
| 687 | .matrix_key_cols = 6, |
Chao Xie | 0a085a9 | 2013-05-05 20:24:58 -0700 | [diff] [blame^] | 688 | .matrix_keymap_data = &e2_matrix_keymap_data, |
Stefan Schmidt | fe9490c | 2008-12-08 15:58:09 +0100 | [diff] [blame] | 689 | |
| 690 | .debounce_interval = 30, |
| 691 | }; |
| 692 | #endif /* CONFIG_MACH_EZX_E2 */ |
| 693 | |
Stefan Schmidt | 9078ac2 | 2008-12-08 15:58:08 +0100 | [diff] [blame] | 694 | #ifdef CONFIG_MACH_EZX_A780 |
Antonio Ospite | 1ce2c51 | 2009-06-01 12:26:58 +0200 | [diff] [blame] | 695 | /* gpio_keys */ |
| 696 | static struct gpio_keys_button a780_buttons[] = { |
| 697 | [0] = { |
| 698 | .code = SW_LID, |
| 699 | .gpio = GPIO12_A780_FLIP_LID, |
| 700 | .active_low = 0, |
| 701 | .desc = "A780 flip lid", |
| 702 | .type = EV_SW, |
| 703 | .wakeup = 1, |
| 704 | }, |
| 705 | }; |
| 706 | |
| 707 | static struct gpio_keys_platform_data a780_gpio_keys_platform_data = { |
| 708 | .buttons = a780_buttons, |
| 709 | .nbuttons = ARRAY_SIZE(a780_buttons), |
| 710 | }; |
| 711 | |
| 712 | static struct platform_device a780_gpio_keys = { |
| 713 | .name = "gpio-keys", |
| 714 | .id = -1, |
| 715 | .dev = { |
| 716 | .platform_data = &a780_gpio_keys_platform_data, |
| 717 | }, |
| 718 | }; |
| 719 | |
Antonio Ospite | 405ac40 | 2009-11-12 15:47:04 +0100 | [diff] [blame] | 720 | /* camera */ |
| 721 | static int a780_camera_init(void) |
| 722 | { |
| 723 | int err; |
| 724 | |
| 725 | /* |
| 726 | * GPIO50_nCAM_EN is active low |
| 727 | * GPIO19_GEN1_CAM_RST is active on rising edge |
| 728 | */ |
| 729 | err = gpio_request(GPIO50_nCAM_EN, "nCAM_EN"); |
| 730 | if (err) { |
| 731 | pr_err("%s: Failed to request nCAM_EN\n", __func__); |
| 732 | goto fail; |
| 733 | } |
| 734 | |
| 735 | err = gpio_request(GPIO19_GEN1_CAM_RST, "CAM_RST"); |
| 736 | if (err) { |
| 737 | pr_err("%s: Failed to request CAM_RST\n", __func__); |
| 738 | goto fail_gpio_cam_rst; |
| 739 | } |
| 740 | |
| 741 | gpio_direction_output(GPIO50_nCAM_EN, 1); |
| 742 | gpio_direction_output(GPIO19_GEN1_CAM_RST, 0); |
| 743 | |
| 744 | return 0; |
| 745 | |
| 746 | fail_gpio_cam_rst: |
| 747 | gpio_free(GPIO50_nCAM_EN); |
| 748 | fail: |
| 749 | return err; |
| 750 | } |
| 751 | |
| 752 | static int a780_camera_power(struct device *dev, int on) |
| 753 | { |
| 754 | gpio_set_value(GPIO50_nCAM_EN, !on); |
| 755 | return 0; |
| 756 | } |
| 757 | |
| 758 | static int a780_camera_reset(struct device *dev) |
| 759 | { |
| 760 | gpio_set_value(GPIO19_GEN1_CAM_RST, 0); |
| 761 | msleep(10); |
| 762 | gpio_set_value(GPIO19_GEN1_CAM_RST, 1); |
| 763 | |
| 764 | return 0; |
| 765 | } |
| 766 | |
| 767 | struct pxacamera_platform_data a780_pxacamera_platform_data = { |
| 768 | .flags = PXA_CAMERA_MASTER | PXA_CAMERA_DATAWIDTH_8 | |
| 769 | PXA_CAMERA_PCLK_EN | PXA_CAMERA_MCLK_EN, |
| 770 | .mclk_10khz = 5000, |
| 771 | }; |
| 772 | |
| 773 | static struct i2c_board_info a780_camera_i2c_board_info = { |
| 774 | I2C_BOARD_INFO("mt9m111", 0x5d), |
| 775 | }; |
| 776 | |
| 777 | static struct soc_camera_link a780_iclink = { |
| 778 | .bus_id = 0, |
| 779 | .flags = SOCAM_SENSOR_INVERT_PCLK, |
| 780 | .i2c_adapter_id = 0, |
| 781 | .board_info = &a780_camera_i2c_board_info, |
Antonio Ospite | 405ac40 | 2009-11-12 15:47:04 +0100 | [diff] [blame] | 782 | .power = a780_camera_power, |
| 783 | .reset = a780_camera_reset, |
| 784 | }; |
| 785 | |
| 786 | static struct platform_device a780_camera = { |
| 787 | .name = "soc-camera-pdrv", |
| 788 | .id = 0, |
| 789 | .dev = { |
| 790 | .platform_data = &a780_iclink, |
| 791 | }, |
| 792 | }; |
| 793 | |
Antonio Ospite | 1ce2c51 | 2009-06-01 12:26:58 +0200 | [diff] [blame] | 794 | static struct platform_device *a780_devices[] __initdata = { |
| 795 | &a780_gpio_keys, |
| 796 | }; |
| 797 | |
Stefan Schmidt | 9078ac2 | 2008-12-08 15:58:08 +0100 | [diff] [blame] | 798 | static void __init a780_init(void) |
Stefan Schmidt | 9ab24e4 | 2008-07-09 08:08:17 +0100 | [diff] [blame] | 799 | { |
| 800 | pxa2xx_mfp_config(ARRAY_AND_SIZE(ezx_pin_config)); |
Stefan Schmidt | 9078ac2 | 2008-12-08 15:58:08 +0100 | [diff] [blame] | 801 | pxa2xx_mfp_config(ARRAY_AND_SIZE(gen1_pin_config)); |
| 802 | pxa2xx_mfp_config(ARRAY_AND_SIZE(a780_pin_config)); |
| 803 | |
Russell King | cc155c6 | 2009-11-09 13:34:08 +0800 | [diff] [blame] | 804 | pxa_set_ffuart_info(NULL); |
| 805 | pxa_set_btuart_info(NULL); |
| 806 | pxa_set_stuart_info(NULL); |
| 807 | |
Stefan Schmidt | 9ab24e4 | 2008-07-09 08:08:17 +0100 | [diff] [blame] | 808 | pxa_set_i2c_info(NULL); |
Stefan Schmidt | 9078ac2 | 2008-12-08 15:58:08 +0100 | [diff] [blame] | 809 | |
Russell King - ARM Linux | 4321e1a | 2011-02-15 15:37:30 +0800 | [diff] [blame] | 810 | pxa_set_fb_info(NULL, &ezx_fb_info_1); |
Stefan Schmidt | 9ab24e4 | 2008-07-09 08:08:17 +0100 | [diff] [blame] | 811 | |
Stefan Schmidt | fe9490c | 2008-12-08 15:58:09 +0100 | [diff] [blame] | 812 | pxa_set_keypad_info(&a780_keypad_platform_data); |
Stefan Schmidt | 9ab24e4 | 2008-07-09 08:08:17 +0100 | [diff] [blame] | 813 | |
Antonio Ospite | 405ac40 | 2009-11-12 15:47:04 +0100 | [diff] [blame] | 814 | if (a780_camera_init() == 0) { |
| 815 | pxa_set_camera_info(&a780_pxacamera_platform_data); |
| 816 | platform_device_register(&a780_camera); |
| 817 | } |
| 818 | |
Antonio Ospite | 1ce2c51 | 2009-06-01 12:26:58 +0200 | [diff] [blame] | 819 | platform_add_devices(ARRAY_AND_SIZE(ezx_devices)); |
| 820 | platform_add_devices(ARRAY_AND_SIZE(a780_devices)); |
Stefan Schmidt | 9ab24e4 | 2008-07-09 08:08:17 +0100 | [diff] [blame] | 821 | } |
| 822 | |
Stefan Schmidt | 9ab24e4 | 2008-07-09 08:08:17 +0100 | [diff] [blame] | 823 | MACHINE_START(EZX_A780, "Motorola EZX A780") |
Nicolas Pitre | 7375aba | 2011-07-05 22:38:15 -0400 | [diff] [blame] | 824 | .atag_offset = 0x100, |
Marek Vasut | 851982c | 2010-10-11 02:20:19 +0200 | [diff] [blame] | 825 | .map_io = pxa27x_map_io, |
Haojian Zhuang | 6ac6b81 | 2010-08-20 15:23:59 +0800 | [diff] [blame] | 826 | .nr_irqs = EZX_NR_IRQS, |
Stefan Schmidt | 9ab24e4 | 2008-07-09 08:08:17 +0100 | [diff] [blame] | 827 | .init_irq = pxa27x_init_irq, |
Eric Miao | 8a97ae2 | 2011-05-18 21:30:04 +0800 | [diff] [blame] | 828 | .handle_irq = pxa27x_handle_irq, |
Stephen Warren | 6bb27d7 | 2012-11-08 12:40:59 -0700 | [diff] [blame] | 829 | .init_time = pxa_timer_init, |
Stefan Schmidt | 9078ac2 | 2008-12-08 15:58:08 +0100 | [diff] [blame] | 830 | .init_machine = a780_init, |
Russell King | 271a74f | 2011-11-04 14:15:53 +0000 | [diff] [blame] | 831 | .restart = pxa_restart, |
Stefan Schmidt | 9ab24e4 | 2008-07-09 08:08:17 +0100 | [diff] [blame] | 832 | MACHINE_END |
| 833 | #endif |
| 834 | |
| 835 | #ifdef CONFIG_MACH_EZX_E680 |
Antonio Ospite | 1ce2c51 | 2009-06-01 12:26:58 +0200 | [diff] [blame] | 836 | /* gpio_keys */ |
| 837 | static struct gpio_keys_button e680_buttons[] = { |
| 838 | [0] = { |
| 839 | .code = KEY_SCREENLOCK, |
| 840 | .gpio = GPIO12_E680_LOCK_SWITCH, |
| 841 | .active_low = 0, |
| 842 | .desc = "E680 lock switch", |
| 843 | .type = EV_KEY, |
| 844 | .wakeup = 1, |
| 845 | }, |
| 846 | }; |
| 847 | |
| 848 | static struct gpio_keys_platform_data e680_gpio_keys_platform_data = { |
| 849 | .buttons = e680_buttons, |
| 850 | .nbuttons = ARRAY_SIZE(e680_buttons), |
| 851 | }; |
| 852 | |
| 853 | static struct platform_device e680_gpio_keys = { |
| 854 | .name = "gpio-keys", |
| 855 | .id = -1, |
| 856 | .dev = { |
| 857 | .platform_data = &e680_gpio_keys_platform_data, |
| 858 | }, |
| 859 | }; |
| 860 | |
Stefan Schmidt | bc09cf6 | 2008-12-08 15:58:10 +0100 | [diff] [blame] | 861 | static struct i2c_board_info __initdata e680_i2c_board_info[] = { |
| 862 | { I2C_BOARD_INFO("tea5767", 0x81) }, |
| 863 | }; |
| 864 | |
Antonio Ospite | 1ce2c51 | 2009-06-01 12:26:58 +0200 | [diff] [blame] | 865 | static struct platform_device *e680_devices[] __initdata = { |
| 866 | &e680_gpio_keys, |
| 867 | }; |
| 868 | |
Stefan Schmidt | 9078ac2 | 2008-12-08 15:58:08 +0100 | [diff] [blame] | 869 | static void __init e680_init(void) |
| 870 | { |
| 871 | pxa2xx_mfp_config(ARRAY_AND_SIZE(ezx_pin_config)); |
| 872 | pxa2xx_mfp_config(ARRAY_AND_SIZE(gen1_pin_config)); |
| 873 | pxa2xx_mfp_config(ARRAY_AND_SIZE(e680_pin_config)); |
| 874 | |
Russell King | cc155c6 | 2009-11-09 13:34:08 +0800 | [diff] [blame] | 875 | pxa_set_ffuart_info(NULL); |
| 876 | pxa_set_btuart_info(NULL); |
| 877 | pxa_set_stuart_info(NULL); |
| 878 | |
Stefan Schmidt | 9078ac2 | 2008-12-08 15:58:08 +0100 | [diff] [blame] | 879 | pxa_set_i2c_info(NULL); |
Stefan Schmidt | bc09cf6 | 2008-12-08 15:58:10 +0100 | [diff] [blame] | 880 | i2c_register_board_info(0, ARRAY_AND_SIZE(e680_i2c_board_info)); |
Stefan Schmidt | 9078ac2 | 2008-12-08 15:58:08 +0100 | [diff] [blame] | 881 | |
Russell King - ARM Linux | 4321e1a | 2011-02-15 15:37:30 +0800 | [diff] [blame] | 882 | pxa_set_fb_info(NULL, &ezx_fb_info_1); |
Stefan Schmidt | 9078ac2 | 2008-12-08 15:58:08 +0100 | [diff] [blame] | 883 | |
Stefan Schmidt | fe9490c | 2008-12-08 15:58:09 +0100 | [diff] [blame] | 884 | pxa_set_keypad_info(&e680_keypad_platform_data); |
| 885 | |
Antonio Ospite | 1ce2c51 | 2009-06-01 12:26:58 +0200 | [diff] [blame] | 886 | platform_add_devices(ARRAY_AND_SIZE(ezx_devices)); |
| 887 | platform_add_devices(ARRAY_AND_SIZE(e680_devices)); |
Stefan Schmidt | 9078ac2 | 2008-12-08 15:58:08 +0100 | [diff] [blame] | 888 | } |
| 889 | |
Stefan Schmidt | 9ab24e4 | 2008-07-09 08:08:17 +0100 | [diff] [blame] | 890 | MACHINE_START(EZX_E680, "Motorola EZX E680") |
Nicolas Pitre | 7375aba | 2011-07-05 22:38:15 -0400 | [diff] [blame] | 891 | .atag_offset = 0x100, |
Marek Vasut | 851982c | 2010-10-11 02:20:19 +0200 | [diff] [blame] | 892 | .map_io = pxa27x_map_io, |
Haojian Zhuang | 6ac6b81 | 2010-08-20 15:23:59 +0800 | [diff] [blame] | 893 | .nr_irqs = EZX_NR_IRQS, |
Stefan Schmidt | 9ab24e4 | 2008-07-09 08:08:17 +0100 | [diff] [blame] | 894 | .init_irq = pxa27x_init_irq, |
Eric Miao | 8a97ae2 | 2011-05-18 21:30:04 +0800 | [diff] [blame] | 895 | .handle_irq = pxa27x_handle_irq, |
Stephen Warren | 6bb27d7 | 2012-11-08 12:40:59 -0700 | [diff] [blame] | 896 | .init_time = pxa_timer_init, |
Stefan Schmidt | 9078ac2 | 2008-12-08 15:58:08 +0100 | [diff] [blame] | 897 | .init_machine = e680_init, |
Russell King | 271a74f | 2011-11-04 14:15:53 +0000 | [diff] [blame] | 898 | .restart = pxa_restart, |
Stefan Schmidt | 9ab24e4 | 2008-07-09 08:08:17 +0100 | [diff] [blame] | 899 | MACHINE_END |
| 900 | #endif |
| 901 | |
| 902 | #ifdef CONFIG_MACH_EZX_A1200 |
Antonio Ospite | 1ce2c51 | 2009-06-01 12:26:58 +0200 | [diff] [blame] | 903 | /* gpio_keys */ |
| 904 | static struct gpio_keys_button a1200_buttons[] = { |
| 905 | [0] = { |
| 906 | .code = SW_LID, |
| 907 | .gpio = GPIO15_A1200_FLIP_LID, |
| 908 | .active_low = 0, |
| 909 | .desc = "A1200 flip lid", |
| 910 | .type = EV_SW, |
| 911 | .wakeup = 1, |
| 912 | }, |
| 913 | }; |
| 914 | |
| 915 | static struct gpio_keys_platform_data a1200_gpio_keys_platform_data = { |
| 916 | .buttons = a1200_buttons, |
| 917 | .nbuttons = ARRAY_SIZE(a1200_buttons), |
| 918 | }; |
| 919 | |
| 920 | static struct platform_device a1200_gpio_keys = { |
| 921 | .name = "gpio-keys", |
| 922 | .id = -1, |
| 923 | .dev = { |
| 924 | .platform_data = &a1200_gpio_keys_platform_data, |
| 925 | }, |
| 926 | }; |
| 927 | |
Stefan Schmidt | bc09cf6 | 2008-12-08 15:58:10 +0100 | [diff] [blame] | 928 | static struct i2c_board_info __initdata a1200_i2c_board_info[] = { |
| 929 | { I2C_BOARD_INFO("tea5767", 0x81) }, |
| 930 | }; |
| 931 | |
Antonio Ospite | 1ce2c51 | 2009-06-01 12:26:58 +0200 | [diff] [blame] | 932 | static struct platform_device *a1200_devices[] __initdata = { |
| 933 | &a1200_gpio_keys, |
| 934 | }; |
| 935 | |
Stefan Schmidt | 9078ac2 | 2008-12-08 15:58:08 +0100 | [diff] [blame] | 936 | static void __init a1200_init(void) |
| 937 | { |
| 938 | pxa2xx_mfp_config(ARRAY_AND_SIZE(ezx_pin_config)); |
| 939 | pxa2xx_mfp_config(ARRAY_AND_SIZE(gen2_pin_config)); |
| 940 | pxa2xx_mfp_config(ARRAY_AND_SIZE(a1200_pin_config)); |
| 941 | |
Russell King | cc155c6 | 2009-11-09 13:34:08 +0800 | [diff] [blame] | 942 | pxa_set_ffuart_info(NULL); |
| 943 | pxa_set_btuart_info(NULL); |
| 944 | pxa_set_stuart_info(NULL); |
| 945 | |
Stefan Schmidt | 9078ac2 | 2008-12-08 15:58:08 +0100 | [diff] [blame] | 946 | pxa_set_i2c_info(NULL); |
Stefan Schmidt | bc09cf6 | 2008-12-08 15:58:10 +0100 | [diff] [blame] | 947 | i2c_register_board_info(0, ARRAY_AND_SIZE(a1200_i2c_board_info)); |
Stefan Schmidt | 9078ac2 | 2008-12-08 15:58:08 +0100 | [diff] [blame] | 948 | |
Russell King - ARM Linux | 4321e1a | 2011-02-15 15:37:30 +0800 | [diff] [blame] | 949 | pxa_set_fb_info(NULL, &ezx_fb_info_2); |
Stefan Schmidt | 9078ac2 | 2008-12-08 15:58:08 +0100 | [diff] [blame] | 950 | |
Stefan Schmidt | fe9490c | 2008-12-08 15:58:09 +0100 | [diff] [blame] | 951 | pxa_set_keypad_info(&a1200_keypad_platform_data); |
| 952 | |
Antonio Ospite | 1ce2c51 | 2009-06-01 12:26:58 +0200 | [diff] [blame] | 953 | platform_add_devices(ARRAY_AND_SIZE(ezx_devices)); |
| 954 | platform_add_devices(ARRAY_AND_SIZE(a1200_devices)); |
Stefan Schmidt | 9078ac2 | 2008-12-08 15:58:08 +0100 | [diff] [blame] | 955 | } |
| 956 | |
Stefan Schmidt | 9ab24e4 | 2008-07-09 08:08:17 +0100 | [diff] [blame] | 957 | MACHINE_START(EZX_A1200, "Motorola EZX A1200") |
Nicolas Pitre | 7375aba | 2011-07-05 22:38:15 -0400 | [diff] [blame] | 958 | .atag_offset = 0x100, |
Marek Vasut | 851982c | 2010-10-11 02:20:19 +0200 | [diff] [blame] | 959 | .map_io = pxa27x_map_io, |
Haojian Zhuang | 6ac6b81 | 2010-08-20 15:23:59 +0800 | [diff] [blame] | 960 | .nr_irqs = EZX_NR_IRQS, |
Stefan Schmidt | 9ab24e4 | 2008-07-09 08:08:17 +0100 | [diff] [blame] | 961 | .init_irq = pxa27x_init_irq, |
Eric Miao | 8a97ae2 | 2011-05-18 21:30:04 +0800 | [diff] [blame] | 962 | .handle_irq = pxa27x_handle_irq, |
Stephen Warren | 6bb27d7 | 2012-11-08 12:40:59 -0700 | [diff] [blame] | 963 | .init_time = pxa_timer_init, |
Stefan Schmidt | 9078ac2 | 2008-12-08 15:58:08 +0100 | [diff] [blame] | 964 | .init_machine = a1200_init, |
Russell King | 271a74f | 2011-11-04 14:15:53 +0000 | [diff] [blame] | 965 | .restart = pxa_restart, |
Stefan Schmidt | 9ab24e4 | 2008-07-09 08:08:17 +0100 | [diff] [blame] | 966 | MACHINE_END |
| 967 | #endif |
| 968 | |
| 969 | #ifdef CONFIG_MACH_EZX_A910 |
Antonio Ospite | 1ce2c51 | 2009-06-01 12:26:58 +0200 | [diff] [blame] | 970 | /* gpio_keys */ |
| 971 | static struct gpio_keys_button a910_buttons[] = { |
| 972 | [0] = { |
| 973 | .code = SW_LID, |
| 974 | .gpio = GPIO15_A910_FLIP_LID, |
| 975 | .active_low = 0, |
| 976 | .desc = "A910 flip lid", |
| 977 | .type = EV_SW, |
| 978 | .wakeup = 1, |
| 979 | }, |
| 980 | }; |
| 981 | |
| 982 | static struct gpio_keys_platform_data a910_gpio_keys_platform_data = { |
| 983 | .buttons = a910_buttons, |
| 984 | .nbuttons = ARRAY_SIZE(a910_buttons), |
| 985 | }; |
| 986 | |
| 987 | static struct platform_device a910_gpio_keys = { |
| 988 | .name = "gpio-keys", |
| 989 | .id = -1, |
| 990 | .dev = { |
| 991 | .platform_data = &a910_gpio_keys_platform_data, |
| 992 | }, |
| 993 | }; |
| 994 | |
Antonio Ospite | 405ac40 | 2009-11-12 15:47:04 +0100 | [diff] [blame] | 995 | /* camera */ |
| 996 | static int a910_camera_init(void) |
| 997 | { |
| 998 | int err; |
| 999 | |
| 1000 | /* |
| 1001 | * GPIO50_nCAM_EN is active low |
| 1002 | * GPIO28_GEN2_CAM_RST is active on rising edge |
| 1003 | */ |
| 1004 | err = gpio_request(GPIO50_nCAM_EN, "nCAM_EN"); |
| 1005 | if (err) { |
| 1006 | pr_err("%s: Failed to request nCAM_EN\n", __func__); |
| 1007 | goto fail; |
| 1008 | } |
| 1009 | |
| 1010 | err = gpio_request(GPIO28_GEN2_CAM_RST, "CAM_RST"); |
| 1011 | if (err) { |
| 1012 | pr_err("%s: Failed to request CAM_RST\n", __func__); |
| 1013 | goto fail_gpio_cam_rst; |
| 1014 | } |
| 1015 | |
| 1016 | gpio_direction_output(GPIO50_nCAM_EN, 1); |
| 1017 | gpio_direction_output(GPIO28_GEN2_CAM_RST, 0); |
| 1018 | |
| 1019 | return 0; |
| 1020 | |
| 1021 | fail_gpio_cam_rst: |
| 1022 | gpio_free(GPIO50_nCAM_EN); |
| 1023 | fail: |
| 1024 | return err; |
| 1025 | } |
| 1026 | |
| 1027 | static int a910_camera_power(struct device *dev, int on) |
| 1028 | { |
| 1029 | gpio_set_value(GPIO50_nCAM_EN, !on); |
| 1030 | return 0; |
| 1031 | } |
| 1032 | |
| 1033 | static int a910_camera_reset(struct device *dev) |
| 1034 | { |
| 1035 | gpio_set_value(GPIO28_GEN2_CAM_RST, 0); |
| 1036 | msleep(10); |
| 1037 | gpio_set_value(GPIO28_GEN2_CAM_RST, 1); |
| 1038 | |
| 1039 | return 0; |
| 1040 | } |
| 1041 | |
| 1042 | struct pxacamera_platform_data a910_pxacamera_platform_data = { |
| 1043 | .flags = PXA_CAMERA_MASTER | PXA_CAMERA_DATAWIDTH_8 | |
| 1044 | PXA_CAMERA_PCLK_EN | PXA_CAMERA_MCLK_EN, |
| 1045 | .mclk_10khz = 5000, |
| 1046 | }; |
| 1047 | |
| 1048 | static struct i2c_board_info a910_camera_i2c_board_info = { |
| 1049 | I2C_BOARD_INFO("mt9m111", 0x5d), |
| 1050 | }; |
| 1051 | |
| 1052 | static struct soc_camera_link a910_iclink = { |
| 1053 | .bus_id = 0, |
| 1054 | .i2c_adapter_id = 0, |
| 1055 | .board_info = &a910_camera_i2c_board_info, |
Antonio Ospite | 405ac40 | 2009-11-12 15:47:04 +0100 | [diff] [blame] | 1056 | .power = a910_camera_power, |
| 1057 | .reset = a910_camera_reset, |
| 1058 | }; |
| 1059 | |
| 1060 | static struct platform_device a910_camera = { |
| 1061 | .name = "soc-camera-pdrv", |
| 1062 | .id = 0, |
| 1063 | .dev = { |
| 1064 | .platform_data = &a910_iclink, |
| 1065 | }, |
| 1066 | }; |
| 1067 | |
Antonio Ospite | 87303b8 | 2009-11-03 17:45:33 +0100 | [diff] [blame] | 1068 | /* leds-lp3944 */ |
| 1069 | static struct lp3944_platform_data a910_lp3944_leds = { |
| 1070 | .leds_size = LP3944_LEDS_MAX, |
| 1071 | .leds = { |
| 1072 | [0] = { |
| 1073 | .name = "a910:red:", |
| 1074 | .status = LP3944_LED_STATUS_OFF, |
| 1075 | .type = LP3944_LED_TYPE_LED, |
| 1076 | }, |
| 1077 | [1] = { |
| 1078 | .name = "a910:green:", |
| 1079 | .status = LP3944_LED_STATUS_OFF, |
| 1080 | .type = LP3944_LED_TYPE_LED, |
| 1081 | }, |
| 1082 | [2] { |
| 1083 | .name = "a910:blue:", |
| 1084 | .status = LP3944_LED_STATUS_OFF, |
| 1085 | .type = LP3944_LED_TYPE_LED, |
| 1086 | }, |
| 1087 | /* Leds 3 and 4 are used as display power switches */ |
| 1088 | [3] = { |
| 1089 | .name = "a910::cli_display", |
| 1090 | .status = LP3944_LED_STATUS_OFF, |
| 1091 | .type = LP3944_LED_TYPE_LED_INVERTED |
| 1092 | }, |
| 1093 | [4] = { |
| 1094 | .name = "a910::main_display", |
| 1095 | .status = LP3944_LED_STATUS_ON, |
| 1096 | .type = LP3944_LED_TYPE_LED_INVERTED |
| 1097 | }, |
| 1098 | [5] = { .type = LP3944_LED_TYPE_NONE }, |
| 1099 | [6] = { |
| 1100 | .name = "a910::torch", |
| 1101 | .status = LP3944_LED_STATUS_OFF, |
| 1102 | .type = LP3944_LED_TYPE_LED, |
| 1103 | }, |
| 1104 | [7] = { |
| 1105 | .name = "a910::flash", |
| 1106 | .status = LP3944_LED_STATUS_OFF, |
| 1107 | .type = LP3944_LED_TYPE_LED_INVERTED, |
| 1108 | }, |
| 1109 | }, |
| 1110 | }; |
| 1111 | |
| 1112 | static struct i2c_board_info __initdata a910_i2c_board_info[] = { |
| 1113 | { |
| 1114 | I2C_BOARD_INFO("lp3944", 0x60), |
| 1115 | .platform_data = &a910_lp3944_leds, |
| 1116 | }, |
| 1117 | }; |
| 1118 | |
Antonio Ospite | 1ce2c51 | 2009-06-01 12:26:58 +0200 | [diff] [blame] | 1119 | static struct platform_device *a910_devices[] __initdata = { |
| 1120 | &a910_gpio_keys, |
| 1121 | }; |
| 1122 | |
Stefan Schmidt | 9078ac2 | 2008-12-08 15:58:08 +0100 | [diff] [blame] | 1123 | static void __init a910_init(void) |
| 1124 | { |
| 1125 | pxa2xx_mfp_config(ARRAY_AND_SIZE(ezx_pin_config)); |
| 1126 | pxa2xx_mfp_config(ARRAY_AND_SIZE(gen2_pin_config)); |
| 1127 | pxa2xx_mfp_config(ARRAY_AND_SIZE(a910_pin_config)); |
| 1128 | |
Russell King | cc155c6 | 2009-11-09 13:34:08 +0800 | [diff] [blame] | 1129 | pxa_set_ffuart_info(NULL); |
| 1130 | pxa_set_btuart_info(NULL); |
| 1131 | pxa_set_stuart_info(NULL); |
| 1132 | |
Stefan Schmidt | 9078ac2 | 2008-12-08 15:58:08 +0100 | [diff] [blame] | 1133 | pxa_set_i2c_info(NULL); |
Antonio Ospite | 87303b8 | 2009-11-03 17:45:33 +0100 | [diff] [blame] | 1134 | i2c_register_board_info(0, ARRAY_AND_SIZE(a910_i2c_board_info)); |
Stefan Schmidt | 9078ac2 | 2008-12-08 15:58:08 +0100 | [diff] [blame] | 1135 | |
Russell King - ARM Linux | 4321e1a | 2011-02-15 15:37:30 +0800 | [diff] [blame] | 1136 | pxa_set_fb_info(NULL, &ezx_fb_info_2); |
Stefan Schmidt | 9078ac2 | 2008-12-08 15:58:08 +0100 | [diff] [blame] | 1137 | |
Stefan Schmidt | fe9490c | 2008-12-08 15:58:09 +0100 | [diff] [blame] | 1138 | pxa_set_keypad_info(&a910_keypad_platform_data); |
| 1139 | |
Antonio Ospite | 405ac40 | 2009-11-12 15:47:04 +0100 | [diff] [blame] | 1140 | if (a910_camera_init() == 0) { |
| 1141 | pxa_set_camera_info(&a910_pxacamera_platform_data); |
| 1142 | platform_device_register(&a910_camera); |
| 1143 | } |
| 1144 | |
Antonio Ospite | 1ce2c51 | 2009-06-01 12:26:58 +0200 | [diff] [blame] | 1145 | platform_add_devices(ARRAY_AND_SIZE(ezx_devices)); |
| 1146 | platform_add_devices(ARRAY_AND_SIZE(a910_devices)); |
Stefan Schmidt | 9078ac2 | 2008-12-08 15:58:08 +0100 | [diff] [blame] | 1147 | } |
| 1148 | |
Stefan Schmidt | 9ab24e4 | 2008-07-09 08:08:17 +0100 | [diff] [blame] | 1149 | MACHINE_START(EZX_A910, "Motorola EZX A910") |
Nicolas Pitre | 7375aba | 2011-07-05 22:38:15 -0400 | [diff] [blame] | 1150 | .atag_offset = 0x100, |
Marek Vasut | 851982c | 2010-10-11 02:20:19 +0200 | [diff] [blame] | 1151 | .map_io = pxa27x_map_io, |
Haojian Zhuang | 6ac6b81 | 2010-08-20 15:23:59 +0800 | [diff] [blame] | 1152 | .nr_irqs = EZX_NR_IRQS, |
Stefan Schmidt | 9ab24e4 | 2008-07-09 08:08:17 +0100 | [diff] [blame] | 1153 | .init_irq = pxa27x_init_irq, |
Eric Miao | 8a97ae2 | 2011-05-18 21:30:04 +0800 | [diff] [blame] | 1154 | .handle_irq = pxa27x_handle_irq, |
Stephen Warren | 6bb27d7 | 2012-11-08 12:40:59 -0700 | [diff] [blame] | 1155 | .init_time = pxa_timer_init, |
Stefan Schmidt | 9078ac2 | 2008-12-08 15:58:08 +0100 | [diff] [blame] | 1156 | .init_machine = a910_init, |
Russell King | 271a74f | 2011-11-04 14:15:53 +0000 | [diff] [blame] | 1157 | .restart = pxa_restart, |
Stefan Schmidt | 9ab24e4 | 2008-07-09 08:08:17 +0100 | [diff] [blame] | 1158 | MACHINE_END |
| 1159 | #endif |
| 1160 | |
| 1161 | #ifdef CONFIG_MACH_EZX_E6 |
Antonio Ospite | 1ce2c51 | 2009-06-01 12:26:58 +0200 | [diff] [blame] | 1162 | /* gpio_keys */ |
| 1163 | static struct gpio_keys_button e6_buttons[] = { |
| 1164 | [0] = { |
| 1165 | .code = KEY_SCREENLOCK, |
| 1166 | .gpio = GPIO15_E6_LOCK_SWITCH, |
| 1167 | .active_low = 0, |
| 1168 | .desc = "E6 lock switch", |
| 1169 | .type = EV_KEY, |
| 1170 | .wakeup = 1, |
| 1171 | }, |
| 1172 | }; |
| 1173 | |
| 1174 | static struct gpio_keys_platform_data e6_gpio_keys_platform_data = { |
| 1175 | .buttons = e6_buttons, |
| 1176 | .nbuttons = ARRAY_SIZE(e6_buttons), |
| 1177 | }; |
| 1178 | |
| 1179 | static struct platform_device e6_gpio_keys = { |
| 1180 | .name = "gpio-keys", |
| 1181 | .id = -1, |
| 1182 | .dev = { |
| 1183 | .platform_data = &e6_gpio_keys_platform_data, |
| 1184 | }, |
| 1185 | }; |
| 1186 | |
Stefan Schmidt | bc09cf6 | 2008-12-08 15:58:10 +0100 | [diff] [blame] | 1187 | static struct i2c_board_info __initdata e6_i2c_board_info[] = { |
| 1188 | { I2C_BOARD_INFO("tea5767", 0x81) }, |
| 1189 | }; |
| 1190 | |
Antonio Ospite | 1ce2c51 | 2009-06-01 12:26:58 +0200 | [diff] [blame] | 1191 | static struct platform_device *e6_devices[] __initdata = { |
| 1192 | &e6_gpio_keys, |
| 1193 | }; |
| 1194 | |
Stefan Schmidt | 9078ac2 | 2008-12-08 15:58:08 +0100 | [diff] [blame] | 1195 | static void __init e6_init(void) |
| 1196 | { |
| 1197 | pxa2xx_mfp_config(ARRAY_AND_SIZE(ezx_pin_config)); |
| 1198 | pxa2xx_mfp_config(ARRAY_AND_SIZE(gen2_pin_config)); |
| 1199 | pxa2xx_mfp_config(ARRAY_AND_SIZE(e6_pin_config)); |
| 1200 | |
Russell King | cc155c6 | 2009-11-09 13:34:08 +0800 | [diff] [blame] | 1201 | pxa_set_ffuart_info(NULL); |
| 1202 | pxa_set_btuart_info(NULL); |
| 1203 | pxa_set_stuart_info(NULL); |
| 1204 | |
Stefan Schmidt | 9078ac2 | 2008-12-08 15:58:08 +0100 | [diff] [blame] | 1205 | pxa_set_i2c_info(NULL); |
Stefan Schmidt | bc09cf6 | 2008-12-08 15:58:10 +0100 | [diff] [blame] | 1206 | i2c_register_board_info(0, ARRAY_AND_SIZE(e6_i2c_board_info)); |
Stefan Schmidt | 9078ac2 | 2008-12-08 15:58:08 +0100 | [diff] [blame] | 1207 | |
Russell King - ARM Linux | 4321e1a | 2011-02-15 15:37:30 +0800 | [diff] [blame] | 1208 | pxa_set_fb_info(NULL, &ezx_fb_info_2); |
Stefan Schmidt | 9078ac2 | 2008-12-08 15:58:08 +0100 | [diff] [blame] | 1209 | |
Stefan Schmidt | fe9490c | 2008-12-08 15:58:09 +0100 | [diff] [blame] | 1210 | pxa_set_keypad_info(&e6_keypad_platform_data); |
| 1211 | |
Antonio Ospite | 1ce2c51 | 2009-06-01 12:26:58 +0200 | [diff] [blame] | 1212 | platform_add_devices(ARRAY_AND_SIZE(ezx_devices)); |
| 1213 | platform_add_devices(ARRAY_AND_SIZE(e6_devices)); |
Stefan Schmidt | 9078ac2 | 2008-12-08 15:58:08 +0100 | [diff] [blame] | 1214 | } |
| 1215 | |
Stefan Schmidt | 9ab24e4 | 2008-07-09 08:08:17 +0100 | [diff] [blame] | 1216 | MACHINE_START(EZX_E6, "Motorola EZX E6") |
Nicolas Pitre | 7375aba | 2011-07-05 22:38:15 -0400 | [diff] [blame] | 1217 | .atag_offset = 0x100, |
Marek Vasut | 851982c | 2010-10-11 02:20:19 +0200 | [diff] [blame] | 1218 | .map_io = pxa27x_map_io, |
Haojian Zhuang | 6ac6b81 | 2010-08-20 15:23:59 +0800 | [diff] [blame] | 1219 | .nr_irqs = EZX_NR_IRQS, |
Stefan Schmidt | 9ab24e4 | 2008-07-09 08:08:17 +0100 | [diff] [blame] | 1220 | .init_irq = pxa27x_init_irq, |
Eric Miao | 8a97ae2 | 2011-05-18 21:30:04 +0800 | [diff] [blame] | 1221 | .handle_irq = pxa27x_handle_irq, |
Stephen Warren | 6bb27d7 | 2012-11-08 12:40:59 -0700 | [diff] [blame] | 1222 | .init_time = pxa_timer_init, |
Stefan Schmidt | 9078ac2 | 2008-12-08 15:58:08 +0100 | [diff] [blame] | 1223 | .init_machine = e6_init, |
Russell King | 271a74f | 2011-11-04 14:15:53 +0000 | [diff] [blame] | 1224 | .restart = pxa_restart, |
Stefan Schmidt | 9ab24e4 | 2008-07-09 08:08:17 +0100 | [diff] [blame] | 1225 | MACHINE_END |
| 1226 | #endif |
| 1227 | |
| 1228 | #ifdef CONFIG_MACH_EZX_E2 |
Stefan Schmidt | bc09cf6 | 2008-12-08 15:58:10 +0100 | [diff] [blame] | 1229 | static struct i2c_board_info __initdata e2_i2c_board_info[] = { |
| 1230 | { I2C_BOARD_INFO("tea5767", 0x81) }, |
| 1231 | }; |
| 1232 | |
Antonio Ospite | 1ce2c51 | 2009-06-01 12:26:58 +0200 | [diff] [blame] | 1233 | static struct platform_device *e2_devices[] __initdata = { |
| 1234 | }; |
| 1235 | |
Stefan Schmidt | 9078ac2 | 2008-12-08 15:58:08 +0100 | [diff] [blame] | 1236 | static void __init e2_init(void) |
| 1237 | { |
| 1238 | pxa2xx_mfp_config(ARRAY_AND_SIZE(ezx_pin_config)); |
| 1239 | pxa2xx_mfp_config(ARRAY_AND_SIZE(gen2_pin_config)); |
| 1240 | pxa2xx_mfp_config(ARRAY_AND_SIZE(e2_pin_config)); |
| 1241 | |
Russell King | cc155c6 | 2009-11-09 13:34:08 +0800 | [diff] [blame] | 1242 | pxa_set_ffuart_info(NULL); |
| 1243 | pxa_set_btuart_info(NULL); |
| 1244 | pxa_set_stuart_info(NULL); |
| 1245 | |
Stefan Schmidt | 9078ac2 | 2008-12-08 15:58:08 +0100 | [diff] [blame] | 1246 | pxa_set_i2c_info(NULL); |
Stefan Schmidt | bc09cf6 | 2008-12-08 15:58:10 +0100 | [diff] [blame] | 1247 | i2c_register_board_info(0, ARRAY_AND_SIZE(e2_i2c_board_info)); |
Stefan Schmidt | 9078ac2 | 2008-12-08 15:58:08 +0100 | [diff] [blame] | 1248 | |
Russell King - ARM Linux | 4321e1a | 2011-02-15 15:37:30 +0800 | [diff] [blame] | 1249 | pxa_set_fb_info(NULL, &ezx_fb_info_2); |
Stefan Schmidt | 9078ac2 | 2008-12-08 15:58:08 +0100 | [diff] [blame] | 1250 | |
Stefan Schmidt | fe9490c | 2008-12-08 15:58:09 +0100 | [diff] [blame] | 1251 | pxa_set_keypad_info(&e2_keypad_platform_data); |
| 1252 | |
Antonio Ospite | 1ce2c51 | 2009-06-01 12:26:58 +0200 | [diff] [blame] | 1253 | platform_add_devices(ARRAY_AND_SIZE(ezx_devices)); |
| 1254 | platform_add_devices(ARRAY_AND_SIZE(e2_devices)); |
Stefan Schmidt | 9078ac2 | 2008-12-08 15:58:08 +0100 | [diff] [blame] | 1255 | } |
| 1256 | |
Stefan Schmidt | 9ab24e4 | 2008-07-09 08:08:17 +0100 | [diff] [blame] | 1257 | MACHINE_START(EZX_E2, "Motorola EZX E2") |
Nicolas Pitre | 7375aba | 2011-07-05 22:38:15 -0400 | [diff] [blame] | 1258 | .atag_offset = 0x100, |
Marek Vasut | 851982c | 2010-10-11 02:20:19 +0200 | [diff] [blame] | 1259 | .map_io = pxa27x_map_io, |
Haojian Zhuang | 6ac6b81 | 2010-08-20 15:23:59 +0800 | [diff] [blame] | 1260 | .nr_irqs = EZX_NR_IRQS, |
Stefan Schmidt | 9ab24e4 | 2008-07-09 08:08:17 +0100 | [diff] [blame] | 1261 | .init_irq = pxa27x_init_irq, |
Eric Miao | 8a97ae2 | 2011-05-18 21:30:04 +0800 | [diff] [blame] | 1262 | .handle_irq = pxa27x_handle_irq, |
Stephen Warren | 6bb27d7 | 2012-11-08 12:40:59 -0700 | [diff] [blame] | 1263 | .init_time = pxa_timer_init, |
Stefan Schmidt | 9078ac2 | 2008-12-08 15:58:08 +0100 | [diff] [blame] | 1264 | .init_machine = e2_init, |
Russell King | 271a74f | 2011-11-04 14:15:53 +0000 | [diff] [blame] | 1265 | .restart = pxa_restart, |
Stefan Schmidt | 9ab24e4 | 2008-07-09 08:08:17 +0100 | [diff] [blame] | 1266 | MACHINE_END |
| 1267 | #endif |