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