Tomas 'Sleep_Walker' Cech | e6c3f4b | 2009-05-18 15:24:14 +0200 | [diff] [blame] | 1 | /* |
Tomáš Čech | bb2ae8f | 2009-09-11 13:57:01 +0200 | [diff] [blame] | 2 | * Hardware definitions for Palm Treo smartphones |
| 3 | * |
| 4 | * currently supported: |
| 5 | * Palm Treo 680 (GSM) |
Tomáš Čech | d0a92fd | 2009-09-11 13:57:02 +0200 | [diff] [blame] | 6 | * Palm Centro 685 (GSM) |
Tomas 'Sleep_Walker' Cech | e6c3f4b | 2009-05-18 15:24:14 +0200 | [diff] [blame] | 7 | * |
| 8 | * Author: Tomas Cech <sleep_walker@suse.cz> |
| 9 | * |
| 10 | * This program is free software; you can redistribute it and/or modify |
| 11 | * it under the terms of the GNU General Public License version 2 as |
| 12 | * published by the Free Software Foundation. |
| 13 | * |
| 14 | * (find more info at www.hackndev.com) |
| 15 | * |
| 16 | */ |
| 17 | |
| 18 | #include <linux/platform_device.h> |
| 19 | #include <linux/delay.h> |
| 20 | #include <linux/irq.h> |
| 21 | #include <linux/gpio_keys.h> |
| 22 | #include <linux/input.h> |
Russell King | 8d717a5 | 2010-05-22 19:47:18 +0100 | [diff] [blame] | 23 | #include <linux/memblock.h> |
Tomas 'Sleep_Walker' Cech | e6c3f4b | 2009-05-18 15:24:14 +0200 | [diff] [blame] | 24 | #include <linux/pda_power.h> |
| 25 | #include <linux/pwm_backlight.h> |
| 26 | #include <linux/gpio.h> |
Tomas 'Sleep_Walker' Cech | e6c3f4b | 2009-05-18 15:24:14 +0200 | [diff] [blame] | 27 | #include <linux/power_supply.h> |
| 28 | #include <linux/sysdev.h> |
| 29 | #include <linux/w1-gpio.h> |
| 30 | |
| 31 | #include <asm/mach-types.h> |
| 32 | #include <asm/mach/arch.h> |
| 33 | #include <asm/mach/map.h> |
| 34 | |
| 35 | #include <mach/pxa27x.h> |
| 36 | #include <mach/pxa27x-udc.h> |
| 37 | #include <mach/audio.h> |
Tomáš Čech | bb2ae8f | 2009-09-11 13:57:01 +0200 | [diff] [blame] | 38 | #include <mach/palmtreo.h> |
Tomas 'Sleep_Walker' Cech | e6c3f4b | 2009-05-18 15:24:14 +0200 | [diff] [blame] | 39 | #include <mach/mmc.h> |
| 40 | #include <mach/pxafb.h> |
| 41 | #include <mach/irda.h> |
Mark F. Brown | 4a2490e | 2010-09-03 18:28:06 -0400 | [diff] [blame] | 42 | #include <plat/pxa27x_keypad.h> |
Tomas 'Sleep_Walker' Cech | e6c3f4b | 2009-05-18 15:24:14 +0200 | [diff] [blame] | 43 | #include <mach/udc.h> |
| 44 | #include <mach/ohci.h> |
| 45 | #include <mach/pxa2xx-regs.h> |
| 46 | #include <mach/palmasoc.h> |
| 47 | #include <mach/camera.h> |
Marek Vasut | 31620e2 | 2010-07-13 08:16:45 +0200 | [diff] [blame] | 48 | #include <mach/palm27x.h> |
Tomas 'Sleep_Walker' Cech | e6c3f4b | 2009-05-18 15:24:14 +0200 | [diff] [blame] | 49 | |
| 50 | #include <sound/pxa2xx-lib.h> |
| 51 | |
| 52 | #include "generic.h" |
| 53 | #include "devices.h" |
| 54 | |
| 55 | /****************************************************************************** |
| 56 | * Pin configuration |
| 57 | ******************************************************************************/ |
Tomáš Čech | bb2ae8f | 2009-09-11 13:57:01 +0200 | [diff] [blame] | 58 | static unsigned long treo_pin_config[] __initdata = { |
Tomas 'Sleep_Walker' Cech | e6c3f4b | 2009-05-18 15:24:14 +0200 | [diff] [blame] | 59 | /* MMC */ |
| 60 | GPIO32_MMC_CLK, |
| 61 | GPIO92_MMC_DAT_0, |
| 62 | GPIO109_MMC_DAT_1, |
| 63 | GPIO110_MMC_DAT_2, |
| 64 | GPIO111_MMC_DAT_3, |
| 65 | GPIO112_MMC_CMD, |
Tomas 'Sleep_Walker' Cech | e6c3f4b | 2009-05-18 15:24:14 +0200 | [diff] [blame] | 66 | GPIO113_GPIO, /* SD detect */ |
| 67 | |
| 68 | /* AC97 */ |
| 69 | GPIO28_AC97_BITCLK, |
| 70 | GPIO29_AC97_SDATA_IN_0, |
| 71 | GPIO30_AC97_SDATA_OUT, |
| 72 | GPIO31_AC97_SYNC, |
| 73 | GPIO89_AC97_SYSCLK, |
| 74 | GPIO95_AC97_nRESET, |
| 75 | |
| 76 | /* IrDA */ |
| 77 | GPIO46_FICP_RXD, |
| 78 | GPIO47_FICP_TXD, |
| 79 | |
| 80 | /* PWM */ |
| 81 | GPIO16_PWM0_OUT, |
| 82 | |
| 83 | /* USB */ |
| 84 | GPIO1_GPIO | WAKEUP_ON_EDGE_BOTH, /* usb detect */ |
| 85 | |
| 86 | /* MATRIX KEYPAD */ |
Tomas 'Sleep_Walker' Cech | e6c3f4b | 2009-05-18 15:24:14 +0200 | [diff] [blame] | 87 | GPIO101_KP_MKIN_1, |
| 88 | GPIO102_KP_MKIN_2, |
| 89 | GPIO97_KP_MKIN_3, |
| 90 | GPIO98_KP_MKIN_4, |
Tomas 'Sleep_Walker' Cech | e6c3f4b | 2009-05-18 15:24:14 +0200 | [diff] [blame] | 91 | GPIO91_KP_MKIN_6, |
| 92 | GPIO13_KP_MKIN_7, |
| 93 | GPIO103_KP_MKOUT_0 | MFP_LPM_DRIVE_HIGH, |
| 94 | GPIO104_KP_MKOUT_1, |
| 95 | GPIO105_KP_MKOUT_2, |
| 96 | GPIO106_KP_MKOUT_3, |
| 97 | GPIO107_KP_MKOUT_4, |
| 98 | GPIO108_KP_MKOUT_5, |
| 99 | GPIO96_KP_MKOUT_6, |
| 100 | GPIO93_KP_DKIN_0 | WAKEUP_ON_LEVEL_HIGH, /* Hotsync button */ |
| 101 | |
| 102 | /* LCD */ |
Eric Miao | bedbda9 | 2010-01-04 11:37:14 +0800 | [diff] [blame] | 103 | GPIOxx_LCD_TFT_16BPP, |
Tomas 'Sleep_Walker' Cech | e6c3f4b | 2009-05-18 15:24:14 +0200 | [diff] [blame] | 104 | |
| 105 | /* Quick Capture Interface */ |
| 106 | GPIO84_CIF_FV, |
| 107 | GPIO85_CIF_LV, |
| 108 | GPIO53_CIF_MCLK, |
| 109 | GPIO54_CIF_PCLK, |
| 110 | GPIO81_CIF_DD_0, |
| 111 | GPIO55_CIF_DD_1, |
| 112 | GPIO51_CIF_DD_2, |
| 113 | GPIO50_CIF_DD_3, |
| 114 | GPIO52_CIF_DD_4, |
| 115 | GPIO48_CIF_DD_5, |
| 116 | GPIO17_CIF_DD_6, |
| 117 | GPIO12_CIF_DD_7, |
| 118 | |
| 119 | /* I2C */ |
| 120 | GPIO117_I2C_SCL, |
| 121 | GPIO118_I2C_SDA, |
| 122 | |
| 123 | /* GSM */ |
| 124 | GPIO14_GPIO | WAKEUP_ON_EDGE_BOTH, /* GSM host wake up */ |
| 125 | GPIO34_FFUART_RXD, |
| 126 | GPIO35_FFUART_CTS, |
| 127 | GPIO39_FFUART_TXD, |
| 128 | GPIO41_FFUART_RTS, |
| 129 | |
| 130 | /* MISC. */ |
| 131 | GPIO0_GPIO | WAKEUP_ON_EDGE_BOTH, /* external power detect */ |
| 132 | GPIO15_GPIO | WAKEUP_ON_EDGE_BOTH, /* silent switch */ |
| 133 | GPIO116_GPIO, /* headphone detect */ |
| 134 | GPIO11_GPIO | WAKEUP_ON_EDGE_BOTH, /* bluetooth host wake up */ |
| 135 | }; |
| 136 | |
Tomáš Čech | bb2ae8f | 2009-09-11 13:57:01 +0200 | [diff] [blame] | 137 | #ifdef CONFIG_MACH_TREO680 |
| 138 | static unsigned long treo680_pin_config[] __initdata = { |
| 139 | GPIO33_GPIO, /* SD read only */ |
| 140 | |
| 141 | /* MATRIX KEYPAD - different wake up source */ |
| 142 | GPIO100_KP_MKIN_0 | WAKEUP_ON_LEVEL_HIGH, |
| 143 | GPIO99_KP_MKIN_5, |
| 144 | }; |
| 145 | #endif /* CONFIG_MACH_TREO680 */ |
| 146 | |
Tomáš Čech | d0a92fd | 2009-09-11 13:57:02 +0200 | [diff] [blame] | 147 | #ifdef CONFIG_MACH_CENTRO |
| 148 | static unsigned long centro685_pin_config[] __initdata = { |
| 149 | /* Bluetooth attached to BT UART*/ |
| 150 | MFP_CFG_OUT(GPIO80, AF0, DRIVE_LOW), /* power: LOW = off */ |
| 151 | GPIO42_BTUART_RXD, |
| 152 | GPIO43_BTUART_TXD, |
| 153 | GPIO44_BTUART_CTS, |
| 154 | GPIO45_BTUART_RTS, |
| 155 | |
| 156 | /* MATRIX KEYPAD - different wake up source */ |
| 157 | GPIO100_KP_MKIN_0, |
| 158 | GPIO99_KP_MKIN_5 | WAKEUP_ON_LEVEL_HIGH, |
| 159 | }; |
| 160 | #endif /* CONFIG_MACH_CENTRO */ |
| 161 | |
Tomas 'Sleep_Walker' Cech | e6c3f4b | 2009-05-18 15:24:14 +0200 | [diff] [blame] | 162 | /****************************************************************************** |
Tomas 'Sleep_Walker' Cech | e6c3f4b | 2009-05-18 15:24:14 +0200 | [diff] [blame] | 163 | * GPIO keyboard |
| 164 | ******************************************************************************/ |
Marek Vasut | 31620e2 | 2010-07-13 08:16:45 +0200 | [diff] [blame] | 165 | #if defined(CONFIG_KEYBOARD_PXA27x) || defined(CONFIG_KEYBOARD_PXA27x_MODULE) |
Tomas 'Sleep_Walker' Cech | e6c3f4b | 2009-05-18 15:24:14 +0200 | [diff] [blame] | 166 | static unsigned int treo680_matrix_keys[] = { |
| 167 | KEY(0, 0, KEY_F8), /* Red/Off/Power */ |
| 168 | KEY(0, 1, KEY_LEFT), |
| 169 | KEY(0, 2, KEY_LEFTCTRL), /* Alternate */ |
| 170 | KEY(0, 3, KEY_L), |
| 171 | KEY(0, 4, KEY_A), |
| 172 | KEY(0, 5, KEY_Q), |
| 173 | KEY(0, 6, KEY_P), |
| 174 | |
| 175 | KEY(1, 0, KEY_RIGHTCTRL), /* Menu */ |
| 176 | KEY(1, 1, KEY_RIGHT), |
| 177 | KEY(1, 2, KEY_LEFTSHIFT), /* Left shift */ |
| 178 | KEY(1, 3, KEY_Z), |
| 179 | KEY(1, 4, KEY_S), |
| 180 | KEY(1, 5, KEY_W), |
| 181 | |
| 182 | KEY(2, 0, KEY_F1), /* Phone */ |
| 183 | KEY(2, 1, KEY_UP), |
| 184 | KEY(2, 2, KEY_0), |
| 185 | KEY(2, 3, KEY_X), |
| 186 | KEY(2, 4, KEY_D), |
| 187 | KEY(2, 5, KEY_E), |
| 188 | |
| 189 | KEY(3, 0, KEY_F10), /* Calendar */ |
| 190 | KEY(3, 1, KEY_DOWN), |
| 191 | KEY(3, 2, KEY_SPACE), |
| 192 | KEY(3, 3, KEY_C), |
| 193 | KEY(3, 4, KEY_F), |
| 194 | KEY(3, 5, KEY_R), |
| 195 | |
| 196 | KEY(4, 0, KEY_F12), /* Mail */ |
| 197 | KEY(4, 1, KEY_KPENTER), |
| 198 | KEY(4, 2, KEY_RIGHTALT), /* Alt */ |
| 199 | KEY(4, 3, KEY_V), |
| 200 | KEY(4, 4, KEY_G), |
| 201 | KEY(4, 5, KEY_T), |
| 202 | |
| 203 | KEY(5, 0, KEY_F9), /* Home */ |
| 204 | KEY(5, 1, KEY_PAGEUP), /* Side up */ |
| 205 | KEY(5, 2, KEY_DOT), |
| 206 | KEY(5, 3, KEY_B), |
| 207 | KEY(5, 4, KEY_H), |
| 208 | KEY(5, 5, KEY_Y), |
| 209 | |
| 210 | KEY(6, 0, KEY_TAB), /* Side Activate */ |
| 211 | KEY(6, 1, KEY_PAGEDOWN), /* Side down */ |
| 212 | KEY(6, 2, KEY_ENTER), |
| 213 | KEY(6, 3, KEY_N), |
| 214 | KEY(6, 4, KEY_J), |
| 215 | KEY(6, 5, KEY_U), |
| 216 | |
| 217 | KEY(7, 0, KEY_F6), /* Green/Call */ |
| 218 | KEY(7, 1, KEY_O), |
| 219 | KEY(7, 2, KEY_BACKSPACE), |
| 220 | KEY(7, 3, KEY_M), |
| 221 | KEY(7, 4, KEY_K), |
| 222 | KEY(7, 5, KEY_I), |
| 223 | }; |
| 224 | |
Tomáš Čech | d0a92fd | 2009-09-11 13:57:02 +0200 | [diff] [blame] | 225 | static unsigned int centro_matrix_keys[] = { |
| 226 | KEY(0, 0, KEY_F9), /* Home */ |
| 227 | KEY(0, 1, KEY_LEFT), |
| 228 | KEY(0, 2, KEY_LEFTCTRL), /* Alternate */ |
| 229 | KEY(0, 3, KEY_L), |
| 230 | KEY(0, 4, KEY_A), |
| 231 | KEY(0, 5, KEY_Q), |
| 232 | KEY(0, 6, KEY_P), |
| 233 | |
| 234 | KEY(1, 0, KEY_RIGHTCTRL), /* Menu */ |
| 235 | KEY(1, 1, KEY_RIGHT), |
| 236 | KEY(1, 2, KEY_LEFTSHIFT), /* Left shift */ |
| 237 | KEY(1, 3, KEY_Z), |
| 238 | KEY(1, 4, KEY_S), |
| 239 | KEY(1, 5, KEY_W), |
| 240 | |
| 241 | KEY(2, 0, KEY_F1), /* Phone */ |
| 242 | KEY(2, 1, KEY_UP), |
| 243 | KEY(2, 2, KEY_0), |
| 244 | KEY(2, 3, KEY_X), |
| 245 | KEY(2, 4, KEY_D), |
| 246 | KEY(2, 5, KEY_E), |
| 247 | |
| 248 | KEY(3, 0, KEY_F10), /* Calendar */ |
| 249 | KEY(3, 1, KEY_DOWN), |
| 250 | KEY(3, 2, KEY_SPACE), |
| 251 | KEY(3, 3, KEY_C), |
| 252 | KEY(3, 4, KEY_F), |
| 253 | KEY(3, 5, KEY_R), |
| 254 | |
| 255 | KEY(4, 0, KEY_F12), /* Mail */ |
| 256 | KEY(4, 1, KEY_KPENTER), |
| 257 | KEY(4, 2, KEY_RIGHTALT), /* Alt */ |
| 258 | KEY(4, 3, KEY_V), |
| 259 | KEY(4, 4, KEY_G), |
| 260 | KEY(4, 5, KEY_T), |
| 261 | |
| 262 | KEY(5, 0, KEY_F8), /* Red/Off/Power */ |
| 263 | KEY(5, 1, KEY_PAGEUP), /* Side up */ |
| 264 | KEY(5, 2, KEY_DOT), |
| 265 | KEY(5, 3, KEY_B), |
| 266 | KEY(5, 4, KEY_H), |
| 267 | KEY(5, 5, KEY_Y), |
| 268 | |
| 269 | KEY(6, 0, KEY_TAB), /* Side Activate */ |
| 270 | KEY(6, 1, KEY_PAGEDOWN), /* Side down */ |
| 271 | KEY(6, 2, KEY_ENTER), |
| 272 | KEY(6, 3, KEY_N), |
| 273 | KEY(6, 4, KEY_J), |
| 274 | KEY(6, 5, KEY_U), |
| 275 | |
| 276 | KEY(7, 0, KEY_F6), /* Green/Call */ |
| 277 | KEY(7, 1, KEY_O), |
| 278 | KEY(7, 2, KEY_BACKSPACE), |
| 279 | KEY(7, 3, KEY_M), |
| 280 | KEY(7, 4, KEY_K), |
| 281 | KEY(7, 5, KEY_I), |
| 282 | }; |
| 283 | |
Marek Vasut | 31620e2 | 2010-07-13 08:16:45 +0200 | [diff] [blame] | 284 | static struct pxa27x_keypad_platform_data treo680_keypad_pdata = { |
Tomáš Čech | d0a92fd | 2009-09-11 13:57:02 +0200 | [diff] [blame] | 285 | .matrix_key_rows = 8, |
| 286 | .matrix_key_cols = 7, |
Marek Vasut | 31620e2 | 2010-07-13 08:16:45 +0200 | [diff] [blame] | 287 | .matrix_key_map = treo680_matrix_keys, |
| 288 | .matrix_key_map_size = ARRAY_SIZE(treo680_matrix_keys), |
Tomáš Čech | d0a92fd | 2009-09-11 13:57:02 +0200 | [diff] [blame] | 289 | .direct_key_map = { KEY_CONNECT }, |
| 290 | .direct_key_num = 1, |
| 291 | |
| 292 | .debounce_interval = 30, |
| 293 | }; |
Tomáš Čech | d0a92fd | 2009-09-11 13:57:02 +0200 | [diff] [blame] | 294 | |
Marek Vasut | 31620e2 | 2010-07-13 08:16:45 +0200 | [diff] [blame] | 295 | static void __init palmtreo_kpc_init(void) |
Tomas 'Sleep_Walker' Cech | e6c3f4b | 2009-05-18 15:24:14 +0200 | [diff] [blame] | 296 | { |
Marek Vasut | 31620e2 | 2010-07-13 08:16:45 +0200 | [diff] [blame] | 297 | static struct pxa27x_keypad_platform_data *data = &treo680_keypad_pdata; |
Tomas 'Sleep_Walker' Cech | e6c3f4b | 2009-05-18 15:24:14 +0200 | [diff] [blame] | 298 | |
Marek Vasut | 31620e2 | 2010-07-13 08:16:45 +0200 | [diff] [blame] | 299 | if (machine_is_centro()) { |
| 300 | data->matrix_key_map = centro_matrix_keys; |
| 301 | data->matrix_key_map_size = ARRAY_SIZE(centro_matrix_keys); |
| 302 | } |
Tomas 'Sleep_Walker' Cech | e6c3f4b | 2009-05-18 15:24:14 +0200 | [diff] [blame] | 303 | |
Marek Vasut | 31620e2 | 2010-07-13 08:16:45 +0200 | [diff] [blame] | 304 | pxa_set_keypad_info(&treo680_keypad_pdata); |
Tomas 'Sleep_Walker' Cech | e6c3f4b | 2009-05-18 15:24:14 +0200 | [diff] [blame] | 305 | } |
Marek Vasut | 31620e2 | 2010-07-13 08:16:45 +0200 | [diff] [blame] | 306 | #else |
| 307 | static inline void palmtreo_kpc_init(void) {} |
| 308 | #endif |
Tomas 'Sleep_Walker' Cech | e6c3f4b | 2009-05-18 15:24:14 +0200 | [diff] [blame] | 309 | |
| 310 | /****************************************************************************** |
| 311 | * USB host |
| 312 | ******************************************************************************/ |
Marek Vasut | 31620e2 | 2010-07-13 08:16:45 +0200 | [diff] [blame] | 313 | #if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE) |
Tomas 'Sleep_Walker' Cech | e6c3f4b | 2009-05-18 15:24:14 +0200 | [diff] [blame] | 314 | static struct pxaohci_platform_data treo680_ohci_info = { |
| 315 | .port_mode = PMM_PERPORT_MODE, |
| 316 | .flags = ENABLE_PORT1 | ENABLE_PORT3, |
| 317 | .power_budget = 0, |
| 318 | }; |
| 319 | |
Marek Vasut | 31620e2 | 2010-07-13 08:16:45 +0200 | [diff] [blame] | 320 | static void __init palmtreo_uhc_init(void) |
Tomas 'Sleep_Walker' Cech | e6c3f4b | 2009-05-18 15:24:14 +0200 | [diff] [blame] | 321 | { |
Marek Vasut | 31620e2 | 2010-07-13 08:16:45 +0200 | [diff] [blame] | 322 | if (machine_is_treo680()) |
| 323 | pxa_set_ohci_info(&treo680_ohci_info); |
Tomas 'Sleep_Walker' Cech | e6c3f4b | 2009-05-18 15:24:14 +0200 | [diff] [blame] | 324 | } |
Marek Vasut | 31620e2 | 2010-07-13 08:16:45 +0200 | [diff] [blame] | 325 | #else |
| 326 | static inline void palmtreo_uhc_init(void) {} |
| 327 | #endif |
Tomas 'Sleep_Walker' Cech | e6c3f4b | 2009-05-18 15:24:14 +0200 | [diff] [blame] | 328 | |
| 329 | /****************************************************************************** |
| 330 | * Vibra and LEDs |
| 331 | ******************************************************************************/ |
Tomáš Čech | bb2ae8f | 2009-09-11 13:57:01 +0200 | [diff] [blame] | 332 | #ifdef CONFIG_MACH_TREO680 |
| 333 | static struct gpio_led treo680_gpio_leds[] = { |
Tomas 'Sleep_Walker' Cech | e6c3f4b | 2009-05-18 15:24:14 +0200 | [diff] [blame] | 334 | { |
| 335 | .name = "treo680:vibra:vibra", |
| 336 | .default_trigger = "none", |
| 337 | .gpio = GPIO_NR_TREO680_VIBRATE_EN, |
| 338 | }, |
| 339 | { |
| 340 | .name = "treo680:green:led", |
| 341 | .default_trigger = "mmc0", |
Tomáš Čech | bb2ae8f | 2009-09-11 13:57:01 +0200 | [diff] [blame] | 342 | .gpio = GPIO_NR_TREO_GREEN_LED, |
Tomas 'Sleep_Walker' Cech | e6c3f4b | 2009-05-18 15:24:14 +0200 | [diff] [blame] | 343 | }, |
| 344 | { |
Tomáš Čech | bb2ae8f | 2009-09-11 13:57:01 +0200 | [diff] [blame] | 345 | .name = "treo680:white:keybbl", |
Tomas 'Sleep_Walker' Cech | e6c3f4b | 2009-05-18 15:24:14 +0200 | [diff] [blame] | 346 | .default_trigger = "none", |
| 347 | .gpio = GPIO_NR_TREO680_KEYB_BL, |
| 348 | }, |
| 349 | }; |
| 350 | |
Tomáš Čech | bb2ae8f | 2009-09-11 13:57:01 +0200 | [diff] [blame] | 351 | static struct gpio_led_platform_data treo680_gpio_led_info = { |
| 352 | .leds = treo680_gpio_leds, |
| 353 | .num_leds = ARRAY_SIZE(treo680_gpio_leds), |
Tomas 'Sleep_Walker' Cech | e6c3f4b | 2009-05-18 15:24:14 +0200 | [diff] [blame] | 354 | }; |
| 355 | |
Tomáš Čech | d0a92fd | 2009-09-11 13:57:02 +0200 | [diff] [blame] | 356 | static struct gpio_led centro_gpio_leds[] = { |
| 357 | { |
| 358 | .name = "centro:vibra:vibra", |
| 359 | .default_trigger = "none", |
| 360 | .gpio = GPIO_NR_CENTRO_VIBRATE_EN, |
| 361 | }, |
| 362 | { |
| 363 | .name = "centro:green:led", |
| 364 | .default_trigger = "mmc0", |
| 365 | .gpio = GPIO_NR_TREO_GREEN_LED, |
| 366 | }, |
| 367 | { |
| 368 | .name = "centro:white:keybbl", |
| 369 | .default_trigger = "none", |
| 370 | .active_low = 1, |
| 371 | .gpio = GPIO_NR_CENTRO_KEYB_BL, |
| 372 | }, |
| 373 | }; |
| 374 | |
| 375 | static struct gpio_led_platform_data centro_gpio_led_info = { |
| 376 | .leds = centro_gpio_leds, |
| 377 | .num_leds = ARRAY_SIZE(centro_gpio_leds), |
| 378 | }; |
| 379 | |
Marek Vasut | 31620e2 | 2010-07-13 08:16:45 +0200 | [diff] [blame] | 380 | static struct platform_device palmtreo_leds = { |
Tomáš Čech | d0a92fd | 2009-09-11 13:57:02 +0200 | [diff] [blame] | 381 | .name = "leds-gpio", |
| 382 | .id = -1, |
| 383 | .dev = { |
Marek Vasut | 31620e2 | 2010-07-13 08:16:45 +0200 | [diff] [blame] | 384 | .platform_data = &treo680_gpio_led_info, |
Tomáš Čech | d0a92fd | 2009-09-11 13:57:02 +0200 | [diff] [blame] | 385 | } |
| 386 | }; |
Tomáš Čech | d0a92fd | 2009-09-11 13:57:02 +0200 | [diff] [blame] | 387 | |
Marek Vasut | 31620e2 | 2010-07-13 08:16:45 +0200 | [diff] [blame] | 388 | static void __init palmtreo_leds_init(void) |
Tomas 'Sleep_Walker' Cech | e6c3f4b | 2009-05-18 15:24:14 +0200 | [diff] [blame] | 389 | { |
Marek Vasut | 31620e2 | 2010-07-13 08:16:45 +0200 | [diff] [blame] | 390 | if (machine_is_centro()) |
| 391 | palmtreo_leds.dev.platform_data = ¢ro_gpio_led_info; |
Tomas 'Sleep_Walker' Cech | e6c3f4b | 2009-05-18 15:24:14 +0200 | [diff] [blame] | 392 | |
Marek Vasut | 31620e2 | 2010-07-13 08:16:45 +0200 | [diff] [blame] | 393 | platform_device_register(&palmtreo_leds); |
Tomáš Čech | 28d7a94 | 2009-09-03 16:55:47 +0200 | [diff] [blame] | 394 | } |
Marek Vasut | 31620e2 | 2010-07-13 08:16:45 +0200 | [diff] [blame] | 395 | #else |
| 396 | static inline void palmtreo_leds_init(void) {} |
| 397 | #endif |
Tomas 'Sleep_Walker' Cech | e6c3f4b | 2009-05-18 15:24:14 +0200 | [diff] [blame] | 398 | |
| 399 | /****************************************************************************** |
| 400 | * Machine init |
| 401 | ******************************************************************************/ |
Russell King | 98c672c | 2010-05-22 18:18:57 +0100 | [diff] [blame] | 402 | static void __init treo_reserve(void) |
| 403 | { |
Russell King | 8d717a5 | 2010-05-22 19:47:18 +0100 | [diff] [blame] | 404 | memblock_reserve(0xa0000000, 0x1000); |
| 405 | memblock_reserve(0xa2000000, 0x1000); |
Russell King | 98c672c | 2010-05-22 18:18:57 +0100 | [diff] [blame] | 406 | } |
| 407 | |
Marek Vasut | 31620e2 | 2010-07-13 08:16:45 +0200 | [diff] [blame] | 408 | static void __init palmphone_common_init(void) |
Tomáš Čech | bb2ae8f | 2009-09-11 13:57:01 +0200 | [diff] [blame] | 409 | { |
Marek Vasut | 31620e2 | 2010-07-13 08:16:45 +0200 | [diff] [blame] | 410 | pxa2xx_mfp_config(ARRAY_AND_SIZE(treo_pin_config)); |
Russell King | cc155c6 | 2009-11-09 13:34:08 +0800 | [diff] [blame] | 411 | pxa_set_ffuart_info(NULL); |
| 412 | pxa_set_btuart_info(NULL); |
| 413 | pxa_set_stuart_info(NULL); |
Marek Vasut | 31620e2 | 2010-07-13 08:16:45 +0200 | [diff] [blame] | 414 | palm27x_pm_init(TREO_STR_BASE); |
| 415 | palm27x_lcd_init(GPIO_NR_TREO_BL_POWER, &palm_320x320_new_lcd_mode); |
| 416 | palm27x_udc_init(GPIO_NR_TREO_USB_DETECT, GPIO_NR_TREO_USB_PULLUP, 1); |
| 417 | palm27x_irda_init(GPIO_NR_TREO_IR_EN); |
| 418 | palm27x_ac97_init(-1, -1, -1, 95); |
| 419 | palm27x_pwm_init(GPIO_NR_TREO_BL_POWER, -1); |
| 420 | palm27x_power_init(GPIO_NR_TREO_POWER_DETECT, -1); |
| 421 | palm27x_pmic_init(); |
| 422 | palmtreo_kpc_init(); |
| 423 | palmtreo_uhc_init(); |
| 424 | palmtreo_leds_init(); |
Tomáš Čech | bb2ae8f | 2009-09-11 13:57:01 +0200 | [diff] [blame] | 425 | } |
| 426 | |
Tomas 'Sleep_Walker' Cech | e6c3f4b | 2009-05-18 15:24:14 +0200 | [diff] [blame] | 427 | static void __init treo680_init(void) |
| 428 | { |
Tomas 'Sleep_Walker' Cech | e6c3f4b | 2009-05-18 15:24:14 +0200 | [diff] [blame] | 429 | pxa2xx_mfp_config(ARRAY_AND_SIZE(treo680_pin_config)); |
Marek Vasut | 31620e2 | 2010-07-13 08:16:45 +0200 | [diff] [blame] | 430 | palmphone_common_init(); |
| 431 | palm27x_mmc_init(GPIO_NR_TREO_SD_DETECT_N, GPIO_NR_TREO680_SD_READONLY, |
| 432 | GPIO_NR_TREO680_SD_POWER, 0); |
| 433 | } |
Tomas 'Sleep_Walker' Cech | e6c3f4b | 2009-05-18 15:24:14 +0200 | [diff] [blame] | 434 | |
Marek Vasut | 31620e2 | 2010-07-13 08:16:45 +0200 | [diff] [blame] | 435 | static void __init centro_init(void) |
| 436 | { |
| 437 | pxa2xx_mfp_config(ARRAY_AND_SIZE(centro685_pin_config)); |
| 438 | palmphone_common_init(); |
| 439 | palm27x_mmc_init(GPIO_NR_TREO_SD_DETECT_N, -1, |
| 440 | GPIO_NR_CENTRO_SD_POWER, 1); |
Tomas 'Sleep_Walker' Cech | e6c3f4b | 2009-05-18 15:24:14 +0200 | [diff] [blame] | 441 | } |
| 442 | |
| 443 | MACHINE_START(TREO680, "Palm Treo 680") |
Tomáš Čech | bb2ae8f | 2009-09-11 13:57:01 +0200 | [diff] [blame] | 444 | .boot_params = 0xa0000100, |
| 445 | .map_io = pxa_map_io, |
Russell King | 98c672c | 2010-05-22 18:18:57 +0100 | [diff] [blame] | 446 | .reserve = treo_reserve, |
Tomáš Čech | bb2ae8f | 2009-09-11 13:57:01 +0200 | [diff] [blame] | 447 | .init_irq = pxa27x_init_irq, |
| 448 | .timer = &pxa_timer, |
| 449 | .init_machine = treo680_init, |
Tomas 'Sleep_Walker' Cech | e6c3f4b | 2009-05-18 15:24:14 +0200 | [diff] [blame] | 450 | MACHINE_END |
Tomáš Čech | d0a92fd | 2009-09-11 13:57:02 +0200 | [diff] [blame] | 451 | |
| 452 | MACHINE_START(CENTRO, "Palm Centro 685") |
Tomáš Čech | d0a92fd | 2009-09-11 13:57:02 +0200 | [diff] [blame] | 453 | .boot_params = 0xa0000100, |
| 454 | .map_io = pxa_map_io, |
Russell King | 98c672c | 2010-05-22 18:18:57 +0100 | [diff] [blame] | 455 | .reserve = treo_reserve, |
Tomáš Čech | d0a92fd | 2009-09-11 13:57:02 +0200 | [diff] [blame] | 456 | .init_irq = pxa27x_init_irq, |
| 457 | .timer = &pxa_timer, |
Russell King | f165eb7 | 2010-08-06 18:10:25 +0100 | [diff] [blame] | 458 | .init_machine = centro_init, |
Tomáš Čech | d0a92fd | 2009-09-11 13:57:02 +0200 | [diff] [blame] | 459 | MACHINE_END |