2 * include/asm-arm/arch-pxa/htcmagician-gpio.h
5 * 2004-12-10 Michael Opdenacker. Wrote down GPIO settings as identified by Jamey Hicks.
6 * Reused the h2200-gpio.h file as a template.
9 #ifndef _HTCMAGICIAN_GPIO_H_
10 #define _HTCMAGICIAN_GPIO_H_
12 #include <asm/arch/pxa-regs.h>
14 #define GET_HTCMAGICIAN_GPIO(gpio) \
15 (GPLR(GPIO_NR_HTCMAGICIAN_ ## gpio) & GPIO_bit(GPIO_NR_HTCMAGICIAN_ ## gpio))
17 #define SET_HTCMAGICIAN_GPIO(gpio, setp) \
20 GPSR(GPIO_NR_HTCMAGICIAN_ ## gpio) = GPIO_bit(GPIO_NR_HTCMAGICIAN_ ## gpio); \
22 GPCR(GPIO_NR_HTCMAGICIAN_ ## gpio) = GPIO_bit(GPIO_NR_HTCMAGICIAN_ ## gpio); \
25 #define SET_HTCMAGICIAN_GPIO_N(gpio, setp) \
28 GPCR(GPIO_NR_HTCMAGICIAN_ ## gpio ## _N) = GPIO_bit(GPIO_NR_HTCMAGICIAN_ ## gpio ## _N); \
30 GPSR(GPIO_NR_HTCMAGICIAN_ ## gpio ## _N) = GPIO_bit(GPIO_NR_HTCMAGICIAN_ ## gpio ## _N); \
33 #define HTCMAGICIAN_IRQ(gpio) \
34 IRQ_GPIO(GPIO_NR_HTCMAGICIAN_ ## gpio)
36 #define GPIO_NR_HTCMAGICIAN_KEY_ON 0
37 #define GPIO_NR_HTCMAGICIAN_GP_RST_N 1
39 #define GPIO_NR_HTCMAGICIAN_USB_DET 9
40 #define GPIO_NR_HTCMAGICIAN_POWER_DET 10
42 #define GPIO_NR_HTCMAGICIAN_CIF_DD7 12
44 #define GPIO_NR_HTCMAGICIAN_SSPSFRM2 14
45 #define GPIO_NR_HTCMAGICIAN_CS1_N 15
47 #define GPIO_NR_HTCMAGICIAN_CIF_DD6 17
48 #define GPIO_NR_HTCMAGICIAN_RDY 18
50 #define GPIO_NR_HTCMAGICIAN_PHONE_START 19
52 #define GPIO_NR_HTCMAGICIAN_KP_MKOUT7 22
53 #define GPIO_NR_HTCMAGICIAN_SPI_CLK 23
54 #define GPIO_NR_HTCMAGICIAN_SPI_CS_N 24
55 #define GPIO_NR_HTCMAGICIAN_SPI_DO 25
56 #define GPIO_NR_HTCMAGICIAN_SPI_DI 26
58 #define GPIO_NR_HTCMAGICIAN_USBC_DETECT 27
59 #define GPIO_NR_HTCMAGICIAN_I2S_BCK 28
60 #define GPIO_NR_HTCMAGICIAN_I2S_DIN 29
61 #define GPIO_NR_HTCMAGICIAN_I2S_DOUT 30
62 #define GPIO_NR_HTCMAGICIAN_I2S_SYNC 31
64 #define GPIO_NR_HTCMAGICIAN_RS232_ON 32
65 #define GPIO_NR_HTCMAGICIAN_CS5_N 33
67 #define GPIO_NR_HTCMAGICIAN_COM_RXD 34
68 #define GPIO_NR_HTCMAGICIAN_COM_CTS 35
69 #define GPIO_NR_HTCMAGICIAN_KP_MKIN7 36 #COM_DCD
70 #define GPIO_NR_HTCMAGICIAN_KEY_PHONE_HANGUP 37
71 #define GPIO_NR_HTCMAGICIAN_KEY_CONTACTS 38
72 #define GPIO_NR_HTCMAGICIAN_COM_TXD 39
73 #define GPIO_NR_HTCMAGICIAN_KP_MKOUT6 40
74 #define GPIO_NR_HTCMAGICIAN_COM_RTS 41
75 #define GPIO_NR_HTCMAGICIAN_BT_RXD 42
76 #define GPIO_NR_HTCMAGICIAN_BT_TXD 43
77 #define GPIO_NR_HTCMAGICIAN_BT_UART_CTS 44
78 #define GPIO_NR_HTCMAGICIAN_BT_UART_RTS 45
80 #define GPIO_NR_HTCMAGICIAN_ST_RXD 46
81 #define GPIO_NR_HTCMAGICIAN_ST_TXD 47
83 #define GPIO_NR_HTCMAGICIAN_POE_N 48
84 #define GPIO_NR_HTCMAGICIAN_PWE_N 49
85 #define GPIO_NR_HTCMAGICIAN_CIF_DD3 50
86 #define GPIO_NR_HTCMAGICIAN_CIF_DD2 51
87 #define GPIO_NR_HTCMAGICIAN_CIF_DD4 52
89 #define GPIO_NR_HTCMAGICIAN_CIF_MCLK 53
90 #define GPIO_NR_HTCMAGICIAN_CIF_PCLK 54
91 #define GPIO_NR_HTCMAGICIAN_CIF_DD1 55
93 #define GPIO_NR_HTCMAGICIAN_LDD0 58
94 #define GPIO_NR_HTCMAGICIAN_LDD1 59
95 #define GPIO_NR_HTCMAGICIAN_LDD2 60
96 #define GPIO_NR_HTCMAGICIAN_LDD3 61
97 #define GPIO_NR_HTCMAGICIAN_LDD4 62
98 #define GPIO_NR_HTCMAGICIAN_LDD5 63
99 #define GPIO_NR_HTCMAGICIAN_LDD6 64
100 #define GPIO_NR_HTCMAGICIAN_LDD7 65
101 #define GPIO_NR_HTCMAGICIAN_LDD8 66
102 #define GPIO_NR_HTCMAGICIAN_LDD9 67
103 #define GPIO_NR_HTCMAGICIAN_LDD10 68
104 #define GPIO_NR_HTCMAGICIAN_LDD11 69
105 #define GPIO_NR_HTCMAGICIAN_LDD12 70
106 #define GPIO_NR_HTCMAGICIAN_LDD13 71
107 #define GPIO_NR_HTCMAGICIAN_LDD14 72
108 #define GPIO_NR_HTCMAGICIAN_LDD15 73
110 #define GPIO_NR_HTCMAGICIAN_LFCLK_RD 74
111 #define GPIO_NR_HTCMAGICIAN_LFCLK_A0 75
112 #define GPIO_NR_HTCMAGICIAN_LFCLK_WR 76
113 #define GPIO_NR_HTCMAGICIAN_LBIAS 77
115 #define GPIO_NR_HTCMAGICIAN_CS2_N 78
116 #define GPIO_NR_HTCMAGICIAN_CS3_N 79
117 #define GPIO_NR_HTCMAGICIAN_CS4_N 80
118 #define GPIO_NR_HTCMAGICIAN_CIF_DD0 81
119 #define GPIO_NR_HTCMAGICIAN_CIF_DD5 82
121 #define GPIO_NR_HTCMAGICIAN_IR_ON 83
123 #define GPIO_NR_HTCMAGICIAN_CIF_LV 84
124 #define GPIO_NR_HTCMAGICIAN_CIF_FV 85
126 #define GPIO_NR_HTCMAGICIAN_LCD1 86
127 #define GPIO_NR_HTCMAGICIAN_LCD2 87
129 #define GPIO_NR_HTCMAGICIAN_KEY_CALENDAR 90
130 #define GPIO_NR_HTCMAGICIAN_KEY_CAMERA 91
131 #define GPIO_NR_HTCMAGICIAN_KEY_UP 93
132 #define GPIO_NR_HTCMAGICIAN_KEY_DOWN 94
133 #define GPIO_NR_HTCMAGICIAN_KEY_LEFT 95
134 #define GPIO_NR_HTCMAGICIAN_KEY_RIGHT 96
135 #define GPIO_NR_HTCMAGICIAN_KEY_ENTER 97
136 #define GPIO_NR_HTCMAGICIAN_KEY_RECORD 98
137 #define GPIO_NR_HTCMAGICIAN_HEADPHONE_IN 99
138 #define GPIO_NR_HTCMAGICIAN_KEY_VOLUMEUP 100
139 #define GPIO_NR_HTCMAGICIAN_KEY_VOLUMEDOWN 101
140 #define GPIO_NR_HTCMAGICIAN_KEY_PHONE_LIFT 102
141 #define GPIO_NR_HTCMAGICIAN_KP_MKOUT0 103
142 #define GPIO_NR_HTCMAGICIAN_KP_MKOUT1 104
143 #define GPIO_NR_HTCMAGICIAN_KP_MKOUT2 105
144 #define GPIO_NR_HTCMAGICIAN_KP_MKOUT3 106
145 #define GPIO_NR_HTCMAGICIAN_KP_MKOUT4 107
146 #define GPIO_NR_HTCMAGICIAN_KP_MKOUT5 108
148 #define GPIO_NR_HTCMAGICIAN_PHONE_OFF 110
150 #define GPIO_NR_HTCMAGICIAN_USB_PUEN 112
151 #define GPIO_NR_HTCMAGICIAN_I2S_SYSCLK 113
153 //#define GPIO_NR_HTCMAGICIAN_PWM_OUT1 115
154 //#define GPIO_NR_HTCMAGICIAN_TOUCHSCREEN_PEN 115
155 #define GPIO_NR_HTCMAGICIAN_TOUCHPANEL_IRQ_N 115
157 #define GPIO_NR_HTCMAGICIAN_I2C_SCL 117
158 #define GPIO_NR_HTCMAGICIAN_I2C_SDA 118
161 #define GPIO_NR_HTCMAGICIAN_WLAN_IRQ_N
162 #define GPIO_NR_HTCMAGICIAN_CPU_BATT_FAULT_N
163 #define GPIO_NR_HTCMAGICIAN_LCD_RESET_N
164 #define GPIO_NR_HTCMAGICIAN_ASIC3_RESET_N
165 #define GPIO_NR_HTCMAGICIAN_CHARGE_EN_N
166 #define GPIO_NR_HTCMAGICIAN_EARPHONE_DET_N
167 #define GPIO_NR_HTCMAGICIAN_USB_PUEN
168 #define GPIO_NR_HTCMAGICIAN_WLAN_RESET_N
169 #define GPIO_NR_HTCMAGICIAN_FLASH_VPEN
170 #define GPIO_NR_HTCMAGICIAN_BATT_OFF
171 #define GPIO_NR_HTCMAGICIAN_USB_CHARGE_RATE
172 #define GPIO_NR_HTCMAGICIAN_BL_DETECT_N
173 #define GPIO_NR_HTCMAGICIAN_AUTO_SENSE /* to backlight circuit */
174 #define GPIO_NR_HTCMAGICIAN_LCD_LVDD_3V3_ON
175 #define GPIO_NR_HTCMAGICIAN_LCD_AVDD_3V3_ON
176 #define GPIO_NR_HTCMAGICIAN_LCD_N2V7_7V3_ON
177 #define GPIO_NR_HTCMAGICIAN_USB2_DREQ
178 #define GPIO_NR_HTCMAGICIAN_CPU_HW_RESET_N
181 /* TODO: should be checked */
183 #define GPIO_NR_HTCMAGICIAN_TOUCHSCREEN_SPI_CLK_MD (23 | GPIO_ALT_FN_2_IN)
184 #define GPIO_NR_HTCMAGICIAN_TOUCHSCREEN_SPI_CS_N_MD (24 | GPIO_ALT_FN_2_IN)
185 #define GPIO_NR_HTCMAGICIAN_TOUCHSCREEN_SPI_DO_MD (25 | GPIO_ALT_FN_2_OUT)
186 #define GPIO_NR_HTCMAGICIAN_TOUCHSCREEN_SPI_DI_MD (26 | GPIO_ALT_FN_1_IN)
188 #define GPIO_NR_HTCMAGICIAN_I2S_BCK_MD (28 | GPIO_ALT_FN_1_OUT)
189 #define GPIO_NR_HTCMAGICIAN_I2S_DIN_MD (29 | GPIO_ALT_FN_2_IN)
190 #define GPIO_NR_HTCMAGICIAN_I2S_DOUT_MD (30 | GPIO_ALT_FN_1_OUT)
191 #define GPIO_NR_HTCMAGICIAN_I2S_SYNC_MD (31 | GPIO_ALT_FN_1_OUT)
193 #define GPIO_NR_HTCMAGICIAN_COM_RXD_MD (34 | GPIO_ALT_FN_1_IN)
194 #define GPIO_NR_HTCMAGICIAN_COM_CTS_MD (35 | GPIO_ALT_FN_1_IN)
196 #define GPIO_NR_HTCMAGICIAN_COM_TXD_MD (39 | GPIO_ALT_FN_2_OUT)
197 #define GPIO_NR_HTCMAGICIAN_COM_RTS_MD (41 | GPIO_ALT_FN_2_OUT)
199 #define GPIO_NR_HTCMAGICIAN_BT_RXD_MD (42 | GPIO_ALT_FN_1_IN)
200 #define GPIO_NR_HTCMAGICIAN_BT_TXD_MD (43 | GPIO_ALT_FN_2_OUT)
201 #define GPIO_NR_HTCMAGICIAN_BT_UART_CTS_MD (44 | GPIO_ALT_FN_1_IN)
202 #define GPIO_NR_HTCMAGICIAN_BT_UART_RTS_MD (45 | GPIO_ALT_FN_2_OUT)
204 #define GPIO_NR_HTCMAGICIAN_STD_RXD_MD (46 | GPIO_ALT_FN_2_IN)
205 #define GPIO_NR_HTCMAGICIAN_STD_TXD_MD (47 | GPIO_ALT_FN_1_OUT)
207 #define GPIO_NR_HTCMAGICIAN_POE_N_MD (48 | GPIO_ALT_FN_2_OUT | GPIO_DFLT_HIGH)
208 #define GPIO_NR_HTCMAGICIAN_PWE_N_MD (49 | GPIO_ALT_FN_2_OUT | GPIO_DFLT_HIGH)
210 #define GPIO_NR_HTCMAGICIAN_I2S_SYSCLK_MD (113 | GPIO_ALT_FN_1_OUT)
212 #define GPIO_NR_HTCMAGICIAN_PWM1OUT_MD (115 | GPIO_ALT_FN_3_OUT)
214 #define GPIO_NR_HTCMAGICIAN_I2C_SCL_MD (117 | GPIO_ALT_FN_1_OUT)
215 #define GPIO_NR_HTCMAGICIAN_I2C_SDA_MD (118 | GPIO_ALT_FN_1_OUT)
217 #endif /* _HTCMAGICIAN_GPIO_H */