| 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> | 
|  | 23 | #include <linux/pda_power.h> | 
|  | 24 | #include <linux/pwm_backlight.h> | 
|  | 25 | #include <linux/gpio.h> | 
|  | 26 | #include <linux/wm97xx_batt.h> | 
|  | 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> | 
|  | 42 | #include <mach/pxa27x_keypad.h> | 
|  | 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> | 
|  | 48 |  | 
|  | 49 | #include <sound/pxa2xx-lib.h> | 
|  | 50 |  | 
|  | 51 | #include "generic.h" | 
|  | 52 | #include "devices.h" | 
|  | 53 |  | 
|  | 54 | /****************************************************************************** | 
|  | 55 | * Pin configuration | 
|  | 56 | ******************************************************************************/ | 
| Tomáš Čech | bb2ae8f | 2009-09-11 13:57:01 +0200 | [diff] [blame] | 57 | static unsigned long treo_pin_config[] __initdata = { | 
| Tomas 'Sleep_Walker' Cech | e6c3f4b | 2009-05-18 15:24:14 +0200 | [diff] [blame] | 58 | /* MMC */ | 
|  | 59 | GPIO32_MMC_CLK, | 
|  | 60 | GPIO92_MMC_DAT_0, | 
|  | 61 | GPIO109_MMC_DAT_1, | 
|  | 62 | GPIO110_MMC_DAT_2, | 
|  | 63 | GPIO111_MMC_DAT_3, | 
|  | 64 | GPIO112_MMC_CMD, | 
| Tomas 'Sleep_Walker' Cech | e6c3f4b | 2009-05-18 15:24:14 +0200 | [diff] [blame] | 65 | GPIO113_GPIO,				/* SD detect */ | 
|  | 66 |  | 
|  | 67 | /* AC97 */ | 
|  | 68 | GPIO28_AC97_BITCLK, | 
|  | 69 | GPIO29_AC97_SDATA_IN_0, | 
|  | 70 | GPIO30_AC97_SDATA_OUT, | 
|  | 71 | GPIO31_AC97_SYNC, | 
|  | 72 | GPIO89_AC97_SYSCLK, | 
|  | 73 | GPIO95_AC97_nRESET, | 
|  | 74 |  | 
|  | 75 | /* IrDA */ | 
|  | 76 | GPIO46_FICP_RXD, | 
|  | 77 | GPIO47_FICP_TXD, | 
|  | 78 |  | 
|  | 79 | /* PWM */ | 
|  | 80 | GPIO16_PWM0_OUT, | 
|  | 81 |  | 
|  | 82 | /* USB */ | 
|  | 83 | GPIO1_GPIO | WAKEUP_ON_EDGE_BOTH,	/* usb detect */ | 
|  | 84 |  | 
|  | 85 | /* MATRIX KEYPAD */ | 
| Tomas 'Sleep_Walker' Cech | e6c3f4b | 2009-05-18 15:24:14 +0200 | [diff] [blame] | 86 | GPIO101_KP_MKIN_1, | 
|  | 87 | GPIO102_KP_MKIN_2, | 
|  | 88 | GPIO97_KP_MKIN_3, | 
|  | 89 | GPIO98_KP_MKIN_4, | 
| Tomas 'Sleep_Walker' Cech | e6c3f4b | 2009-05-18 15:24:14 +0200 | [diff] [blame] | 90 | GPIO91_KP_MKIN_6, | 
|  | 91 | GPIO13_KP_MKIN_7, | 
|  | 92 | GPIO103_KP_MKOUT_0 | MFP_LPM_DRIVE_HIGH, | 
|  | 93 | GPIO104_KP_MKOUT_1, | 
|  | 94 | GPIO105_KP_MKOUT_2, | 
|  | 95 | GPIO106_KP_MKOUT_3, | 
|  | 96 | GPIO107_KP_MKOUT_4, | 
|  | 97 | GPIO108_KP_MKOUT_5, | 
|  | 98 | GPIO96_KP_MKOUT_6, | 
|  | 99 | GPIO93_KP_DKIN_0 | WAKEUP_ON_LEVEL_HIGH,	/* Hotsync button */ | 
|  | 100 |  | 
|  | 101 | /* LCD */ | 
| Eric Miao | bedbda9 | 2010-01-04 11:37:14 +0800 | [diff] [blame] | 102 | GPIOxx_LCD_TFT_16BPP, | 
| Tomas 'Sleep_Walker' Cech | e6c3f4b | 2009-05-18 15:24:14 +0200 | [diff] [blame] | 103 |  | 
|  | 104 | /* Quick Capture Interface */ | 
|  | 105 | GPIO84_CIF_FV, | 
|  | 106 | GPIO85_CIF_LV, | 
|  | 107 | GPIO53_CIF_MCLK, | 
|  | 108 | GPIO54_CIF_PCLK, | 
|  | 109 | GPIO81_CIF_DD_0, | 
|  | 110 | GPIO55_CIF_DD_1, | 
|  | 111 | GPIO51_CIF_DD_2, | 
|  | 112 | GPIO50_CIF_DD_3, | 
|  | 113 | GPIO52_CIF_DD_4, | 
|  | 114 | GPIO48_CIF_DD_5, | 
|  | 115 | GPIO17_CIF_DD_6, | 
|  | 116 | GPIO12_CIF_DD_7, | 
|  | 117 |  | 
|  | 118 | /* I2C */ | 
|  | 119 | GPIO117_I2C_SCL, | 
|  | 120 | GPIO118_I2C_SDA, | 
|  | 121 |  | 
|  | 122 | /* GSM */ | 
|  | 123 | GPIO14_GPIO | WAKEUP_ON_EDGE_BOTH,	/* GSM host wake up */ | 
|  | 124 | GPIO34_FFUART_RXD, | 
|  | 125 | GPIO35_FFUART_CTS, | 
|  | 126 | GPIO39_FFUART_TXD, | 
|  | 127 | GPIO41_FFUART_RTS, | 
|  | 128 |  | 
|  | 129 | /* MISC. */ | 
|  | 130 | GPIO0_GPIO | WAKEUP_ON_EDGE_BOTH,	/* external power detect */ | 
|  | 131 | GPIO15_GPIO | WAKEUP_ON_EDGE_BOTH,	/* silent switch */ | 
|  | 132 | GPIO116_GPIO,				/* headphone detect */ | 
|  | 133 | GPIO11_GPIO | WAKEUP_ON_EDGE_BOTH,	/* bluetooth host wake up */ | 
|  | 134 | }; | 
|  | 135 |  | 
| Tomáš Čech | bb2ae8f | 2009-09-11 13:57:01 +0200 | [diff] [blame] | 136 | #ifdef CONFIG_MACH_TREO680 | 
|  | 137 | static unsigned long treo680_pin_config[] __initdata = { | 
|  | 138 | GPIO33_GPIO,    /* SD read only */ | 
|  | 139 |  | 
|  | 140 | /* MATRIX KEYPAD - different wake up source */ | 
|  | 141 | GPIO100_KP_MKIN_0 | WAKEUP_ON_LEVEL_HIGH, | 
|  | 142 | GPIO99_KP_MKIN_5, | 
|  | 143 | }; | 
|  | 144 | #endif /* CONFIG_MACH_TREO680 */ | 
|  | 145 |  | 
| Tomáš Čech | d0a92fd | 2009-09-11 13:57:02 +0200 | [diff] [blame] | 146 | #ifdef CONFIG_MACH_CENTRO | 
|  | 147 | static unsigned long centro685_pin_config[] __initdata = { | 
|  | 148 | /* Bluetooth attached to BT UART*/ | 
|  | 149 | MFP_CFG_OUT(GPIO80, AF0, DRIVE_LOW),    /* power: LOW = off */ | 
|  | 150 | GPIO42_BTUART_RXD, | 
|  | 151 | GPIO43_BTUART_TXD, | 
|  | 152 | GPIO44_BTUART_CTS, | 
|  | 153 | GPIO45_BTUART_RTS, | 
|  | 154 |  | 
|  | 155 | /* MATRIX KEYPAD - different wake up source */ | 
|  | 156 | GPIO100_KP_MKIN_0, | 
|  | 157 | GPIO99_KP_MKIN_5 | WAKEUP_ON_LEVEL_HIGH, | 
|  | 158 | }; | 
|  | 159 | #endif /* CONFIG_MACH_CENTRO */ | 
|  | 160 |  | 
| Tomas 'Sleep_Walker' Cech | e6c3f4b | 2009-05-18 15:24:14 +0200 | [diff] [blame] | 161 | /****************************************************************************** | 
|  | 162 | * SD/MMC card controller | 
|  | 163 | ******************************************************************************/ | 
| Tomáš Čech | bb2ae8f | 2009-09-11 13:57:01 +0200 | [diff] [blame] | 164 | #ifdef CONFIG_MACH_TREO680 | 
| Tomas 'Sleep_Walker' Cech | e6c3f4b | 2009-05-18 15:24:14 +0200 | [diff] [blame] | 165 | static struct pxamci_platform_data treo680_mci_platform_data = { | 
| walker@suse.cz | 7dafdf3 | 2009-08-31 19:25:57 +0200 | [diff] [blame] | 166 | .ocr_mask		= MMC_VDD_32_33 | MMC_VDD_33_34, | 
| Tomáš Čech | bb2ae8f | 2009-09-11 13:57:01 +0200 | [diff] [blame] | 167 | .gpio_card_detect	= GPIO_NR_TREO_SD_DETECT_N, | 
| walker@suse.cz | 7dafdf3 | 2009-08-31 19:25:57 +0200 | [diff] [blame] | 168 | .gpio_card_ro		= GPIO_NR_TREO680_SD_READONLY, | 
|  | 169 | .gpio_power		= GPIO_NR_TREO680_SD_POWER, | 
| Tomas 'Sleep_Walker' Cech | e6c3f4b | 2009-05-18 15:24:14 +0200 | [diff] [blame] | 170 | }; | 
| Tomáš Čech | bb2ae8f | 2009-09-11 13:57:01 +0200 | [diff] [blame] | 171 | #endif /* CONFIG_MACH_TREO680 */ | 
| Tomas 'Sleep_Walker' Cech | e6c3f4b | 2009-05-18 15:24:14 +0200 | [diff] [blame] | 172 |  | 
| Tomáš Čech | d0a92fd | 2009-09-11 13:57:02 +0200 | [diff] [blame] | 173 | #ifdef CONFIG_MACH_CENTRO | 
|  | 174 | static struct pxamci_platform_data centro_mci_platform_data = { | 
|  | 175 | .ocr_mask		= MMC_VDD_32_33 | MMC_VDD_33_34, | 
|  | 176 | .gpio_card_detect	= GPIO_NR_TREO_SD_DETECT_N, | 
|  | 177 | .gpio_card_ro		= -1, | 
|  | 178 | .gpio_power		= GPIO_NR_CENTRO_SD_POWER, | 
|  | 179 | .gpio_power_invert	= 1, | 
|  | 180 | }; | 
|  | 181 | #endif /* CONFIG_MACH_CENTRO */ | 
|  | 182 |  | 
| Tomas 'Sleep_Walker' Cech | e6c3f4b | 2009-05-18 15:24:14 +0200 | [diff] [blame] | 183 | /****************************************************************************** | 
|  | 184 | * GPIO keyboard | 
|  | 185 | ******************************************************************************/ | 
| Tomáš Čech | bb2ae8f | 2009-09-11 13:57:01 +0200 | [diff] [blame] | 186 | #ifdef CONFIG_MACH_TREO680 | 
| Tomas 'Sleep_Walker' Cech | e6c3f4b | 2009-05-18 15:24:14 +0200 | [diff] [blame] | 187 | static unsigned int treo680_matrix_keys[] = { | 
|  | 188 | KEY(0, 0, KEY_F8),		/* Red/Off/Power */ | 
|  | 189 | KEY(0, 1, KEY_LEFT), | 
|  | 190 | KEY(0, 2, KEY_LEFTCTRL),	/* Alternate */ | 
|  | 191 | KEY(0, 3, KEY_L), | 
|  | 192 | KEY(0, 4, KEY_A), | 
|  | 193 | KEY(0, 5, KEY_Q), | 
|  | 194 | KEY(0, 6, KEY_P), | 
|  | 195 |  | 
|  | 196 | KEY(1, 0, KEY_RIGHTCTRL),	/* Menu */ | 
|  | 197 | KEY(1, 1, KEY_RIGHT), | 
|  | 198 | KEY(1, 2, KEY_LEFTSHIFT),	/* Left shift */ | 
|  | 199 | KEY(1, 3, KEY_Z), | 
|  | 200 | KEY(1, 4, KEY_S), | 
|  | 201 | KEY(1, 5, KEY_W), | 
|  | 202 |  | 
|  | 203 | KEY(2, 0, KEY_F1),		/* Phone */ | 
|  | 204 | KEY(2, 1, KEY_UP), | 
|  | 205 | KEY(2, 2, KEY_0), | 
|  | 206 | KEY(2, 3, KEY_X), | 
|  | 207 | KEY(2, 4, KEY_D), | 
|  | 208 | KEY(2, 5, KEY_E), | 
|  | 209 |  | 
|  | 210 | KEY(3, 0, KEY_F10),		/* Calendar */ | 
|  | 211 | KEY(3, 1, KEY_DOWN), | 
|  | 212 | KEY(3, 2, KEY_SPACE), | 
|  | 213 | KEY(3, 3, KEY_C), | 
|  | 214 | KEY(3, 4, KEY_F), | 
|  | 215 | KEY(3, 5, KEY_R), | 
|  | 216 |  | 
|  | 217 | KEY(4, 0, KEY_F12),		/* Mail */ | 
|  | 218 | KEY(4, 1, KEY_KPENTER), | 
|  | 219 | KEY(4, 2, KEY_RIGHTALT),	/* Alt */ | 
|  | 220 | KEY(4, 3, KEY_V), | 
|  | 221 | KEY(4, 4, KEY_G), | 
|  | 222 | KEY(4, 5, KEY_T), | 
|  | 223 |  | 
|  | 224 | KEY(5, 0, KEY_F9),		/* Home */ | 
|  | 225 | KEY(5, 1, KEY_PAGEUP),		/* Side up */ | 
|  | 226 | KEY(5, 2, KEY_DOT), | 
|  | 227 | KEY(5, 3, KEY_B), | 
|  | 228 | KEY(5, 4, KEY_H), | 
|  | 229 | KEY(5, 5, KEY_Y), | 
|  | 230 |  | 
|  | 231 | KEY(6, 0, KEY_TAB),		/* Side Activate */ | 
|  | 232 | KEY(6, 1, KEY_PAGEDOWN),	/* Side down */ | 
|  | 233 | KEY(6, 2, KEY_ENTER), | 
|  | 234 | KEY(6, 3, KEY_N), | 
|  | 235 | KEY(6, 4, KEY_J), | 
|  | 236 | KEY(6, 5, KEY_U), | 
|  | 237 |  | 
|  | 238 | KEY(7, 0, KEY_F6),		/* Green/Call */ | 
|  | 239 | KEY(7, 1, KEY_O), | 
|  | 240 | KEY(7, 2, KEY_BACKSPACE), | 
|  | 241 | KEY(7, 3, KEY_M), | 
|  | 242 | KEY(7, 4, KEY_K), | 
|  | 243 | KEY(7, 5, KEY_I), | 
|  | 244 | }; | 
|  | 245 |  | 
|  | 246 | static struct pxa27x_keypad_platform_data treo680_keypad_platform_data = { | 
|  | 247 | .matrix_key_rows	= 8, | 
|  | 248 | .matrix_key_cols	= 7, | 
|  | 249 | .matrix_key_map		= treo680_matrix_keys, | 
|  | 250 | .matrix_key_map_size	= ARRAY_SIZE(treo680_matrix_keys), | 
|  | 251 | .direct_key_map		= { KEY_CONNECT }, | 
|  | 252 | .direct_key_num		= 1, | 
|  | 253 |  | 
|  | 254 | .debounce_interval	= 30, | 
|  | 255 | }; | 
| Tomáš Čech | bb2ae8f | 2009-09-11 13:57:01 +0200 | [diff] [blame] | 256 | #endif /* CONFIG_MACH_TREO680 */ | 
| Tomas 'Sleep_Walker' Cech | e6c3f4b | 2009-05-18 15:24:14 +0200 | [diff] [blame] | 257 |  | 
| Tomáš Čech | d0a92fd | 2009-09-11 13:57:02 +0200 | [diff] [blame] | 258 | #ifdef CONFIG_MACH_CENTRO | 
|  | 259 | static unsigned int centro_matrix_keys[] = { | 
|  | 260 | KEY(0, 0, KEY_F9),		/* Home */ | 
|  | 261 | KEY(0, 1, KEY_LEFT), | 
|  | 262 | KEY(0, 2, KEY_LEFTCTRL),	/* Alternate */ | 
|  | 263 | KEY(0, 3, KEY_L), | 
|  | 264 | KEY(0, 4, KEY_A), | 
|  | 265 | KEY(0, 5, KEY_Q), | 
|  | 266 | KEY(0, 6, KEY_P), | 
|  | 267 |  | 
|  | 268 | KEY(1, 0, KEY_RIGHTCTRL),	/* Menu */ | 
|  | 269 | KEY(1, 1, KEY_RIGHT), | 
|  | 270 | KEY(1, 2, KEY_LEFTSHIFT),	/* Left shift */ | 
|  | 271 | KEY(1, 3, KEY_Z), | 
|  | 272 | KEY(1, 4, KEY_S), | 
|  | 273 | KEY(1, 5, KEY_W), | 
|  | 274 |  | 
|  | 275 | KEY(2, 0, KEY_F1),		/* Phone */ | 
|  | 276 | KEY(2, 1, KEY_UP), | 
|  | 277 | KEY(2, 2, KEY_0), | 
|  | 278 | KEY(2, 3, KEY_X), | 
|  | 279 | KEY(2, 4, KEY_D), | 
|  | 280 | KEY(2, 5, KEY_E), | 
|  | 281 |  | 
|  | 282 | KEY(3, 0, KEY_F10),		/* Calendar */ | 
|  | 283 | KEY(3, 1, KEY_DOWN), | 
|  | 284 | KEY(3, 2, KEY_SPACE), | 
|  | 285 | KEY(3, 3, KEY_C), | 
|  | 286 | KEY(3, 4, KEY_F), | 
|  | 287 | KEY(3, 5, KEY_R), | 
|  | 288 |  | 
|  | 289 | KEY(4, 0, KEY_F12),		/* Mail */ | 
|  | 290 | KEY(4, 1, KEY_KPENTER), | 
|  | 291 | KEY(4, 2, KEY_RIGHTALT),	/* Alt */ | 
|  | 292 | KEY(4, 3, KEY_V), | 
|  | 293 | KEY(4, 4, KEY_G), | 
|  | 294 | KEY(4, 5, KEY_T), | 
|  | 295 |  | 
|  | 296 | KEY(5, 0, KEY_F8),		/* Red/Off/Power */ | 
|  | 297 | KEY(5, 1, KEY_PAGEUP),		/* Side up */ | 
|  | 298 | KEY(5, 2, KEY_DOT), | 
|  | 299 | KEY(5, 3, KEY_B), | 
|  | 300 | KEY(5, 4, KEY_H), | 
|  | 301 | KEY(5, 5, KEY_Y), | 
|  | 302 |  | 
|  | 303 | KEY(6, 0, KEY_TAB),		/* Side Activate */ | 
|  | 304 | KEY(6, 1, KEY_PAGEDOWN),	/* Side down */ | 
|  | 305 | KEY(6, 2, KEY_ENTER), | 
|  | 306 | KEY(6, 3, KEY_N), | 
|  | 307 | KEY(6, 4, KEY_J), | 
|  | 308 | KEY(6, 5, KEY_U), | 
|  | 309 |  | 
|  | 310 | KEY(7, 0, KEY_F6),		/* Green/Call */ | 
|  | 311 | KEY(7, 1, KEY_O), | 
|  | 312 | KEY(7, 2, KEY_BACKSPACE), | 
|  | 313 | KEY(7, 3, KEY_M), | 
|  | 314 | KEY(7, 4, KEY_K), | 
|  | 315 | KEY(7, 5, KEY_I), | 
|  | 316 | }; | 
|  | 317 |  | 
|  | 318 | static struct pxa27x_keypad_platform_data centro_keypad_platform_data = { | 
|  | 319 | .matrix_key_rows	= 8, | 
|  | 320 | .matrix_key_cols	= 7, | 
|  | 321 | .matrix_key_map		= centro_matrix_keys, | 
|  | 322 | .matrix_key_map_size	= ARRAY_SIZE(centro_matrix_keys), | 
|  | 323 | .direct_key_map		= { KEY_CONNECT }, | 
|  | 324 | .direct_key_num		= 1, | 
|  | 325 |  | 
|  | 326 | .debounce_interval	= 30, | 
|  | 327 | }; | 
|  | 328 | #endif /* CONFIG_MACH_CENTRO */ | 
|  | 329 |  | 
| Tomas 'Sleep_Walker' Cech | e6c3f4b | 2009-05-18 15:24:14 +0200 | [diff] [blame] | 330 | /****************************************************************************** | 
|  | 331 | * aSoC audio | 
|  | 332 | ******************************************************************************/ | 
|  | 333 |  | 
| Tomáš Čech | bb2ae8f | 2009-09-11 13:57:01 +0200 | [diff] [blame] | 334 | static pxa2xx_audio_ops_t treo_ac97_pdata = { | 
| Tomas 'Sleep_Walker' Cech | e6c3f4b | 2009-05-18 15:24:14 +0200 | [diff] [blame] | 335 | .reset_gpio	= 95, | 
|  | 336 | }; | 
|  | 337 |  | 
|  | 338 | /****************************************************************************** | 
|  | 339 | * Backlight | 
|  | 340 | ******************************************************************************/ | 
| Tomáš Čech | bb2ae8f | 2009-09-11 13:57:01 +0200 | [diff] [blame] | 341 | static int treo_backlight_init(struct device *dev) | 
| Tomas 'Sleep_Walker' Cech | e6c3f4b | 2009-05-18 15:24:14 +0200 | [diff] [blame] | 342 | { | 
|  | 343 | int ret; | 
|  | 344 |  | 
| Tomáš Čech | bb2ae8f | 2009-09-11 13:57:01 +0200 | [diff] [blame] | 345 | ret = gpio_request(GPIO_NR_TREO_BL_POWER, "BL POWER"); | 
| Tomas 'Sleep_Walker' Cech | e6c3f4b | 2009-05-18 15:24:14 +0200 | [diff] [blame] | 346 | if (ret) | 
|  | 347 | goto err; | 
| Tomáš Čech | bb2ae8f | 2009-09-11 13:57:01 +0200 | [diff] [blame] | 348 | ret = gpio_direction_output(GPIO_NR_TREO_BL_POWER, 0); | 
| Tomas 'Sleep_Walker' Cech | e6c3f4b | 2009-05-18 15:24:14 +0200 | [diff] [blame] | 349 | if (ret) | 
|  | 350 | goto err2; | 
| Tomas 'Sleep_Walker' Cech | e6c3f4b | 2009-05-18 15:24:14 +0200 | [diff] [blame] | 351 |  | 
|  | 352 | return 0; | 
| Tomáš Čech | 28d7a94 | 2009-09-03 16:55:47 +0200 | [diff] [blame] | 353 |  | 
| Tomas 'Sleep_Walker' Cech | e6c3f4b | 2009-05-18 15:24:14 +0200 | [diff] [blame] | 354 | err2: | 
| Tomáš Čech | bb2ae8f | 2009-09-11 13:57:01 +0200 | [diff] [blame] | 355 | gpio_free(GPIO_NR_TREO_BL_POWER); | 
| Tomas 'Sleep_Walker' Cech | e6c3f4b | 2009-05-18 15:24:14 +0200 | [diff] [blame] | 356 | err: | 
|  | 357 | return ret; | 
|  | 358 | } | 
|  | 359 |  | 
| Eric Miao | 2d51a52 | 2010-01-04 11:42:01 +0800 | [diff] [blame] | 360 | static int treo_backlight_notify(struct device *dev, int brightness) | 
| Tomas 'Sleep_Walker' Cech | e6c3f4b | 2009-05-18 15:24:14 +0200 | [diff] [blame] | 361 | { | 
| Tomáš Čech | bb2ae8f | 2009-09-11 13:57:01 +0200 | [diff] [blame] | 362 | gpio_set_value(GPIO_NR_TREO_BL_POWER, brightness); | 
|  | 363 | return TREO_MAX_INTENSITY - brightness; | 
| Tomas 'Sleep_Walker' Cech | e6c3f4b | 2009-05-18 15:24:14 +0200 | [diff] [blame] | 364 | }; | 
|  | 365 |  | 
| Tomáš Čech | bb2ae8f | 2009-09-11 13:57:01 +0200 | [diff] [blame] | 366 | static void treo_backlight_exit(struct device *dev) | 
| Tomas 'Sleep_Walker' Cech | e6c3f4b | 2009-05-18 15:24:14 +0200 | [diff] [blame] | 367 | { | 
| Tomáš Čech | bb2ae8f | 2009-09-11 13:57:01 +0200 | [diff] [blame] | 368 | gpio_free(GPIO_NR_TREO_BL_POWER); | 
| Tomas 'Sleep_Walker' Cech | e6c3f4b | 2009-05-18 15:24:14 +0200 | [diff] [blame] | 369 | } | 
|  | 370 |  | 
| Tomáš Čech | bb2ae8f | 2009-09-11 13:57:01 +0200 | [diff] [blame] | 371 | static struct platform_pwm_backlight_data treo_backlight_data = { | 
| Tomas 'Sleep_Walker' Cech | e6c3f4b | 2009-05-18 15:24:14 +0200 | [diff] [blame] | 372 | .pwm_id		= 0, | 
| Tomáš Čech | bb2ae8f | 2009-09-11 13:57:01 +0200 | [diff] [blame] | 373 | .max_brightness	= TREO_MAX_INTENSITY, | 
|  | 374 | .dft_brightness	= TREO_DEFAULT_INTENSITY, | 
|  | 375 | .pwm_period_ns	= TREO_PERIOD_NS, | 
|  | 376 | .init		= treo_backlight_init, | 
|  | 377 | .notify		= treo_backlight_notify, | 
|  | 378 | .exit		= treo_backlight_exit, | 
| Tomas 'Sleep_Walker' Cech | e6c3f4b | 2009-05-18 15:24:14 +0200 | [diff] [blame] | 379 | }; | 
|  | 380 |  | 
| Tomáš Čech | bb2ae8f | 2009-09-11 13:57:01 +0200 | [diff] [blame] | 381 | static struct platform_device treo_backlight = { | 
| Tomas 'Sleep_Walker' Cech | e6c3f4b | 2009-05-18 15:24:14 +0200 | [diff] [blame] | 382 | .name	= "pwm-backlight", | 
|  | 383 | .dev	= { | 
|  | 384 | .parent		= &pxa27x_device_pwm0.dev, | 
| Tomáš Čech | bb2ae8f | 2009-09-11 13:57:01 +0200 | [diff] [blame] | 385 | .platform_data	= &treo_backlight_data, | 
| Tomas 'Sleep_Walker' Cech | e6c3f4b | 2009-05-18 15:24:14 +0200 | [diff] [blame] | 386 | }, | 
|  | 387 | }; | 
|  | 388 |  | 
|  | 389 | /****************************************************************************** | 
|  | 390 | * IrDA | 
|  | 391 | ******************************************************************************/ | 
| Tomáš Čech | bb2ae8f | 2009-09-11 13:57:01 +0200 | [diff] [blame] | 392 | static struct pxaficp_platform_data treo_ficp_info = { | 
|  | 393 | .gpio_pwdown		= GPIO_NR_TREO_IR_EN, | 
| Marek Vasut | c4bd017 | 2009-07-17 12:50:43 +0200 | [diff] [blame] | 394 | .transceiver_cap	= IR_SIRMODE | IR_OFF, | 
| Tomas 'Sleep_Walker' Cech | e6c3f4b | 2009-05-18 15:24:14 +0200 | [diff] [blame] | 395 | }; | 
|  | 396 |  | 
|  | 397 | /****************************************************************************** | 
|  | 398 | * UDC | 
|  | 399 | ******************************************************************************/ | 
| Tomáš Čech | bb2ae8f | 2009-09-11 13:57:01 +0200 | [diff] [blame] | 400 | static struct pxa2xx_udc_mach_info treo_udc_info __initdata = { | 
|  | 401 | .gpio_vbus		= GPIO_NR_TREO_USB_DETECT, | 
| Tomas 'Sleep_Walker' Cech | e6c3f4b | 2009-05-18 15:24:14 +0200 | [diff] [blame] | 402 | .gpio_vbus_inverted	= 1, | 
| Tomáš Čech | bb2ae8f | 2009-09-11 13:57:01 +0200 | [diff] [blame] | 403 | .gpio_pullup		= GPIO_NR_TREO_USB_PULLUP, | 
| Tomas 'Sleep_Walker' Cech | e6c3f4b | 2009-05-18 15:24:14 +0200 | [diff] [blame] | 404 | }; | 
|  | 405 |  | 
|  | 406 |  | 
|  | 407 | /****************************************************************************** | 
|  | 408 | * USB host | 
|  | 409 | ******************************************************************************/ | 
| Tomáš Čech | bb2ae8f | 2009-09-11 13:57:01 +0200 | [diff] [blame] | 410 | #ifdef CONFIG_MACH_TREO680 | 
| Tomas 'Sleep_Walker' Cech | e6c3f4b | 2009-05-18 15:24:14 +0200 | [diff] [blame] | 411 | static struct pxaohci_platform_data treo680_ohci_info = { | 
|  | 412 | .port_mode    = PMM_PERPORT_MODE, | 
|  | 413 | .flags        = ENABLE_PORT1 | ENABLE_PORT3, | 
|  | 414 | .power_budget = 0, | 
|  | 415 | }; | 
| Tomáš Čech | bb2ae8f | 2009-09-11 13:57:01 +0200 | [diff] [blame] | 416 | #endif /* CONFIG_MACH_TREO680 */ | 
| Tomas 'Sleep_Walker' Cech | e6c3f4b | 2009-05-18 15:24:14 +0200 | [diff] [blame] | 417 |  | 
|  | 418 | /****************************************************************************** | 
|  | 419 | * Power supply | 
|  | 420 | ******************************************************************************/ | 
|  | 421 | static int power_supply_init(struct device *dev) | 
|  | 422 | { | 
|  | 423 | int ret; | 
|  | 424 |  | 
| Tomáš Čech | bb2ae8f | 2009-09-11 13:57:01 +0200 | [diff] [blame] | 425 | ret = gpio_request(GPIO_NR_TREO_POWER_DETECT, "CABLE_STATE_AC"); | 
| Tomas 'Sleep_Walker' Cech | e6c3f4b | 2009-05-18 15:24:14 +0200 | [diff] [blame] | 426 | if (ret) | 
|  | 427 | goto err1; | 
| Tomáš Čech | bb2ae8f | 2009-09-11 13:57:01 +0200 | [diff] [blame] | 428 | ret = gpio_direction_input(GPIO_NR_TREO_POWER_DETECT); | 
| Tomas 'Sleep_Walker' Cech | e6c3f4b | 2009-05-18 15:24:14 +0200 | [diff] [blame] | 429 | if (ret) | 
|  | 430 | goto err2; | 
|  | 431 |  | 
|  | 432 | return 0; | 
|  | 433 |  | 
|  | 434 | err2: | 
| Tomáš Čech | bb2ae8f | 2009-09-11 13:57:01 +0200 | [diff] [blame] | 435 | gpio_free(GPIO_NR_TREO_POWER_DETECT); | 
| Tomas 'Sleep_Walker' Cech | e6c3f4b | 2009-05-18 15:24:14 +0200 | [diff] [blame] | 436 | err1: | 
|  | 437 | return ret; | 
|  | 438 | } | 
|  | 439 |  | 
| Tomáš Čech | bb2ae8f | 2009-09-11 13:57:01 +0200 | [diff] [blame] | 440 | static int treo_is_ac_online(void) | 
| Tomas 'Sleep_Walker' Cech | e6c3f4b | 2009-05-18 15:24:14 +0200 | [diff] [blame] | 441 | { | 
| Tomáš Čech | bb2ae8f | 2009-09-11 13:57:01 +0200 | [diff] [blame] | 442 | return gpio_get_value(GPIO_NR_TREO_POWER_DETECT); | 
| Tomas 'Sleep_Walker' Cech | e6c3f4b | 2009-05-18 15:24:14 +0200 | [diff] [blame] | 443 | } | 
|  | 444 |  | 
|  | 445 | static void power_supply_exit(struct device *dev) | 
|  | 446 | { | 
| Tomáš Čech | bb2ae8f | 2009-09-11 13:57:01 +0200 | [diff] [blame] | 447 | gpio_free(GPIO_NR_TREO_POWER_DETECT); | 
| Tomas 'Sleep_Walker' Cech | e6c3f4b | 2009-05-18 15:24:14 +0200 | [diff] [blame] | 448 | } | 
|  | 449 |  | 
| Tomáš Čech | bb2ae8f | 2009-09-11 13:57:01 +0200 | [diff] [blame] | 450 | static char *treo_supplicants[] = { | 
| Tomas 'Sleep_Walker' Cech | e6c3f4b | 2009-05-18 15:24:14 +0200 | [diff] [blame] | 451 | "main-battery", | 
|  | 452 | }; | 
|  | 453 |  | 
|  | 454 | static struct pda_power_pdata power_supply_info = { | 
|  | 455 | .init		 = power_supply_init, | 
| Tomáš Čech | bb2ae8f | 2009-09-11 13:57:01 +0200 | [diff] [blame] | 456 | .is_ac_online    = treo_is_ac_online, | 
| Tomas 'Sleep_Walker' Cech | e6c3f4b | 2009-05-18 15:24:14 +0200 | [diff] [blame] | 457 | .exit		 = power_supply_exit, | 
| Tomáš Čech | bb2ae8f | 2009-09-11 13:57:01 +0200 | [diff] [blame] | 458 | .supplied_to     = treo_supplicants, | 
|  | 459 | .num_supplicants = ARRAY_SIZE(treo_supplicants), | 
| Tomas 'Sleep_Walker' Cech | e6c3f4b | 2009-05-18 15:24:14 +0200 | [diff] [blame] | 460 | }; | 
|  | 461 |  | 
|  | 462 | static struct platform_device power_supply = { | 
|  | 463 | .name = "pda-power", | 
|  | 464 | .id   = -1, | 
|  | 465 | .dev  = { | 
|  | 466 | .platform_data = &power_supply_info, | 
|  | 467 | }, | 
|  | 468 | }; | 
|  | 469 |  | 
|  | 470 | /****************************************************************************** | 
|  | 471 | * Vibra and LEDs | 
|  | 472 | ******************************************************************************/ | 
| Tomáš Čech | bb2ae8f | 2009-09-11 13:57:01 +0200 | [diff] [blame] | 473 | #ifdef CONFIG_MACH_TREO680 | 
|  | 474 | static struct gpio_led treo680_gpio_leds[] = { | 
| Tomas 'Sleep_Walker' Cech | e6c3f4b | 2009-05-18 15:24:14 +0200 | [diff] [blame] | 475 | { | 
|  | 476 | .name			= "treo680:vibra:vibra", | 
|  | 477 | .default_trigger	= "none", | 
|  | 478 | .gpio			= GPIO_NR_TREO680_VIBRATE_EN, | 
|  | 479 | }, | 
|  | 480 | { | 
|  | 481 | .name			= "treo680:green:led", | 
|  | 482 | .default_trigger	= "mmc0", | 
| Tomáš Čech | bb2ae8f | 2009-09-11 13:57:01 +0200 | [diff] [blame] | 483 | .gpio			= GPIO_NR_TREO_GREEN_LED, | 
| Tomas 'Sleep_Walker' Cech | e6c3f4b | 2009-05-18 15:24:14 +0200 | [diff] [blame] | 484 | }, | 
|  | 485 | { | 
| Tomáš Čech | bb2ae8f | 2009-09-11 13:57:01 +0200 | [diff] [blame] | 486 | .name			= "treo680:white:keybbl", | 
| Tomas 'Sleep_Walker' Cech | e6c3f4b | 2009-05-18 15:24:14 +0200 | [diff] [blame] | 487 | .default_trigger	= "none", | 
|  | 488 | .gpio			= GPIO_NR_TREO680_KEYB_BL, | 
|  | 489 | }, | 
|  | 490 | }; | 
|  | 491 |  | 
| Tomáš Čech | bb2ae8f | 2009-09-11 13:57:01 +0200 | [diff] [blame] | 492 | static struct gpio_led_platform_data treo680_gpio_led_info = { | 
|  | 493 | .leds		= treo680_gpio_leds, | 
|  | 494 | .num_leds	= ARRAY_SIZE(treo680_gpio_leds), | 
| Tomas 'Sleep_Walker' Cech | e6c3f4b | 2009-05-18 15:24:14 +0200 | [diff] [blame] | 495 | }; | 
|  | 496 |  | 
|  | 497 | static struct platform_device treo680_leds = { | 
|  | 498 | .name   = "leds-gpio", | 
|  | 499 | .id     = -1, | 
|  | 500 | .dev    = { | 
| Tomáš Čech | bb2ae8f | 2009-09-11 13:57:01 +0200 | [diff] [blame] | 501 | .platform_data  = &treo680_gpio_led_info, | 
| Tomas 'Sleep_Walker' Cech | e6c3f4b | 2009-05-18 15:24:14 +0200 | [diff] [blame] | 502 | } | 
|  | 503 | }; | 
| Tomáš Čech | bb2ae8f | 2009-09-11 13:57:01 +0200 | [diff] [blame] | 504 | #endif /* CONFIG_MACH_TREO680 */ | 
| Tomas 'Sleep_Walker' Cech | e6c3f4b | 2009-05-18 15:24:14 +0200 | [diff] [blame] | 505 |  | 
| Tomáš Čech | d0a92fd | 2009-09-11 13:57:02 +0200 | [diff] [blame] | 506 | #ifdef CONFIG_MACH_CENTRO | 
|  | 507 | static struct gpio_led centro_gpio_leds[] = { | 
|  | 508 | { | 
|  | 509 | .name			= "centro:vibra:vibra", | 
|  | 510 | .default_trigger	= "none", | 
|  | 511 | .gpio			= GPIO_NR_CENTRO_VIBRATE_EN, | 
|  | 512 | }, | 
|  | 513 | { | 
|  | 514 | .name			= "centro:green:led", | 
|  | 515 | .default_trigger	= "mmc0", | 
|  | 516 | .gpio			= GPIO_NR_TREO_GREEN_LED, | 
|  | 517 | }, | 
|  | 518 | { | 
|  | 519 | .name			= "centro:white:keybbl", | 
|  | 520 | .default_trigger	= "none", | 
|  | 521 | .active_low		= 1, | 
|  | 522 | .gpio			= GPIO_NR_CENTRO_KEYB_BL, | 
|  | 523 | }, | 
|  | 524 | }; | 
|  | 525 |  | 
|  | 526 | static struct gpio_led_platform_data centro_gpio_led_info = { | 
|  | 527 | .leds		= centro_gpio_leds, | 
|  | 528 | .num_leds	= ARRAY_SIZE(centro_gpio_leds), | 
|  | 529 | }; | 
|  | 530 |  | 
|  | 531 | static struct platform_device centro_leds = { | 
|  | 532 | .name   = "leds-gpio", | 
|  | 533 | .id     = -1, | 
|  | 534 | .dev    = { | 
|  | 535 | .platform_data  = ¢ro_gpio_led_info, | 
|  | 536 | } | 
|  | 537 | }; | 
|  | 538 | #endif /* CONFIG_MACH_CENTRO */ | 
|  | 539 |  | 
| Tomas 'Sleep_Walker' Cech | e6c3f4b | 2009-05-18 15:24:14 +0200 | [diff] [blame] | 540 | /****************************************************************************** | 
|  | 541 | * Framebuffer | 
|  | 542 | ******************************************************************************/ | 
|  | 543 | /* TODO: add support for 324x324 */ | 
| Tomáš Čech | bb2ae8f | 2009-09-11 13:57:01 +0200 | [diff] [blame] | 544 | static struct pxafb_mode_info treo_lcd_modes[] = { | 
| Tomas 'Sleep_Walker' Cech | e6c3f4b | 2009-05-18 15:24:14 +0200 | [diff] [blame] | 545 | { | 
|  | 546 | .pixclock		= 86538, | 
|  | 547 | .xres			= 320, | 
|  | 548 | .yres			= 320, | 
|  | 549 | .bpp			= 16, | 
|  | 550 |  | 
|  | 551 | .left_margin		= 20, | 
|  | 552 | .right_margin		= 8, | 
|  | 553 | .upper_margin		= 8, | 
|  | 554 | .lower_margin		= 5, | 
|  | 555 |  | 
|  | 556 | .hsync_len		= 4, | 
|  | 557 | .vsync_len		= 1, | 
|  | 558 | }, | 
|  | 559 | }; | 
|  | 560 |  | 
| Tomáš Čech | bb2ae8f | 2009-09-11 13:57:01 +0200 | [diff] [blame] | 561 | static void treo_lcd_power(int on, struct fb_var_screeninfo *info) | 
| Tomáš Čech | 28d7a94 | 2009-09-03 16:55:47 +0200 | [diff] [blame] | 562 | { | 
| Tomáš Čech | bb2ae8f | 2009-09-11 13:57:01 +0200 | [diff] [blame] | 563 | gpio_set_value(GPIO_NR_TREO_BL_POWER, on); | 
| Tomáš Čech | 28d7a94 | 2009-09-03 16:55:47 +0200 | [diff] [blame] | 564 | } | 
|  | 565 |  | 
| Tomáš Čech | bb2ae8f | 2009-09-11 13:57:01 +0200 | [diff] [blame] | 566 | static struct pxafb_mach_info treo_lcd_screen = { | 
|  | 567 | .modes		= treo_lcd_modes, | 
|  | 568 | .num_modes	= ARRAY_SIZE(treo_lcd_modes), | 
| Tomas 'Sleep_Walker' Cech | e6c3f4b | 2009-05-18 15:24:14 +0200 | [diff] [blame] | 569 | .lcd_conn	= LCD_COLOR_TFT_16BPP | LCD_PCLK_EDGE_FALL, | 
|  | 570 | }; | 
|  | 571 |  | 
|  | 572 | /****************************************************************************** | 
|  | 573 | * Power management - standby | 
|  | 574 | ******************************************************************************/ | 
| Tomáš Čech | bb2ae8f | 2009-09-11 13:57:01 +0200 | [diff] [blame] | 575 | static void __init treo_pm_init(void) | 
| Tomas 'Sleep_Walker' Cech | e6c3f4b | 2009-05-18 15:24:14 +0200 | [diff] [blame] | 576 | { | 
|  | 577 | static u32 resume[] = { | 
|  | 578 | 0xe3a00101,	/* mov	r0,	#0x40000000 */ | 
|  | 579 | 0xe380060f,	/* orr	r0, r0, #0x00f00000 */ | 
|  | 580 | 0xe590f008,	/* ldr	pc, [r0, #0x08] */ | 
|  | 581 | }; | 
|  | 582 |  | 
|  | 583 | /* this is where the bootloader jumps */ | 
| Tomáš Čech | bb2ae8f | 2009-09-11 13:57:01 +0200 | [diff] [blame] | 584 | memcpy(phys_to_virt(TREO_STR_BASE), resume, sizeof(resume)); | 
| Tomas 'Sleep_Walker' Cech | e6c3f4b | 2009-05-18 15:24:14 +0200 | [diff] [blame] | 585 | } | 
|  | 586 |  | 
|  | 587 | /****************************************************************************** | 
|  | 588 | * Machine init | 
|  | 589 | ******************************************************************************/ | 
| Tomáš Čech | bb2ae8f | 2009-09-11 13:57:01 +0200 | [diff] [blame] | 590 | static struct platform_device *treo_devices[] __initdata = { | 
|  | 591 | &treo_backlight, | 
| Tomas 'Sleep_Walker' Cech | e6c3f4b | 2009-05-18 15:24:14 +0200 | [diff] [blame] | 592 | &power_supply, | 
|  | 593 | }; | 
|  | 594 |  | 
| Tomáš Čech | bb2ae8f | 2009-09-11 13:57:01 +0200 | [diff] [blame] | 595 | #ifdef CONFIG_MACH_TREO680 | 
|  | 596 | static struct platform_device *treo680_devices[] __initdata = { | 
|  | 597 | &treo680_leds, | 
|  | 598 | }; | 
|  | 599 | #endif /* CONFIG_MACH_TREO680 */ | 
|  | 600 |  | 
| Tomáš Čech | d0a92fd | 2009-09-11 13:57:02 +0200 | [diff] [blame] | 601 | #ifdef CONFIG_MACH_CENTRO | 
|  | 602 | static struct platform_device *centro_devices[] __initdata = { | 
|  | 603 | ¢ro_leds, | 
|  | 604 | }; | 
|  | 605 | #endif /* CONFIG_MACH_CENTRO */ | 
|  | 606 |  | 
| Tomas 'Sleep_Walker' Cech | e6c3f4b | 2009-05-18 15:24:14 +0200 | [diff] [blame] | 607 | /* setup udc GPIOs initial state */ | 
| Tomáš Čech | bb2ae8f | 2009-09-11 13:57:01 +0200 | [diff] [blame] | 608 | static void __init treo_udc_init(void) | 
| Tomas 'Sleep_Walker' Cech | e6c3f4b | 2009-05-18 15:24:14 +0200 | [diff] [blame] | 609 | { | 
| Tomáš Čech | bb2ae8f | 2009-09-11 13:57:01 +0200 | [diff] [blame] | 610 | if (!gpio_request(GPIO_NR_TREO_USB_PULLUP, "UDC Vbus")) { | 
|  | 611 | gpio_direction_output(GPIO_NR_TREO_USB_PULLUP, 1); | 
|  | 612 | gpio_free(GPIO_NR_TREO_USB_PULLUP); | 
| Tomas 'Sleep_Walker' Cech | e6c3f4b | 2009-05-18 15:24:14 +0200 | [diff] [blame] | 613 | } | 
|  | 614 | } | 
|  | 615 |  | 
| Tomáš Čech | bb2ae8f | 2009-09-11 13:57:01 +0200 | [diff] [blame] | 616 | static void __init treo_lcd_power_init(void) | 
| Tomáš Čech | 28d7a94 | 2009-09-03 16:55:47 +0200 | [diff] [blame] | 617 | { | 
|  | 618 | int ret; | 
|  | 619 |  | 
| Tomáš Čech | bb2ae8f | 2009-09-11 13:57:01 +0200 | [diff] [blame] | 620 | ret = gpio_request(GPIO_NR_TREO_LCD_POWER, "LCD POWER"); | 
| Tomáš Čech | 28d7a94 | 2009-09-03 16:55:47 +0200 | [diff] [blame] | 621 | if (ret) { | 
|  | 622 | pr_err("Treo680: LCD power GPIO request failed!\n"); | 
|  | 623 | return; | 
|  | 624 | } | 
|  | 625 |  | 
| Tomáš Čech | bb2ae8f | 2009-09-11 13:57:01 +0200 | [diff] [blame] | 626 | ret = gpio_direction_output(GPIO_NR_TREO_LCD_POWER, 0); | 
| Tomáš Čech | 28d7a94 | 2009-09-03 16:55:47 +0200 | [diff] [blame] | 627 | if (ret) { | 
|  | 628 | pr_err("Treo680: setting LCD power GPIO direction failed!\n"); | 
| Tomáš Čech | bb2ae8f | 2009-09-11 13:57:01 +0200 | [diff] [blame] | 629 | gpio_free(GPIO_NR_TREO_LCD_POWER); | 
| Tomáš Čech | 28d7a94 | 2009-09-03 16:55:47 +0200 | [diff] [blame] | 630 | return; | 
|  | 631 | } | 
|  | 632 |  | 
| Tomáš Čech | bb2ae8f | 2009-09-11 13:57:01 +0200 | [diff] [blame] | 633 | treo_lcd_screen.pxafb_lcd_power = treo_lcd_power; | 
| Tomáš Čech | 28d7a94 | 2009-09-03 16:55:47 +0200 | [diff] [blame] | 634 | } | 
|  | 635 |  | 
| Tomáš Čech | bb2ae8f | 2009-09-11 13:57:01 +0200 | [diff] [blame] | 636 | static void __init treo_init(void) | 
|  | 637 | { | 
| Russell King | cc155c6 | 2009-11-09 13:34:08 +0800 | [diff] [blame] | 638 | pxa_set_ffuart_info(NULL); | 
|  | 639 | pxa_set_btuart_info(NULL); | 
|  | 640 | pxa_set_stuart_info(NULL); | 
|  | 641 |  | 
| Tomáš Čech | bb2ae8f | 2009-09-11 13:57:01 +0200 | [diff] [blame] | 642 | treo_pm_init(); | 
|  | 643 | pxa2xx_mfp_config(ARRAY_AND_SIZE(treo_pin_config)); | 
|  | 644 | treo_lcd_power_init(); | 
|  | 645 | set_pxa_fb_info(&treo_lcd_screen); | 
|  | 646 | treo_udc_init(); | 
|  | 647 | pxa_set_udc_info(&treo_udc_info); | 
|  | 648 | pxa_set_ac97_info(&treo_ac97_pdata); | 
|  | 649 | pxa_set_ficp_info(&treo_ficp_info); | 
|  | 650 |  | 
|  | 651 | platform_add_devices(ARRAY_AND_SIZE(treo_devices)); | 
|  | 652 | } | 
|  | 653 |  | 
|  | 654 | #ifdef CONFIG_MACH_TREO680 | 
| Tomas 'Sleep_Walker' Cech | e6c3f4b | 2009-05-18 15:24:14 +0200 | [diff] [blame] | 655 | static void __init treo680_init(void) | 
|  | 656 | { | 
| Tomáš Čech | bb2ae8f | 2009-09-11 13:57:01 +0200 | [diff] [blame] | 657 | treo_init(); | 
| Tomas 'Sleep_Walker' Cech | e6c3f4b | 2009-05-18 15:24:14 +0200 | [diff] [blame] | 658 | pxa2xx_mfp_config(ARRAY_AND_SIZE(treo680_pin_config)); | 
| Tomas 'Sleep_Walker' Cech | e6c3f4b | 2009-05-18 15:24:14 +0200 | [diff] [blame] | 659 | pxa_set_mci_info(&treo680_mci_platform_data); | 
| Tomáš Čech | bb2ae8f | 2009-09-11 13:57:01 +0200 | [diff] [blame] | 660 | pxa_set_keypad_info(&treo680_keypad_platform_data); | 
| Tomas 'Sleep_Walker' Cech | e6c3f4b | 2009-05-18 15:24:14 +0200 | [diff] [blame] | 661 | pxa_set_ohci_info(&treo680_ohci_info); | 
|  | 662 |  | 
| Tomáš Čech | bb2ae8f | 2009-09-11 13:57:01 +0200 | [diff] [blame] | 663 | platform_add_devices(ARRAY_AND_SIZE(treo680_devices)); | 
| Tomas 'Sleep_Walker' Cech | e6c3f4b | 2009-05-18 15:24:14 +0200 | [diff] [blame] | 664 | } | 
|  | 665 |  | 
|  | 666 | MACHINE_START(TREO680, "Palm Treo 680") | 
| Tomáš Čech | bb2ae8f | 2009-09-11 13:57:01 +0200 | [diff] [blame] | 667 | .phys_io        = TREO_PHYS_IO_START, | 
|  | 668 | .io_pg_offst    = io_p2v(0x40000000), | 
|  | 669 | .boot_params    = 0xa0000100, | 
|  | 670 | .map_io         = pxa_map_io, | 
|  | 671 | .init_irq       = pxa27x_init_irq, | 
|  | 672 | .timer          = &pxa_timer, | 
|  | 673 | .init_machine   = treo680_init, | 
| Tomas 'Sleep_Walker' Cech | e6c3f4b | 2009-05-18 15:24:14 +0200 | [diff] [blame] | 674 | MACHINE_END | 
| Tomáš Čech | bb2ae8f | 2009-09-11 13:57:01 +0200 | [diff] [blame] | 675 | #endif /* CONFIG_MACH_TREO680 */ | 
| Tomáš Čech | d0a92fd | 2009-09-11 13:57:02 +0200 | [diff] [blame] | 676 |  | 
|  | 677 | #ifdef CONFIG_MACH_CENTRO | 
|  | 678 | static void __init centro_init(void) | 
|  | 679 | { | 
|  | 680 | treo_init(); | 
|  | 681 | pxa2xx_mfp_config(ARRAY_AND_SIZE(centro685_pin_config)); | 
|  | 682 | pxa_set_mci_info(¢ro_mci_platform_data); | 
|  | 683 |  | 
|  | 684 | pxa_set_keypad_info(¢ro_keypad_platform_data); | 
|  | 685 |  | 
|  | 686 | platform_add_devices(ARRAY_AND_SIZE(centro_devices)); | 
|  | 687 | } | 
|  | 688 |  | 
|  | 689 | MACHINE_START(CENTRO, "Palm Centro 685") | 
|  | 690 | .phys_io        = TREO_PHYS_IO_START, | 
|  | 691 | .io_pg_offst    = io_p2v(0x40000000), | 
|  | 692 | .boot_params    = 0xa0000100, | 
|  | 693 | .map_io         = pxa_map_io, | 
|  | 694 | .init_irq       = pxa27x_init_irq, | 
|  | 695 | .timer          = &pxa_timer, | 
|  | 696 | .init_machine   = centro_init, | 
|  | 697 | MACHINE_END | 
|  | 698 | #endif /* CONFIG_MACH_CENTRO */ |