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> |
Tomas 'Sleep_Walker' Cech | e6c3f4b | 2009-05-18 15:24:14 +0200 | [diff] [blame] | 26 | #include <linux/power_supply.h> |
| 27 | #include <linux/sysdev.h> |
| 28 | #include <linux/w1-gpio.h> |
| 29 | |
| 30 | #include <asm/mach-types.h> |
| 31 | #include <asm/mach/arch.h> |
| 32 | #include <asm/mach/map.h> |
| 33 | |
| 34 | #include <mach/pxa27x.h> |
| 35 | #include <mach/pxa27x-udc.h> |
| 36 | #include <mach/audio.h> |
Tomáš Čech | bb2ae8f | 2009-09-11 13:57:01 +0200 | [diff] [blame] | 37 | #include <mach/palmtreo.h> |
Tomas 'Sleep_Walker' Cech | e6c3f4b | 2009-05-18 15:24:14 +0200 | [diff] [blame] | 38 | #include <mach/mmc.h> |
| 39 | #include <mach/pxafb.h> |
| 40 | #include <mach/irda.h> |
| 41 | #include <mach/pxa27x_keypad.h> |
| 42 | #include <mach/udc.h> |
| 43 | #include <mach/ohci.h> |
| 44 | #include <mach/pxa2xx-regs.h> |
| 45 | #include <mach/palmasoc.h> |
| 46 | #include <mach/camera.h> |
Marek Vasut | 31620e2 | 2010-07-13 08:16:45 +0200 | [diff] [blame^] | 47 | #include <mach/palm27x.h> |
Tomas 'Sleep_Walker' Cech | e6c3f4b | 2009-05-18 15:24:14 +0200 | [diff] [blame] | 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 | /****************************************************************************** |
Tomas 'Sleep_Walker' Cech | e6c3f4b | 2009-05-18 15:24:14 +0200 | [diff] [blame] | 162 | * GPIO keyboard |
| 163 | ******************************************************************************/ |
Marek Vasut | 31620e2 | 2010-07-13 08:16:45 +0200 | [diff] [blame^] | 164 | #if defined(CONFIG_KEYBOARD_PXA27x) || defined(CONFIG_KEYBOARD_PXA27x_MODULE) |
Tomas 'Sleep_Walker' Cech | e6c3f4b | 2009-05-18 15:24:14 +0200 | [diff] [blame] | 165 | static unsigned int treo680_matrix_keys[] = { |
| 166 | KEY(0, 0, KEY_F8), /* Red/Off/Power */ |
| 167 | KEY(0, 1, KEY_LEFT), |
| 168 | KEY(0, 2, KEY_LEFTCTRL), /* Alternate */ |
| 169 | KEY(0, 3, KEY_L), |
| 170 | KEY(0, 4, KEY_A), |
| 171 | KEY(0, 5, KEY_Q), |
| 172 | KEY(0, 6, KEY_P), |
| 173 | |
| 174 | KEY(1, 0, KEY_RIGHTCTRL), /* Menu */ |
| 175 | KEY(1, 1, KEY_RIGHT), |
| 176 | KEY(1, 2, KEY_LEFTSHIFT), /* Left shift */ |
| 177 | KEY(1, 3, KEY_Z), |
| 178 | KEY(1, 4, KEY_S), |
| 179 | KEY(1, 5, KEY_W), |
| 180 | |
| 181 | KEY(2, 0, KEY_F1), /* Phone */ |
| 182 | KEY(2, 1, KEY_UP), |
| 183 | KEY(2, 2, KEY_0), |
| 184 | KEY(2, 3, KEY_X), |
| 185 | KEY(2, 4, KEY_D), |
| 186 | KEY(2, 5, KEY_E), |
| 187 | |
| 188 | KEY(3, 0, KEY_F10), /* Calendar */ |
| 189 | KEY(3, 1, KEY_DOWN), |
| 190 | KEY(3, 2, KEY_SPACE), |
| 191 | KEY(3, 3, KEY_C), |
| 192 | KEY(3, 4, KEY_F), |
| 193 | KEY(3, 5, KEY_R), |
| 194 | |
| 195 | KEY(4, 0, KEY_F12), /* Mail */ |
| 196 | KEY(4, 1, KEY_KPENTER), |
| 197 | KEY(4, 2, KEY_RIGHTALT), /* Alt */ |
| 198 | KEY(4, 3, KEY_V), |
| 199 | KEY(4, 4, KEY_G), |
| 200 | KEY(4, 5, KEY_T), |
| 201 | |
| 202 | KEY(5, 0, KEY_F9), /* Home */ |
| 203 | KEY(5, 1, KEY_PAGEUP), /* Side up */ |
| 204 | KEY(5, 2, KEY_DOT), |
| 205 | KEY(5, 3, KEY_B), |
| 206 | KEY(5, 4, KEY_H), |
| 207 | KEY(5, 5, KEY_Y), |
| 208 | |
| 209 | KEY(6, 0, KEY_TAB), /* Side Activate */ |
| 210 | KEY(6, 1, KEY_PAGEDOWN), /* Side down */ |
| 211 | KEY(6, 2, KEY_ENTER), |
| 212 | KEY(6, 3, KEY_N), |
| 213 | KEY(6, 4, KEY_J), |
| 214 | KEY(6, 5, KEY_U), |
| 215 | |
| 216 | KEY(7, 0, KEY_F6), /* Green/Call */ |
| 217 | KEY(7, 1, KEY_O), |
| 218 | KEY(7, 2, KEY_BACKSPACE), |
| 219 | KEY(7, 3, KEY_M), |
| 220 | KEY(7, 4, KEY_K), |
| 221 | KEY(7, 5, KEY_I), |
| 222 | }; |
| 223 | |
Tomáš Čech | d0a92fd | 2009-09-11 13:57:02 +0200 | [diff] [blame] | 224 | static unsigned int centro_matrix_keys[] = { |
| 225 | KEY(0, 0, KEY_F9), /* Home */ |
| 226 | KEY(0, 1, KEY_LEFT), |
| 227 | KEY(0, 2, KEY_LEFTCTRL), /* Alternate */ |
| 228 | KEY(0, 3, KEY_L), |
| 229 | KEY(0, 4, KEY_A), |
| 230 | KEY(0, 5, KEY_Q), |
| 231 | KEY(0, 6, KEY_P), |
| 232 | |
| 233 | KEY(1, 0, KEY_RIGHTCTRL), /* Menu */ |
| 234 | KEY(1, 1, KEY_RIGHT), |
| 235 | KEY(1, 2, KEY_LEFTSHIFT), /* Left shift */ |
| 236 | KEY(1, 3, KEY_Z), |
| 237 | KEY(1, 4, KEY_S), |
| 238 | KEY(1, 5, KEY_W), |
| 239 | |
| 240 | KEY(2, 0, KEY_F1), /* Phone */ |
| 241 | KEY(2, 1, KEY_UP), |
| 242 | KEY(2, 2, KEY_0), |
| 243 | KEY(2, 3, KEY_X), |
| 244 | KEY(2, 4, KEY_D), |
| 245 | KEY(2, 5, KEY_E), |
| 246 | |
| 247 | KEY(3, 0, KEY_F10), /* Calendar */ |
| 248 | KEY(3, 1, KEY_DOWN), |
| 249 | KEY(3, 2, KEY_SPACE), |
| 250 | KEY(3, 3, KEY_C), |
| 251 | KEY(3, 4, KEY_F), |
| 252 | KEY(3, 5, KEY_R), |
| 253 | |
| 254 | KEY(4, 0, KEY_F12), /* Mail */ |
| 255 | KEY(4, 1, KEY_KPENTER), |
| 256 | KEY(4, 2, KEY_RIGHTALT), /* Alt */ |
| 257 | KEY(4, 3, KEY_V), |
| 258 | KEY(4, 4, KEY_G), |
| 259 | KEY(4, 5, KEY_T), |
| 260 | |
| 261 | KEY(5, 0, KEY_F8), /* Red/Off/Power */ |
| 262 | KEY(5, 1, KEY_PAGEUP), /* Side up */ |
| 263 | KEY(5, 2, KEY_DOT), |
| 264 | KEY(5, 3, KEY_B), |
| 265 | KEY(5, 4, KEY_H), |
| 266 | KEY(5, 5, KEY_Y), |
| 267 | |
| 268 | KEY(6, 0, KEY_TAB), /* Side Activate */ |
| 269 | KEY(6, 1, KEY_PAGEDOWN), /* Side down */ |
| 270 | KEY(6, 2, KEY_ENTER), |
| 271 | KEY(6, 3, KEY_N), |
| 272 | KEY(6, 4, KEY_J), |
| 273 | KEY(6, 5, KEY_U), |
| 274 | |
| 275 | KEY(7, 0, KEY_F6), /* Green/Call */ |
| 276 | KEY(7, 1, KEY_O), |
| 277 | KEY(7, 2, KEY_BACKSPACE), |
| 278 | KEY(7, 3, KEY_M), |
| 279 | KEY(7, 4, KEY_K), |
| 280 | KEY(7, 5, KEY_I), |
| 281 | }; |
| 282 | |
Marek Vasut | 31620e2 | 2010-07-13 08:16:45 +0200 | [diff] [blame^] | 283 | static struct pxa27x_keypad_platform_data treo680_keypad_pdata = { |
Tomáš Čech | d0a92fd | 2009-09-11 13:57:02 +0200 | [diff] [blame] | 284 | .matrix_key_rows = 8, |
| 285 | .matrix_key_cols = 7, |
Marek Vasut | 31620e2 | 2010-07-13 08:16:45 +0200 | [diff] [blame^] | 286 | .matrix_key_map = treo680_matrix_keys, |
| 287 | .matrix_key_map_size = ARRAY_SIZE(treo680_matrix_keys), |
Tomáš Čech | d0a92fd | 2009-09-11 13:57:02 +0200 | [diff] [blame] | 288 | .direct_key_map = { KEY_CONNECT }, |
| 289 | .direct_key_num = 1, |
| 290 | |
| 291 | .debounce_interval = 30, |
| 292 | }; |
Tomáš Čech | d0a92fd | 2009-09-11 13:57:02 +0200 | [diff] [blame] | 293 | |
Marek Vasut | 31620e2 | 2010-07-13 08:16:45 +0200 | [diff] [blame^] | 294 | static void __init palmtreo_kpc_init(void) |
Tomas 'Sleep_Walker' Cech | e6c3f4b | 2009-05-18 15:24:14 +0200 | [diff] [blame] | 295 | { |
Marek Vasut | 31620e2 | 2010-07-13 08:16:45 +0200 | [diff] [blame^] | 296 | static struct pxa27x_keypad_platform_data *data = &treo680_keypad_pdata; |
Tomas 'Sleep_Walker' Cech | e6c3f4b | 2009-05-18 15:24:14 +0200 | [diff] [blame] | 297 | |
Marek Vasut | 31620e2 | 2010-07-13 08:16:45 +0200 | [diff] [blame^] | 298 | if (machine_is_centro()) { |
| 299 | data->matrix_key_map = centro_matrix_keys; |
| 300 | data->matrix_key_map_size = ARRAY_SIZE(centro_matrix_keys); |
| 301 | } |
Tomas 'Sleep_Walker' Cech | e6c3f4b | 2009-05-18 15:24:14 +0200 | [diff] [blame] | 302 | |
Marek Vasut | 31620e2 | 2010-07-13 08:16:45 +0200 | [diff] [blame^] | 303 | pxa_set_keypad_info(&treo680_keypad_pdata); |
Tomas 'Sleep_Walker' Cech | e6c3f4b | 2009-05-18 15:24:14 +0200 | [diff] [blame] | 304 | } |
Marek Vasut | 31620e2 | 2010-07-13 08:16:45 +0200 | [diff] [blame^] | 305 | #else |
| 306 | static inline void palmtreo_kpc_init(void) {} |
| 307 | #endif |
Tomas 'Sleep_Walker' Cech | e6c3f4b | 2009-05-18 15:24:14 +0200 | [diff] [blame] | 308 | |
| 309 | /****************************************************************************** |
| 310 | * USB host |
| 311 | ******************************************************************************/ |
Marek Vasut | 31620e2 | 2010-07-13 08:16:45 +0200 | [diff] [blame^] | 312 | #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] | 313 | static struct pxaohci_platform_data treo680_ohci_info = { |
| 314 | .port_mode = PMM_PERPORT_MODE, |
| 315 | .flags = ENABLE_PORT1 | ENABLE_PORT3, |
| 316 | .power_budget = 0, |
| 317 | }; |
| 318 | |
Marek Vasut | 31620e2 | 2010-07-13 08:16:45 +0200 | [diff] [blame^] | 319 | static void __init palmtreo_uhc_init(void) |
Tomas 'Sleep_Walker' Cech | e6c3f4b | 2009-05-18 15:24:14 +0200 | [diff] [blame] | 320 | { |
Marek Vasut | 31620e2 | 2010-07-13 08:16:45 +0200 | [diff] [blame^] | 321 | if (machine_is_treo680()) |
| 322 | pxa_set_ohci_info(&treo680_ohci_info); |
Tomas 'Sleep_Walker' Cech | e6c3f4b | 2009-05-18 15:24:14 +0200 | [diff] [blame] | 323 | } |
Marek Vasut | 31620e2 | 2010-07-13 08:16:45 +0200 | [diff] [blame^] | 324 | #else |
| 325 | static inline void palmtreo_uhc_init(void) {} |
| 326 | #endif |
Tomas 'Sleep_Walker' Cech | e6c3f4b | 2009-05-18 15:24:14 +0200 | [diff] [blame] | 327 | |
| 328 | /****************************************************************************** |
| 329 | * Vibra and LEDs |
| 330 | ******************************************************************************/ |
Tomáš Čech | bb2ae8f | 2009-09-11 13:57:01 +0200 | [diff] [blame] | 331 | #ifdef CONFIG_MACH_TREO680 |
| 332 | static struct gpio_led treo680_gpio_leds[] = { |
Tomas 'Sleep_Walker' Cech | e6c3f4b | 2009-05-18 15:24:14 +0200 | [diff] [blame] | 333 | { |
| 334 | .name = "treo680:vibra:vibra", |
| 335 | .default_trigger = "none", |
| 336 | .gpio = GPIO_NR_TREO680_VIBRATE_EN, |
| 337 | }, |
| 338 | { |
| 339 | .name = "treo680:green:led", |
| 340 | .default_trigger = "mmc0", |
Tomáš Čech | bb2ae8f | 2009-09-11 13:57:01 +0200 | [diff] [blame] | 341 | .gpio = GPIO_NR_TREO_GREEN_LED, |
Tomas 'Sleep_Walker' Cech | e6c3f4b | 2009-05-18 15:24:14 +0200 | [diff] [blame] | 342 | }, |
| 343 | { |
Tomáš Čech | bb2ae8f | 2009-09-11 13:57:01 +0200 | [diff] [blame] | 344 | .name = "treo680:white:keybbl", |
Tomas 'Sleep_Walker' Cech | e6c3f4b | 2009-05-18 15:24:14 +0200 | [diff] [blame] | 345 | .default_trigger = "none", |
| 346 | .gpio = GPIO_NR_TREO680_KEYB_BL, |
| 347 | }, |
| 348 | }; |
| 349 | |
Tomáš Čech | bb2ae8f | 2009-09-11 13:57:01 +0200 | [diff] [blame] | 350 | static struct gpio_led_platform_data treo680_gpio_led_info = { |
| 351 | .leds = treo680_gpio_leds, |
| 352 | .num_leds = ARRAY_SIZE(treo680_gpio_leds), |
Tomas 'Sleep_Walker' Cech | e6c3f4b | 2009-05-18 15:24:14 +0200 | [diff] [blame] | 353 | }; |
| 354 | |
Tomáš Čech | d0a92fd | 2009-09-11 13:57:02 +0200 | [diff] [blame] | 355 | static struct gpio_led centro_gpio_leds[] = { |
| 356 | { |
| 357 | .name = "centro:vibra:vibra", |
| 358 | .default_trigger = "none", |
| 359 | .gpio = GPIO_NR_CENTRO_VIBRATE_EN, |
| 360 | }, |
| 361 | { |
| 362 | .name = "centro:green:led", |
| 363 | .default_trigger = "mmc0", |
| 364 | .gpio = GPIO_NR_TREO_GREEN_LED, |
| 365 | }, |
| 366 | { |
| 367 | .name = "centro:white:keybbl", |
| 368 | .default_trigger = "none", |
| 369 | .active_low = 1, |
| 370 | .gpio = GPIO_NR_CENTRO_KEYB_BL, |
| 371 | }, |
| 372 | }; |
| 373 | |
| 374 | static struct gpio_led_platform_data centro_gpio_led_info = { |
| 375 | .leds = centro_gpio_leds, |
| 376 | .num_leds = ARRAY_SIZE(centro_gpio_leds), |
| 377 | }; |
| 378 | |
Marek Vasut | 31620e2 | 2010-07-13 08:16:45 +0200 | [diff] [blame^] | 379 | static struct platform_device palmtreo_leds = { |
Tomáš Čech | d0a92fd | 2009-09-11 13:57:02 +0200 | [diff] [blame] | 380 | .name = "leds-gpio", |
| 381 | .id = -1, |
| 382 | .dev = { |
Marek Vasut | 31620e2 | 2010-07-13 08:16:45 +0200 | [diff] [blame^] | 383 | .platform_data = &treo680_gpio_led_info, |
Tomáš Čech | d0a92fd | 2009-09-11 13:57:02 +0200 | [diff] [blame] | 384 | } |
| 385 | }; |
Tomáš Čech | d0a92fd | 2009-09-11 13:57:02 +0200 | [diff] [blame] | 386 | |
Marek Vasut | 31620e2 | 2010-07-13 08:16:45 +0200 | [diff] [blame^] | 387 | static void __init palmtreo_leds_init(void) |
Tomas 'Sleep_Walker' Cech | e6c3f4b | 2009-05-18 15:24:14 +0200 | [diff] [blame] | 388 | { |
Marek Vasut | 31620e2 | 2010-07-13 08:16:45 +0200 | [diff] [blame^] | 389 | if (machine_is_centro()) |
| 390 | palmtreo_leds.dev.platform_data = ¢ro_gpio_led_info; |
Tomas 'Sleep_Walker' Cech | e6c3f4b | 2009-05-18 15:24:14 +0200 | [diff] [blame] | 391 | |
Marek Vasut | 31620e2 | 2010-07-13 08:16:45 +0200 | [diff] [blame^] | 392 | platform_device_register(&palmtreo_leds); |
Tomáš Čech | 28d7a94 | 2009-09-03 16:55:47 +0200 | [diff] [blame] | 393 | } |
Marek Vasut | 31620e2 | 2010-07-13 08:16:45 +0200 | [diff] [blame^] | 394 | #else |
| 395 | static inline void palmtreo_leds_init(void) {} |
| 396 | #endif |
Tomas 'Sleep_Walker' Cech | e6c3f4b | 2009-05-18 15:24:14 +0200 | [diff] [blame] | 397 | |
| 398 | /****************************************************************************** |
| 399 | * Machine init |
| 400 | ******************************************************************************/ |
Marek Vasut | 31620e2 | 2010-07-13 08:16:45 +0200 | [diff] [blame^] | 401 | static void __init palmphone_common_init(void) |
Tomas 'Sleep_Walker' Cech | e6c3f4b | 2009-05-18 15:24:14 +0200 | [diff] [blame] | 402 | { |
Marek Vasut | 31620e2 | 2010-07-13 08:16:45 +0200 | [diff] [blame^] | 403 | pxa2xx_mfp_config(ARRAY_AND_SIZE(treo_pin_config)); |
Russell King | cc155c6 | 2009-11-09 13:34:08 +0800 | [diff] [blame] | 404 | pxa_set_ffuart_info(NULL); |
| 405 | pxa_set_btuart_info(NULL); |
| 406 | pxa_set_stuart_info(NULL); |
Marek Vasut | 31620e2 | 2010-07-13 08:16:45 +0200 | [diff] [blame^] | 407 | palm27x_pm_init(TREO_STR_BASE); |
| 408 | palm27x_lcd_init(GPIO_NR_TREO_BL_POWER, &palm_320x320_new_lcd_mode); |
| 409 | palm27x_udc_init(GPIO_NR_TREO_USB_DETECT, GPIO_NR_TREO_USB_PULLUP, 1); |
| 410 | palm27x_irda_init(GPIO_NR_TREO_IR_EN); |
| 411 | palm27x_ac97_init(-1, -1, -1, 95); |
| 412 | palm27x_pwm_init(GPIO_NR_TREO_BL_POWER, -1); |
| 413 | palm27x_power_init(GPIO_NR_TREO_POWER_DETECT, -1); |
| 414 | palm27x_pmic_init(); |
| 415 | palmtreo_kpc_init(); |
| 416 | palmtreo_uhc_init(); |
| 417 | palmtreo_leds_init(); |
Tomáš Čech | bb2ae8f | 2009-09-11 13:57:01 +0200 | [diff] [blame] | 418 | } |
| 419 | |
Tomas 'Sleep_Walker' Cech | e6c3f4b | 2009-05-18 15:24:14 +0200 | [diff] [blame] | 420 | static void __init treo680_init(void) |
| 421 | { |
Tomas 'Sleep_Walker' Cech | e6c3f4b | 2009-05-18 15:24:14 +0200 | [diff] [blame] | 422 | pxa2xx_mfp_config(ARRAY_AND_SIZE(treo680_pin_config)); |
Marek Vasut | 31620e2 | 2010-07-13 08:16:45 +0200 | [diff] [blame^] | 423 | palmphone_common_init(); |
| 424 | palm27x_mmc_init(GPIO_NR_TREO_SD_DETECT_N, GPIO_NR_TREO680_SD_READONLY, |
| 425 | GPIO_NR_TREO680_SD_POWER, 0); |
| 426 | } |
Tomas 'Sleep_Walker' Cech | e6c3f4b | 2009-05-18 15:24:14 +0200 | [diff] [blame] | 427 | |
Marek Vasut | 31620e2 | 2010-07-13 08:16:45 +0200 | [diff] [blame^] | 428 | static void __init centro_init(void) |
| 429 | { |
| 430 | pxa2xx_mfp_config(ARRAY_AND_SIZE(centro685_pin_config)); |
| 431 | palmphone_common_init(); |
| 432 | palm27x_mmc_init(GPIO_NR_TREO_SD_DETECT_N, -1, |
| 433 | GPIO_NR_CENTRO_SD_POWER, 1); |
Tomas 'Sleep_Walker' Cech | e6c3f4b | 2009-05-18 15:24:14 +0200 | [diff] [blame] | 434 | } |
| 435 | |
| 436 | MACHINE_START(TREO680, "Palm Treo 680") |
Tomáš Čech | bb2ae8f | 2009-09-11 13:57:01 +0200 | [diff] [blame] | 437 | .phys_io = TREO_PHYS_IO_START, |
| 438 | .io_pg_offst = io_p2v(0x40000000), |
| 439 | .boot_params = 0xa0000100, |
| 440 | .map_io = pxa_map_io, |
| 441 | .init_irq = pxa27x_init_irq, |
| 442 | .timer = &pxa_timer, |
| 443 | .init_machine = treo680_init, |
Tomas 'Sleep_Walker' Cech | e6c3f4b | 2009-05-18 15:24:14 +0200 | [diff] [blame] | 444 | MACHINE_END |
Tomáš Čech | d0a92fd | 2009-09-11 13:57:02 +0200 | [diff] [blame] | 445 | |
| 446 | MACHINE_START(CENTRO, "Palm Centro 685") |
| 447 | .phys_io = TREO_PHYS_IO_START, |
| 448 | .io_pg_offst = io_p2v(0x40000000), |
| 449 | .boot_params = 0xa0000100, |
| 450 | .map_io = pxa_map_io, |
| 451 | .init_irq = pxa27x_init_irq, |
| 452 | .timer = &pxa_timer, |
Marek Vasut | 31620e2 | 2010-07-13 08:16:45 +0200 | [diff] [blame^] | 453 | .init_machine = centro_init, |
Tomáš Čech | d0a92fd | 2009-09-11 13:57:02 +0200 | [diff] [blame] | 454 | MACHINE_END |