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