2 * Hardware definitions for Palm Tungsten|T5
4 * Author: Marek Vasut <marek.vasut@gmail.com>
7 * Ales Snuparek <snuparek@atlas.cz>
8 * Justin Kendrick <twilightsentry@gmail.com>
9 * RichardT5 <richard_t5@users.sourceforge.net>
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License version 2 as
13 * published by the Free Software Foundation.
15 * (find more info at www.hackndev.com)
19 #include <linux/platform_device.h>
20 #include <linux/delay.h>
21 #include <linux/irq.h>
22 #include <linux/gpio_keys.h>
23 #include <linux/input.h>
24 #include <linux/memblock.h>
25 #include <linux/pda_power.h>
26 #include <linux/pwm_backlight.h>
27 #include <linux/gpio.h>
28 #include <linux/wm97xx.h>
29 #include <linux/power_supply.h>
30 #include <linux/usb/gpio_vbus.h>
32 #include <asm/mach-types.h>
33 #include <asm/mach/arch.h>
34 #include <asm/mach/map.h>
36 #include <mach/pxa27x.h>
37 #include <mach/audio.h>
38 #include <mach/palmt5.h>
40 #include <mach/pxafb.h>
41 #include <mach/irda.h>
42 #include <plat/pxa27x_keypad.h>
44 #include <mach/palmasoc.h>
45 #include <mach/palm27x.h>
50 /******************************************************************************
52 ******************************************************************************/
53 static unsigned long palmt5_pin_config
[] __initdata
= {
61 GPIO14_GPIO
, /* SD detect */
62 GPIO114_GPIO
, /* SD power */
63 GPIO115_GPIO
, /* SD r/o switch */
67 GPIO29_AC97_SDATA_IN_0
,
68 GPIO30_AC97_SDATA_OUT
,
74 GPIO40_GPIO
, /* ir disable */
79 GPIO15_GPIO
, /* usb detect */
80 GPIO93_GPIO
, /* usb power */
83 GPIO100_KP_MKIN_0
| WAKEUP_ON_LEVEL_HIGH
,
84 GPIO101_KP_MKIN_1
| WAKEUP_ON_LEVEL_HIGH
,
85 GPIO102_KP_MKIN_2
| WAKEUP_ON_LEVEL_HIGH
,
86 GPIO97_KP_MKIN_3
| WAKEUP_ON_LEVEL_HIGH
,
102 GPIO10_GPIO
, /* hotsync button */
103 GPIO90_GPIO
, /* power detect */
104 GPIO107_GPIO
, /* earphone detect */
107 /******************************************************************************
109 ******************************************************************************/
110 #if defined(CONFIG_KEYBOARD_PXA27x) || defined(CONFIG_KEYBOARD_PXA27x_MODULE)
111 static unsigned int palmt5_matrix_keys
[] = {
112 KEY(0, 0, KEY_POWER
),
114 KEY(0, 2, KEY_ENTER
),
123 KEY(3, 0, KEY_RIGHT
),
127 static struct pxa27x_keypad_platform_data palmt5_keypad_platform_data
= {
128 .matrix_key_rows
= 4,
129 .matrix_key_cols
= 3,
130 .matrix_key_map
= palmt5_matrix_keys
,
131 .matrix_key_map_size
= ARRAY_SIZE(palmt5_matrix_keys
),
133 .debounce_interval
= 30,
136 static void __init
palmt5_kpc_init(void)
138 pxa_set_keypad_info(&palmt5_keypad_platform_data
);
141 static inline void palmt5_kpc_init(void) {}
144 /******************************************************************************
146 ******************************************************************************/
147 #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
148 static struct gpio_keys_button palmt5_pxa_buttons
[] = {
149 {KEY_F8
, GPIO_NR_PALMT5_HOTSYNC_BUTTON_N
, 1, "HotSync Button" },
152 static struct gpio_keys_platform_data palmt5_pxa_keys_data
= {
153 .buttons
= palmt5_pxa_buttons
,
154 .nbuttons
= ARRAY_SIZE(palmt5_pxa_buttons
),
157 static struct platform_device palmt5_pxa_keys
= {
161 .platform_data
= &palmt5_pxa_keys_data
,
165 static void __init
palmt5_keys_init(void)
167 platform_device_register(&palmt5_pxa_keys
);
170 static inline void palmt5_keys_init(void) {}
173 /******************************************************************************
175 ******************************************************************************/
176 static void __init
palmt5_reserve(void)
178 memblock_reserve(0xa0200000, 0x1000);
181 static void __init
palmt5_init(void)
183 pxa2xx_mfp_config(ARRAY_AND_SIZE(palmt5_pin_config
));
184 pxa_set_ffuart_info(NULL
);
185 pxa_set_btuart_info(NULL
);
186 pxa_set_stuart_info(NULL
);
188 palm27x_mmc_init(GPIO_NR_PALMT5_SD_DETECT_N
, GPIO_NR_PALMT5_SD_READONLY
,
189 GPIO_NR_PALMT5_SD_POWER
, 0);
190 palm27x_pm_init(PALMT5_STR_BASE
);
191 palm27x_lcd_init(-1, &palm_320x480_lcd_mode
);
192 palm27x_udc_init(GPIO_NR_PALMT5_USB_DETECT_N
,
193 GPIO_NR_PALMT5_USB_PULLUP
, 1);
194 palm27x_irda_init(GPIO_NR_PALMT5_IR_DISABLE
);
195 palm27x_ac97_init(PALMT5_BAT_MIN_VOLTAGE
, PALMT5_BAT_MAX_VOLTAGE
,
196 GPIO_NR_PALMT5_EARPHONE_DETECT
, 95);
197 palm27x_pwm_init(GPIO_NR_PALMT5_BL_POWER
, GPIO_NR_PALMT5_LCD_POWER
);
198 palm27x_power_init(GPIO_NR_PALMT5_POWER_DETECT
, -1);
204 MACHINE_START(PALMT5
, "Palm Tungsten|T5")
205 .boot_params
= 0xa0000100,
206 .map_io
= pxa27x_map_io
,
207 .reserve
= palmt5_reserve
,
208 .init_irq
= pxa27x_init_irq
,
209 .handle_irq
= pxa27x_handle_irq
,
211 .init_machine
= palmt5_init