aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-pxa/palmtreo.c
diff options
context:
space:
mode:
authorTomáš Čech <sleep_walker@suse.cz>2009-09-11 07:57:02 -0400
committerEric Miao <eric.y.miao@gmail.com>2009-11-30 20:02:49 -0500
commitd0a92fd3b84bf707f6b32f31d0f09d2b7bb1ad67 (patch)
tree8a0100ac36371afab0725ca66325a46e677be77c /arch/arm/mach-pxa/palmtreo.c
parentbb2ae8f0325221a2dfd9eb31554f42e9c24abdf2 (diff)
[ARM] pxa/treo: add Palm Centro 685 support
Signed-off-by: Tomáš Čech <sleep_walker@suse.cz> Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
Diffstat (limited to 'arch/arm/mach-pxa/palmtreo.c')
-rw-r--r--arch/arm/mach-pxa/palmtreo.c161
1 files changed, 161 insertions, 0 deletions
diff --git a/arch/arm/mach-pxa/palmtreo.c b/arch/arm/mach-pxa/palmtreo.c
index 5e66028d2911..c071b60ebed8 100644
--- a/arch/arm/mach-pxa/palmtreo.c
+++ b/arch/arm/mach-pxa/palmtreo.c
@@ -3,6 +3,7 @@
3 * 3 *
4 * currently supported: 4 * currently supported:
5 * Palm Treo 680 (GSM) 5 * Palm Treo 680 (GSM)
6 * Palm Centro 685 (GSM)
6 * 7 *
7 * Author: Tomas Cech <sleep_walker@suse.cz> 8 * Author: Tomas Cech <sleep_walker@suse.cz>
8 * 9 *
@@ -160,6 +161,21 @@ static unsigned long treo680_pin_config[] __initdata = {
160}; 161};
161#endif /* CONFIG_MACH_TREO680 */ 162#endif /* CONFIG_MACH_TREO680 */
162 163
164#ifdef CONFIG_MACH_CENTRO
165static unsigned long centro685_pin_config[] __initdata = {
166 /* Bluetooth attached to BT UART*/
167 MFP_CFG_OUT(GPIO80, AF0, DRIVE_LOW), /* power: LOW = off */
168 GPIO42_BTUART_RXD,
169 GPIO43_BTUART_TXD,
170 GPIO44_BTUART_CTS,
171 GPIO45_BTUART_RTS,
172
173 /* MATRIX KEYPAD - different wake up source */
174 GPIO100_KP_MKIN_0,
175 GPIO99_KP_MKIN_5 | WAKEUP_ON_LEVEL_HIGH,
176};
177#endif /* CONFIG_MACH_CENTRO */
178
163/****************************************************************************** 179/******************************************************************************
164 * SD/MMC card controller 180 * SD/MMC card controller
165 ******************************************************************************/ 181 ******************************************************************************/
@@ -172,6 +188,16 @@ static struct pxamci_platform_data treo680_mci_platform_data = {
172}; 188};
173#endif /* CONFIG_MACH_TREO680 */ 189#endif /* CONFIG_MACH_TREO680 */
174 190
191#ifdef CONFIG_MACH_CENTRO
192static struct pxamci_platform_data centro_mci_platform_data = {
193 .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34,
194 .gpio_card_detect = GPIO_NR_TREO_SD_DETECT_N,
195 .gpio_card_ro = -1,
196 .gpio_power = GPIO_NR_CENTRO_SD_POWER,
197 .gpio_power_invert = 1,
198};
199#endif /* CONFIG_MACH_CENTRO */
200
175/****************************************************************************** 201/******************************************************************************
176 * GPIO keyboard 202 * GPIO keyboard
177 ******************************************************************************/ 203 ******************************************************************************/
@@ -247,6 +273,78 @@ static struct pxa27x_keypad_platform_data treo680_keypad_platform_data = {
247}; 273};
248#endif /* CONFIG_MACH_TREO680 */ 274#endif /* CONFIG_MACH_TREO680 */
249 275
276#ifdef CONFIG_MACH_CENTRO
277static unsigned int centro_matrix_keys[] = {
278 KEY(0, 0, KEY_F9), /* Home */
279 KEY(0, 1, KEY_LEFT),
280 KEY(0, 2, KEY_LEFTCTRL), /* Alternate */
281 KEY(0, 3, KEY_L),
282 KEY(0, 4, KEY_A),
283 KEY(0, 5, KEY_Q),
284 KEY(0, 6, KEY_P),
285
286 KEY(1, 0, KEY_RIGHTCTRL), /* Menu */
287 KEY(1, 1, KEY_RIGHT),
288 KEY(1, 2, KEY_LEFTSHIFT), /* Left shift */
289 KEY(1, 3, KEY_Z),
290 KEY(1, 4, KEY_S),
291 KEY(1, 5, KEY_W),
292
293 KEY(2, 0, KEY_F1), /* Phone */
294 KEY(2, 1, KEY_UP),
295 KEY(2, 2, KEY_0),
296 KEY(2, 3, KEY_X),
297 KEY(2, 4, KEY_D),
298 KEY(2, 5, KEY_E),
299
300 KEY(3, 0, KEY_F10), /* Calendar */
301 KEY(3, 1, KEY_DOWN),
302 KEY(3, 2, KEY_SPACE),
303 KEY(3, 3, KEY_C),
304 KEY(3, 4, KEY_F),
305 KEY(3, 5, KEY_R),
306
307 KEY(4, 0, KEY_F12), /* Mail */
308 KEY(4, 1, KEY_KPENTER),
309 KEY(4, 2, KEY_RIGHTALT), /* Alt */
310 KEY(4, 3, KEY_V),
311 KEY(4, 4, KEY_G),
312 KEY(4, 5, KEY_T),
313
314 KEY(5, 0, KEY_F8), /* Red/Off/Power */
315 KEY(5, 1, KEY_PAGEUP), /* Side up */
316 KEY(5, 2, KEY_DOT),
317 KEY(5, 3, KEY_B),
318 KEY(5, 4, KEY_H),
319 KEY(5, 5, KEY_Y),
320
321 KEY(6, 0, KEY_TAB), /* Side Activate */
322 KEY(6, 1, KEY_PAGEDOWN), /* Side down */
323 KEY(6, 2, KEY_ENTER),
324 KEY(6, 3, KEY_N),
325 KEY(6, 4, KEY_J),
326 KEY(6, 5, KEY_U),
327
328 KEY(7, 0, KEY_F6), /* Green/Call */
329 KEY(7, 1, KEY_O),
330 KEY(7, 2, KEY_BACKSPACE),
331 KEY(7, 3, KEY_M),
332 KEY(7, 4, KEY_K),
333 KEY(7, 5, KEY_I),
334};
335
336static struct pxa27x_keypad_platform_data centro_keypad_platform_data = {
337 .matrix_key_rows = 8,
338 .matrix_key_cols = 7,
339 .matrix_key_map = centro_matrix_keys,
340 .matrix_key_map_size = ARRAY_SIZE(centro_matrix_keys),
341 .direct_key_map = { KEY_CONNECT },
342 .direct_key_num = 1,
343
344 .debounce_interval = 30,
345};
346#endif /* CONFIG_MACH_CENTRO */
347
250/****************************************************************************** 348/******************************************************************************
251 * aSoC audio 349 * aSoC audio
252 ******************************************************************************/ 350 ******************************************************************************/
@@ -423,6 +521,40 @@ static struct platform_device treo680_leds = {
423}; 521};
424#endif /* CONFIG_MACH_TREO680 */ 522#endif /* CONFIG_MACH_TREO680 */
425 523
524#ifdef CONFIG_MACH_CENTRO
525static struct gpio_led centro_gpio_leds[] = {
526 {
527 .name = "centro:vibra:vibra",
528 .default_trigger = "none",
529 .gpio = GPIO_NR_CENTRO_VIBRATE_EN,
530 },
531 {
532 .name = "centro:green:led",
533 .default_trigger = "mmc0",
534 .gpio = GPIO_NR_TREO_GREEN_LED,
535 },
536 {
537 .name = "centro:white:keybbl",
538 .default_trigger = "none",
539 .active_low = 1,
540 .gpio = GPIO_NR_CENTRO_KEYB_BL,
541 },
542};
543
544static struct gpio_led_platform_data centro_gpio_led_info = {
545 .leds = centro_gpio_leds,
546 .num_leds = ARRAY_SIZE(centro_gpio_leds),
547};
548
549static struct platform_device centro_leds = {
550 .name = "leds-gpio",
551 .id = -1,
552 .dev = {
553 .platform_data = &centro_gpio_led_info,
554 }
555};
556#endif /* CONFIG_MACH_CENTRO */
557
426/****************************************************************************** 558/******************************************************************************
427 * Framebuffer 559 * Framebuffer
428 ******************************************************************************/ 560 ******************************************************************************/
@@ -484,6 +616,12 @@ static struct platform_device *treo680_devices[] __initdata = {
484}; 616};
485#endif /* CONFIG_MACH_TREO680 */ 617#endif /* CONFIG_MACH_TREO680 */
486 618
619#ifdef CONFIG_MACH_CENTRO
620static struct platform_device *centro_devices[] __initdata = {
621 &centro_leds,
622};
623#endif /* CONFIG_MACH_CENTRO */
624
487/* setup udc GPIOs initial state */ 625/* setup udc GPIOs initial state */
488static void __init treo_udc_init(void) 626static void __init treo_udc_init(void)
489{ 627{
@@ -549,3 +687,26 @@ MACHINE_START(TREO680, "Palm Treo 680")
549 .init_machine = treo680_init, 687 .init_machine = treo680_init,
550MACHINE_END 688MACHINE_END
551#endif /* CONFIG_MACH_TREO680 */ 689#endif /* CONFIG_MACH_TREO680 */
690
691#ifdef CONFIG_MACH_CENTRO
692static void __init centro_init(void)
693{
694 treo_init();
695 pxa2xx_mfp_config(ARRAY_AND_SIZE(centro685_pin_config));
696 pxa_set_mci_info(&centro_mci_platform_data);
697
698 pxa_set_keypad_info(&centro_keypad_platform_data);
699
700 platform_add_devices(ARRAY_AND_SIZE(centro_devices));
701}
702
703MACHINE_START(CENTRO, "Palm Centro 685")
704 .phys_io = TREO_PHYS_IO_START,
705 .io_pg_offst = io_p2v(0x40000000),
706 .boot_params = 0xa0000100,
707 .map_io = pxa_map_io,
708 .init_irq = pxa27x_init_irq,
709 .timer = &pxa_timer,
710 .init_machine = centro_init,
711MACHINE_END
712#endif /* CONFIG_MACH_CENTRO */