1 /*
2  * GPIOs and interrupts for Palm T|X Handheld Computer
3  *
4  * Based on palmld-gpio.h by Alex Osborne
5  *
6  * Authors:	Marek Vasut <marek.vasut@gmail.com>
7  *		Cristiano P. <cristianop@users.sourceforge.net>
8  *		Jan Herman <2hp@seznam.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  */
15 
16 #ifndef _INCLUDE_PALMTX_H_
17 #define _INCLUDE_PALMTX_H_
18 
19 /** HERE ARE GPIOs **/
20 
21 /* GPIOs */
22 #define GPIO_NR_PALMTX_GPIO_RESET		1
23 
24 #define GPIO_NR_PALMTX_POWER_DETECT		12 /* 90 */
25 #define GPIO_NR_PALMTX_HOTSYNC_BUTTON_N		10
26 #define GPIO_NR_PALMTX_EARPHONE_DETECT		107
27 
28 /* SD/MMC */
29 #define GPIO_NR_PALMTX_SD_DETECT_N		14
30 #define GPIO_NR_PALMTX_SD_POWER			114 /* probably */
31 #define GPIO_NR_PALMTX_SD_READONLY		115 /* probably */
32 
33 /* TOUCHSCREEN */
34 #define GPIO_NR_PALMTX_WM9712_IRQ		27
35 
36 /* IRDA -  disable GPIO connected to SD pin of tranceiver (TFBS4710?) ? */
37 #define GPIO_NR_PALMTX_IR_DISABLE		40
38 
39 /* USB */
40 #define GPIO_NR_PALMTX_USB_DETECT_N		13
41 #define GPIO_NR_PALMTX_USB_PULLUP		93
42 
43 /* LCD/BACKLIGHT */
44 #define GPIO_NR_PALMTX_BL_POWER			84
45 #define GPIO_NR_PALMTX_LCD_POWER		96
46 
47 /* LCD BORDER */
48 #define GPIO_NR_PALMTX_BORDER_SWITCH		98
49 #define GPIO_NR_PALMTX_BORDER_SELECT		22
50 
51 /* BLUETOOTH */
52 #define GPIO_NR_PALMTX_BT_POWER			17
53 #define GPIO_NR_PALMTX_BT_RESET			83
54 
55 /* PCMCIA (WiFi) */
56 #define GPIO_NR_PALMTX_PCMCIA_POWER1		94
57 #define GPIO_NR_PALMTX_PCMCIA_POWER2		108
58 #define GPIO_NR_PALMTX_PCMCIA_RESET		79
59 #define GPIO_NR_PALMTX_PCMCIA_READY		116
60 
61 /* NAND Flash ... this GPIO may be incorrect! */
62 #define GPIO_NR_PALMTX_NAND_BUFFER_DIR		79
63 
64 /* INTERRUPTS */
65 #define IRQ_GPIO_PALMTX_SD_DETECT_N	IRQ_GPIO(GPIO_NR_PALMTX_SD_DETECT_N)
66 #define IRQ_GPIO_PALMTX_WM9712_IRQ	IRQ_GPIO(GPIO_NR_PALMTX_WM9712_IRQ)
67 #define IRQ_GPIO_PALMTX_USB_DETECT	IRQ_GPIO(GPIO_NR_PALMTX_USB_DETECT)
68 #define IRQ_GPIO_PALMTX_GPIO_RESET	IRQ_GPIO(GPIO_NR_PALMTX_GPIO_RESET)
69 
70 /** HERE ARE INIT VALUES **/
71 
72 /* Various addresses  */
73 #define PALMTX_PCMCIA_PHYS	0x28000000
74 #define PALMTX_PCMCIA_VIRT	0xf0000000
75 #define PALMTX_PCMCIA_SIZE	0x100000
76 
77 #define PALMTX_PHYS_RAM_START	0xa0000000
78 #define PALMTX_PHYS_IO_START	0x40000000
79 
80 #define PALMTX_STR_BASE		0xa0200000
81 
82 #define PALMTX_PHYS_FLASH_START	PXA_CS0_PHYS	/* ChipSelect 0 */
83 #define PALMTX_PHYS_NAND_START	PXA_CS1_PHYS	/* ChipSelect 1 */
84 
85 #define PALMTX_NAND_ALE_PHYS	(PALMTX_PHYS_NAND_START | (1 << 24))
86 #define PALMTX_NAND_CLE_PHYS	(PALMTX_PHYS_NAND_START | (1 << 25))
87 #define PALMTX_NAND_ALE_VIRT	0xff100000
88 #define PALMTX_NAND_CLE_VIRT	0xff200000
89 
90 /* TOUCHSCREEN */
91 #define AC97_LINK_FRAME			21
92 
93 
94 /* BATTERY */
95 #define PALMTX_BAT_MAX_VOLTAGE		4000	/* 4.00v current voltage */
96 #define PALMTX_BAT_MIN_VOLTAGE		3550	/* 3.55v critical voltage */
97 #define PALMTX_BAT_MAX_CURRENT		0	/* unknown */
98 #define PALMTX_BAT_MIN_CURRENT		0	/* unknown */
99 #define PALMTX_BAT_MAX_CHARGE		1	/* unknown */
100 #define PALMTX_BAT_MIN_CHARGE		1	/* unknown */
101 #define PALMTX_MAX_LIFE_MINS		360	/* on-life in minutes */
102 
103 #define PALMTX_BAT_MEASURE_DELAY	(HZ * 1)
104 
105 /* BACKLIGHT */
106 #define PALMTX_MAX_INTENSITY		0xFE
107 #define PALMTX_DEFAULT_INTENSITY	0x7E
108 #define PALMTX_LIMIT_MASK		0x7F
109 #define PALMTX_PRESCALER		0x3F
110 #define PALMTX_PERIOD_NS		3500
111 
112 #endif
113