| 
									
										
										
										
											2008-11-20 00:58:38 +01:00
										 |  |  | /*
 | 
					
						
							|  |  |  |  * Hardware definitions for Palm Tungsten|T5 | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * Author:	Marek Vasut <marek.vasut@gmail.com> | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * Based on work of: | 
					
						
							|  |  |  |  *		Ales Snuparek <snuparek@atlas.cz> | 
					
						
							|  |  |  |  *		Justin Kendrick <twilightsentry@gmail.com> | 
					
						
							|  |  |  |  *		RichardT5 <richard_t5@users.sourceforge.net> | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * This program is free software; you can redistribute it and/or modify | 
					
						
							|  |  |  |  * it under the terms of the GNU General Public License version 2 as | 
					
						
							|  |  |  |  * published by the Free Software Foundation. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * (find more info at www.hackndev.com) | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include <linux/platform_device.h>
 | 
					
						
							|  |  |  | #include <linux/delay.h>
 | 
					
						
							|  |  |  | #include <linux/irq.h>
 | 
					
						
							|  |  |  | #include <linux/gpio_keys.h>
 | 
					
						
							|  |  |  | #include <linux/input.h>
 | 
					
						
							| 
									
										
										
										
											2010-05-22 19:47:18 +01:00
										 |  |  | #include <linux/memblock.h>
 | 
					
						
							| 
									
										
										
										
											2008-11-20 00:58:38 +01:00
										 |  |  | #include <linux/pda_power.h>
 | 
					
						
							|  |  |  | #include <linux/pwm_backlight.h>
 | 
					
						
							|  |  |  | #include <linux/gpio.h>
 | 
					
						
							| 
									
										
										
										
											2010-06-04 03:07:33 +02:00
										 |  |  | #include <linux/wm97xx.h>
 | 
					
						
							| 
									
										
										
										
											2008-11-20 00:58:38 +01:00
										 |  |  | #include <linux/power_supply.h>
 | 
					
						
							| 
									
										
										
										
											2009-04-23 11:12:37 +02:00
										 |  |  | #include <linux/usb/gpio_vbus.h>
 | 
					
						
							| 
									
										
										
										
											2008-11-20 00:58:38 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | #include <asm/mach-types.h>
 | 
					
						
							|  |  |  | #include <asm/mach/arch.h>
 | 
					
						
							|  |  |  | #include <asm/mach/map.h>
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-01-02 23:17:22 +08:00
										 |  |  | #include <mach/pxa27x.h>
 | 
					
						
							| 
									
										
										
										
											2008-11-20 00:58:38 +01:00
										 |  |  | #include <mach/audio.h>
 | 
					
						
							|  |  |  | #include <mach/palmt5.h>
 | 
					
						
							| 
									
										
										
										
											2012-08-24 15:16:48 +02:00
										 |  |  | #include <linux/platform_data/mmc-pxamci.h>
 | 
					
						
							|  |  |  | #include <linux/platform_data/video-pxafb.h>
 | 
					
						
							|  |  |  | #include <linux/platform_data/irda-pxaficp.h>
 | 
					
						
							|  |  |  | #include <linux/platform_data/keypad-pxa27x.h>
 | 
					
						
							| 
									
										
										
										
											2008-11-20 00:58:38 +01:00
										 |  |  | #include <mach/udc.h>
 | 
					
						
							| 
									
										
										
										
											2012-08-24 15:16:48 +02:00
										 |  |  | #include <linux/platform_data/asoc-palm27x.h>
 | 
					
						
							| 
									
										
										
										
											2010-07-13 08:16:45 +02:00
										 |  |  | #include <mach/palm27x.h>
 | 
					
						
							| 
									
										
										
										
											2008-11-20 00:58:38 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | #include "generic.h"
 | 
					
						
							|  |  |  | #include "devices.h"
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /******************************************************************************
 | 
					
						
							|  |  |  |  * Pin configuration | 
					
						
							|  |  |  |  ******************************************************************************/ | 
					
						
							|  |  |  | static unsigned long palmt5_pin_config[] __initdata = { | 
					
						
							|  |  |  | 	/* MMC */ | 
					
						
							|  |  |  | 	GPIO32_MMC_CLK, | 
					
						
							|  |  |  | 	GPIO92_MMC_DAT_0, | 
					
						
							|  |  |  | 	GPIO109_MMC_DAT_1, | 
					
						
							|  |  |  | 	GPIO110_MMC_DAT_2, | 
					
						
							|  |  |  | 	GPIO111_MMC_DAT_3, | 
					
						
							|  |  |  | 	GPIO112_MMC_CMD, | 
					
						
							|  |  |  | 	GPIO14_GPIO,	/* SD detect */ | 
					
						
							|  |  |  | 	GPIO114_GPIO,	/* SD power */ | 
					
						
							|  |  |  | 	GPIO115_GPIO,	/* SD r/o switch */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	/* AC97 */ | 
					
						
							|  |  |  | 	GPIO28_AC97_BITCLK, | 
					
						
							|  |  |  | 	GPIO29_AC97_SDATA_IN_0, | 
					
						
							|  |  |  | 	GPIO30_AC97_SDATA_OUT, | 
					
						
							|  |  |  | 	GPIO31_AC97_SYNC, | 
					
						
							| 
									
										
										
										
											2009-05-22 01:39:10 +02:00
										 |  |  | 	GPIO89_AC97_SYSCLK, | 
					
						
							| 
									
										
										
										
											2009-04-12 16:37:23 +02:00
										 |  |  | 	GPIO95_AC97_nRESET, | 
					
						
							| 
									
										
										
										
											2008-11-20 00:58:38 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	/* IrDA */ | 
					
						
							|  |  |  | 	GPIO40_GPIO,	/* ir disable */ | 
					
						
							|  |  |  | 	GPIO46_FICP_RXD, | 
					
						
							|  |  |  | 	GPIO47_FICP_TXD, | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	/* USB */ | 
					
						
							|  |  |  | 	GPIO15_GPIO,	/* usb detect */ | 
					
						
							| 
									
										
										
										
											2009-04-12 16:37:23 +02:00
										 |  |  | 	GPIO93_GPIO,	/* usb power */ | 
					
						
							| 
									
										
										
										
											2008-11-20 00:58:38 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	/* MATRIX KEYPAD */ | 
					
						
							| 
									
										
										
										
											2009-03-28 12:37:42 +01:00
										 |  |  | 	GPIO100_KP_MKIN_0 | WAKEUP_ON_LEVEL_HIGH, | 
					
						
							|  |  |  | 	GPIO101_KP_MKIN_1 | WAKEUP_ON_LEVEL_HIGH, | 
					
						
							|  |  |  | 	GPIO102_KP_MKIN_2 | WAKEUP_ON_LEVEL_HIGH, | 
					
						
							|  |  |  | 	GPIO97_KP_MKIN_3 | WAKEUP_ON_LEVEL_HIGH, | 
					
						
							| 
									
										
										
										
											2008-11-20 00:58:38 +01:00
										 |  |  | 	GPIO103_KP_MKOUT_0, | 
					
						
							|  |  |  | 	GPIO104_KP_MKOUT_1, | 
					
						
							|  |  |  | 	GPIO105_KP_MKOUT_2, | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	/* LCD */ | 
					
						
							| 
									
										
										
										
											2010-01-04 11:37:14 +08:00
										 |  |  | 	GPIOxx_LCD_TFT_16BPP, | 
					
						
							| 
									
										
										
										
											2008-11-20 00:58:38 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	/* PWM */ | 
					
						
							|  |  |  | 	GPIO16_PWM0_OUT, | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-07-16 19:37:29 +02:00
										 |  |  | 	/* FFUART */ | 
					
						
							|  |  |  | 	GPIO34_FFUART_RXD, | 
					
						
							|  |  |  | 	GPIO39_FFUART_TXD, | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-11-20 00:58:38 +01:00
										 |  |  | 	/* MISC */ | 
					
						
							|  |  |  | 	GPIO10_GPIO,	/* hotsync button */ | 
					
						
							|  |  |  | 	GPIO90_GPIO,	/* power detect */ | 
					
						
							|  |  |  | 	GPIO107_GPIO,	/* earphone detect */ | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /******************************************************************************
 | 
					
						
							|  |  |  |  * GPIO keyboard | 
					
						
							|  |  |  |  ******************************************************************************/ | 
					
						
							| 
									
										
										
										
											2010-07-13 08:16:45 +02:00
										 |  |  | #if defined(CONFIG_KEYBOARD_PXA27x) || defined(CONFIG_KEYBOARD_PXA27x_MODULE)
 | 
					
						
							| 
									
										
										
										
											2013-05-05 20:24:58 -07:00
										 |  |  | static const unsigned int palmt5_matrix_keys[] = { | 
					
						
							| 
									
										
										
										
											2008-11-20 00:58:38 +01:00
										 |  |  | 	KEY(0, 0, KEY_POWER), | 
					
						
							|  |  |  | 	KEY(0, 1, KEY_F1), | 
					
						
							|  |  |  | 	KEY(0, 2, KEY_ENTER), | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	KEY(1, 0, KEY_F2), | 
					
						
							|  |  |  | 	KEY(1, 1, KEY_F3), | 
					
						
							|  |  |  | 	KEY(1, 2, KEY_F4), | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	KEY(2, 0, KEY_UP), | 
					
						
							|  |  |  | 	KEY(2, 2, KEY_DOWN), | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	KEY(3, 0, KEY_RIGHT), | 
					
						
							|  |  |  | 	KEY(3, 2, KEY_LEFT), | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-05-05 20:24:58 -07:00
										 |  |  | static struct matrix_keymap_data palmt5_matrix_keymap_data = { | 
					
						
							|  |  |  | 	.keymap			= palmt5_matrix_keys, | 
					
						
							|  |  |  | 	.keymap_size		= ARRAY_SIZE(palmt5_matrix_keys), | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-11-20 00:58:38 +01:00
										 |  |  | static struct pxa27x_keypad_platform_data palmt5_keypad_platform_data = { | 
					
						
							|  |  |  | 	.matrix_key_rows	= 4, | 
					
						
							|  |  |  | 	.matrix_key_cols	= 3, | 
					
						
							| 
									
										
										
										
											2013-05-05 20:24:58 -07:00
										 |  |  | 	.matrix_keymap_data	= &palmt5_matrix_keymap_data, | 
					
						
							| 
									
										
										
										
											2008-11-20 00:58:38 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	.debounce_interval	= 30, | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-07-13 08:16:45 +02:00
										 |  |  | static void __init palmt5_kpc_init(void) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	pxa_set_keypad_info(&palmt5_keypad_platform_data); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | #else
 | 
					
						
							|  |  |  | static inline void palmt5_kpc_init(void) {} | 
					
						
							|  |  |  | #endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-11-20 00:58:38 +01:00
										 |  |  | /******************************************************************************
 | 
					
						
							|  |  |  |  * GPIO keys | 
					
						
							|  |  |  |  ******************************************************************************/ | 
					
						
							| 
									
										
										
										
											2010-07-13 08:16:45 +02:00
										 |  |  | #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
 | 
					
						
							| 
									
										
										
										
											2008-11-20 00:58:38 +01:00
										 |  |  | static struct gpio_keys_button palmt5_pxa_buttons[] = { | 
					
						
							|  |  |  | 	{KEY_F8, GPIO_NR_PALMT5_HOTSYNC_BUTTON_N, 1, "HotSync Button" }, | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | static struct gpio_keys_platform_data palmt5_pxa_keys_data = { | 
					
						
							|  |  |  | 	.buttons	= palmt5_pxa_buttons, | 
					
						
							|  |  |  | 	.nbuttons	= ARRAY_SIZE(palmt5_pxa_buttons), | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | static struct platform_device palmt5_pxa_keys = { | 
					
						
							|  |  |  | 	.name	= "gpio-keys", | 
					
						
							|  |  |  | 	.id	= -1, | 
					
						
							|  |  |  | 	.dev	= { | 
					
						
							|  |  |  | 		.platform_data = &palmt5_pxa_keys_data, | 
					
						
							|  |  |  | 	}, | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-07-13 08:16:45 +02:00
										 |  |  | static void __init palmt5_keys_init(void) | 
					
						
							| 
									
										
										
										
											2009-03-28 12:37:42 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2010-07-13 08:16:45 +02:00
										 |  |  | 	platform_device_register(&palmt5_pxa_keys); | 
					
						
							| 
									
										
										
										
											2009-03-28 12:37:42 +01:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2010-07-13 08:16:45 +02:00
										 |  |  | #else
 | 
					
						
							|  |  |  | static inline void palmt5_keys_init(void) {} | 
					
						
							|  |  |  | #endif
 | 
					
						
							| 
									
										
										
										
											2009-03-28 12:37:42 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-11-20 00:58:38 +01:00
										 |  |  | /******************************************************************************
 | 
					
						
							|  |  |  |  * Machine init | 
					
						
							|  |  |  |  ******************************************************************************/ | 
					
						
							| 
									
										
										
										
											2010-05-22 18:18:57 +01:00
										 |  |  | static void __init palmt5_reserve(void) | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2010-05-22 19:47:18 +01:00
										 |  |  | 	memblock_reserve(0xa0200000, 0x1000); | 
					
						
							| 
									
										
										
										
											2010-05-22 18:18:57 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-11-20 00:58:38 +01:00
										 |  |  | static void __init palmt5_init(void) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	pxa2xx_mfp_config(ARRAY_AND_SIZE(palmt5_pin_config)); | 
					
						
							| 
									
										
										
										
											2009-11-09 13:34:08 +08:00
										 |  |  | 	pxa_set_ffuart_info(NULL); | 
					
						
							|  |  |  | 	pxa_set_btuart_info(NULL); | 
					
						
							|  |  |  | 	pxa_set_stuart_info(NULL); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-07-13 08:16:45 +02:00
										 |  |  | 	palm27x_mmc_init(GPIO_NR_PALMT5_SD_DETECT_N, GPIO_NR_PALMT5_SD_READONLY, | 
					
						
							|  |  |  | 			GPIO_NR_PALMT5_SD_POWER, 0); | 
					
						
							|  |  |  | 	palm27x_pm_init(PALMT5_STR_BASE); | 
					
						
							|  |  |  | 	palm27x_lcd_init(-1, &palm_320x480_lcd_mode); | 
					
						
							|  |  |  | 	palm27x_udc_init(GPIO_NR_PALMT5_USB_DETECT_N, | 
					
						
							|  |  |  | 			GPIO_NR_PALMT5_USB_PULLUP, 1); | 
					
						
							|  |  |  | 	palm27x_irda_init(GPIO_NR_PALMT5_IR_DISABLE); | 
					
						
							|  |  |  | 	palm27x_ac97_init(PALMT5_BAT_MIN_VOLTAGE, PALMT5_BAT_MAX_VOLTAGE, | 
					
						
							|  |  |  | 			GPIO_NR_PALMT5_EARPHONE_DETECT, 95); | 
					
						
							|  |  |  | 	palm27x_pwm_init(GPIO_NR_PALMT5_BL_POWER, GPIO_NR_PALMT5_LCD_POWER); | 
					
						
							|  |  |  | 	palm27x_power_init(GPIO_NR_PALMT5_POWER_DETECT, -1); | 
					
						
							|  |  |  | 	palm27x_pmic_init(); | 
					
						
							|  |  |  | 	palmt5_kpc_init(); | 
					
						
							|  |  |  | 	palmt5_keys_init(); | 
					
						
							| 
									
										
										
										
											2008-11-20 00:58:38 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | MACHINE_START(PALMT5, "Palm Tungsten|T5") | 
					
						
							| 
									
										
										
										
											2011-07-05 22:38:15 -04:00
										 |  |  | 	.atag_offset	= 0x100, | 
					
						
							| 
									
										
										
										
											2010-10-11 02:20:19 +02:00
										 |  |  | 	.map_io		= pxa27x_map_io, | 
					
						
							| 
									
										
										
										
											2010-05-22 18:18:57 +01:00
										 |  |  | 	.reserve	= palmt5_reserve, | 
					
						
							| 
									
										
										
										
											2012-01-03 16:53:48 -06:00
										 |  |  | 	.nr_irqs	= PXA_NR_IRQS, | 
					
						
							| 
									
										
										
										
											2008-11-20 00:58:38 +01:00
										 |  |  | 	.init_irq	= pxa27x_init_irq, | 
					
						
							| 
									
										
										
										
											2011-05-18 21:30:04 +08:00
										 |  |  | 	.handle_irq	= pxa27x_handle_irq, | 
					
						
							| 
									
										
										
										
											2012-11-08 12:40:59 -07:00
										 |  |  | 	.init_time	= pxa_timer_init, | 
					
						
							| 
									
										
										
										
											2011-11-04 14:15:53 +00:00
										 |  |  | 	.init_machine	= palmt5_init, | 
					
						
							|  |  |  | 	.restart	= pxa_restart, | 
					
						
							| 
									
										
										
										
											2008-11-20 00:58:38 +01:00
										 |  |  | MACHINE_END |