2 * Hardware definitions for Palm LifeDrive
4 * Author: Marek Vasut <marek.vasut@gmail.com>
7 * Alex Osborne <ato@meshy.org>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
13 * (find more info at www.hackndev.com)
17 #include <linux/platform_device.h>
18 #include <linux/delay.h>
19 #include <linux/irq.h>
20 #include <linux/gpio_keys.h>
21 #include <linux/input.h>
22 #include <linux/pda_power.h>
23 #include <linux/pwm_backlight.h>
24 #include <linux/gpio.h>
25 #include <linux/wm97xx.h>
26 #include <linux/power_supply.h>
27 #include <linux/sysdev.h>
28 #include <linux/mtd/mtd.h>
29 #include <linux/mtd/partitions.h>
30 #include <linux/mtd/physmap.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/palmld.h>
40 #include <mach/pxafb.h>
41 #include <mach/irda.h>
42 #include <plat/pxa27x_keypad.h>
43 #include <mach/palmasoc.h>
44 #include <mach/palm27x.h>
49 /******************************************************************************
51 ******************************************************************************/
52 static unsigned long palmld_pin_config
[] __initdata
= {
60 GPIO14_GPIO
, /* SD detect */
61 GPIO114_GPIO
, /* SD power */
62 GPIO116_GPIO
, /* SD r/o switch */
66 GPIO29_AC97_SDATA_IN_0
,
67 GPIO30_AC97_SDATA_OUT
,
73 GPIO108_GPIO
, /* ir disable */
78 GPIO100_KP_MKIN_0
| WAKEUP_ON_LEVEL_HIGH
,
79 GPIO101_KP_MKIN_1
| WAKEUP_ON_LEVEL_HIGH
,
80 GPIO102_KP_MKIN_2
| WAKEUP_ON_LEVEL_HIGH
,
81 GPIO97_KP_MKIN_3
| WAKEUP_ON_LEVEL_HIGH
,
93 GPIO10_GPIO
, /* hotsync button */
94 GPIO12_GPIO
, /* power switch */
95 GPIO15_GPIO
, /* lock switch */
98 GPIO52_GPIO
, /* green led */
99 GPIO94_GPIO
, /* orange led */
112 GPIO36_GPIO
, /* wifi power */
113 GPIO38_GPIO
, /* wifi ready */
114 GPIO81_GPIO
, /* wifi reset */
121 GPIO98_GPIO
, /* HDD reset */
122 GPIO115_GPIO
, /* HDD power */
125 GPIO13_GPIO
, /* earphone detect */
128 /******************************************************************************
130 ******************************************************************************/
131 #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
132 static struct mtd_partition palmld_partitions
[] = {
135 .offset
= 0x00000000,
136 .size
= MTDPART_SIZ_FULL
,
141 static struct physmap_flash_data palmld_flash_data
[] = {
143 .width
= 2, /* bankwidth in bytes */
144 .parts
= palmld_partitions
,
145 .nr_parts
= ARRAY_SIZE(palmld_partitions
)
149 static struct resource palmld_flash_resource
= {
150 .start
= PXA_CS0_PHYS
,
151 .end
= PXA_CS0_PHYS
+ SZ_4M
- 1,
152 .flags
= IORESOURCE_MEM
,
155 static struct platform_device palmld_flash
= {
156 .name
= "physmap-flash",
158 .resource
= &palmld_flash_resource
,
161 .platform_data
= palmld_flash_data
,
165 static void __init
palmld_nor_init(void)
167 platform_device_register(&palmld_flash
);
170 static inline void palmld_nor_init(void) {}
173 /******************************************************************************
175 ******************************************************************************/
176 #if defined(CONFIG_KEYBOARD_PXA27x) || defined(CONFIG_KEYBOARD_PXA27x_MODULE)
177 static unsigned int palmld_matrix_keys
[] = {
183 KEY(1, 2, KEY_RIGHT
),
190 KEY(3, 1, KEY_ENTER
),
194 static struct pxa27x_keypad_platform_data palmld_keypad_platform_data
= {
195 .matrix_key_rows
= 4,
196 .matrix_key_cols
= 3,
197 .matrix_key_map
= palmld_matrix_keys
,
198 .matrix_key_map_size
= ARRAY_SIZE(palmld_matrix_keys
),
200 .debounce_interval
= 30,
203 static void __init
palmld_kpc_init(void)
205 pxa_set_keypad_info(&palmld_keypad_platform_data
);
208 static inline void palmld_kpc_init(void) {}
211 /******************************************************************************
213 ******************************************************************************/
214 #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
215 static struct gpio_keys_button palmld_pxa_buttons
[] = {
216 {KEY_F8
, GPIO_NR_PALMLD_HOTSYNC_BUTTON_N
, 1, "HotSync Button" },
217 {KEY_F9
, GPIO_NR_PALMLD_LOCK_SWITCH
, 0, "Lock Switch" },
218 {KEY_POWER
, GPIO_NR_PALMLD_POWER_SWITCH
, 0, "Power Switch" },
221 static struct gpio_keys_platform_data palmld_pxa_keys_data
= {
222 .buttons
= palmld_pxa_buttons
,
223 .nbuttons
= ARRAY_SIZE(palmld_pxa_buttons
),
226 static struct platform_device palmld_pxa_keys
= {
230 .platform_data
= &palmld_pxa_keys_data
,
234 static void __init
palmld_keys_init(void)
236 platform_device_register(&palmld_pxa_keys
);
239 static inline void palmld_keys_init(void) {}
242 /******************************************************************************
244 ******************************************************************************/
245 #if defined(CONFIG_LEDS_GPIO) || defined(CONFIG_LEDS_GPIO_MODULE)
246 struct gpio_led gpio_leds
[] = {
248 .name
= "palmld:green:led",
249 .default_trigger
= "none",
250 .gpio
= GPIO_NR_PALMLD_LED_GREEN
,
252 .name
= "palmld:amber:led",
253 .default_trigger
= "none",
254 .gpio
= GPIO_NR_PALMLD_LED_AMBER
,
258 static struct gpio_led_platform_data gpio_led_info
= {
260 .num_leds
= ARRAY_SIZE(gpio_leds
),
263 static struct platform_device palmld_leds
= {
267 .platform_data
= &gpio_led_info
,
271 static void __init
palmld_leds_init(void)
273 platform_device_register(&palmld_leds
);
276 static inline void palmld_leds_init(void) {}
279 /******************************************************************************
281 ******************************************************************************/
282 #if defined(CONFIG_PATA_PALMLD) || defined(CONFIG_PATA_PALMLD_MODULE)
283 static struct platform_device palmld_ide_device
= {
284 .name
= "pata_palmld",
288 static void __init
palmld_ide_init(void)
290 platform_device_register(&palmld_ide_device
);
293 static inline void palmld_ide_init(void) {}
296 /******************************************************************************
298 ******************************************************************************/
299 static struct map_desc palmld_io_desc
[] __initdata
= {
301 .virtual = PALMLD_IDE_VIRT
,
302 .pfn
= __phys_to_pfn(PALMLD_IDE_PHYS
),
303 .length
= PALMLD_IDE_SIZE
,
307 .virtual = PALMLD_USB_VIRT
,
308 .pfn
= __phys_to_pfn(PALMLD_USB_PHYS
),
309 .length
= PALMLD_USB_SIZE
,
314 static void __init
palmld_map_io(void)
317 iotable_init(palmld_io_desc
, ARRAY_SIZE(palmld_io_desc
));
320 static void __init
palmld_init(void)
322 pxa2xx_mfp_config(ARRAY_AND_SIZE(palmld_pin_config
));
323 pxa_set_ffuart_info(NULL
);
324 pxa_set_btuart_info(NULL
);
325 pxa_set_stuart_info(NULL
);
327 palm27x_mmc_init(GPIO_NR_PALMLD_SD_DETECT_N
, GPIO_NR_PALMLD_SD_READONLY
,
328 GPIO_NR_PALMLD_SD_POWER
, 0);
329 palm27x_pm_init(PALMLD_STR_BASE
);
330 palm27x_lcd_init(-1, &palm_320x480_lcd_mode
);
331 palm27x_irda_init(GPIO_NR_PALMLD_IR_DISABLE
);
332 palm27x_ac97_init(PALMLD_BAT_MIN_VOLTAGE
, PALMLD_BAT_MAX_VOLTAGE
,
333 GPIO_NR_PALMLD_EARPHONE_DETECT
, 95);
334 palm27x_pwm_init(GPIO_NR_PALMLD_BL_POWER
, GPIO_NR_PALMLD_LCD_POWER
);
335 palm27x_power_init(GPIO_NR_PALMLD_POWER_DETECT
,
336 GPIO_NR_PALMLD_USB_DETECT_N
);
345 MACHINE_START(PALMLD
, "Palm LifeDrive")
346 .boot_params
= 0xa0000100,
347 .map_io
= palmld_map_io
,
348 .init_irq
= pxa27x_init_irq
,
350 .init_machine
= palmld_init