sync hh.org
[hh.org.git] / include / asm-arm / arch-pxa / htcbeetles-gpio.h
blob9cb0265b0d5c070425b5e19176815a1f453ca7a0
1 /*
2 * include/asm-arm/arch-pxa/htcbeetles-gpio.h
3 * History:
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.
7 */
9 #ifndef _HTCBEETLES_GPIO_H_
10 #define _HTCBEETLES_GPIO_H_
12 #include <asm/arch/pxa-regs.h>
14 #define GET_HTCBEETLES_GPIO(gpio) \
15 (GPLR(GPIO_NR_HTCBEETLES_ ## gpio) & GPIO_bit(GPIO_NR_HTCBEETLES_ ## gpio))
17 #define SET_HTCBEETLES_GPIO(gpio, setp) \
18 do { \
19 if (setp) \
20 GPSR(GPIO_NR_HTCBEETLES_ ## gpio) = GPIO_bit(GPIO_NR_HTCBEETLES_ ## gpio); \
21 else \
22 GPCR(GPIO_NR_HTCBEETLES_ ## gpio) = GPIO_bit(GPIO_NR_HTCBEETLES_ ## gpio); \
23 } while (0)
25 #define SET_HTCBEETLES_GPIO_N(gpio, setp) \
26 do { \
27 if (setp) \
28 GPCR(GPIO_NR_HTCBEETLES_ ## gpio ## _N) = GPIO_bit(GPIO_NR_HTCBEETLES_ ## gpio ## _N); \
29 else \
30 GPSR(GPIO_NR_HTCBEETLES_ ## gpio ## _N) = GPIO_bit(GPIO_NR_HTCBEETLES_ ## gpio ## _N); \
31 } while (0)
33 #define HTCBEETLES_IRQ(gpio) \
34 IRQ_GPIO(GPIO_NR_HTCBEETLES_ ## gpio)
36 #define GPIO_NR_HTCBEETLES_KEY_ON_N 0
37 #define GPIO_NR_HTCBEETLES_GP_RST_N 1
39 #define GPIO_NR_HTCBEETLES_ASIC3_EXT_INT 9
40 #define GPIO_NR_HTCBEETLES_ASIC3_SDIO_INT_N 13
42 #define GPIO_NR_HTCBEETLES_TOUCHPANEL_IRQ_N 115
44 /* TODO: should be checked */
46 #define GPIO_NR_HTCBEETLES_TOUCHSCREEN_SPI_CLK_MD (23 | GPIO_ALT_FN_2_IN)
47 #define GPIO_NR_HTCBEETLES_TOUCHSCREEN_SPI_CS_N_MD (24 | GPIO_ALT_FN_2_IN)
48 #define GPIO_NR_HTCBEETLES_TOUCHSCREEN_SPI_DO_MD (25 | GPIO_ALT_FN_2_OUT)
49 #define GPIO_NR_HTCBEETLES_TOUCHSCREEN_SPI_DI_MD (26 | GPIO_ALT_FN_1_IN)
51 #define GPIO_NR_HTCBEETLES_I2S_BCK_MD (28 | GPIO_ALT_FN_1_OUT)
52 #define GPIO_NR_HTCBEETLES_I2S_DIN_MD (29 | GPIO_ALT_FN_2_IN)
53 #define GPIO_NR_HTCBEETLES_I2S_DOUT_MD (30 | GPIO_ALT_FN_1_OUT)
54 #define GPIO_NR_HTCBEETLES_I2S_SYNC_MD (31 | GPIO_ALT_FN_1_OUT)
56 #define GPIO_NR_HTCBEETLES_COM_RXD_MD (34 | GPIO_ALT_FN_1_IN)
57 #define GPIO_NR_HTCBEETLES_COM_CTS_MD (35 | GPIO_ALT_FN_1_IN)
59 #define GPIO_NR_HTCBEETLES_COM_TXD_MD (39 | GPIO_ALT_FN_2_OUT)
60 #define GPIO_NR_HTCBEETLES_COM_RTS_MD (41 | GPIO_ALT_FN_2_OUT)
62 #define GPIO_NR_HTCBEETLES_BT_RXD_MD (42 | GPIO_ALT_FN_1_IN)
63 #define GPIO_NR_HTCBEETLES_BT_TXD_MD (43 | GPIO_ALT_FN_2_OUT)
64 #define GPIO_NR_HTCBEETLES_BT_UART_CTS_MD (44 | GPIO_ALT_FN_1_IN)
65 #define GPIO_NR_HTCBEETLES_BT_UART_RTS_MD (45 | GPIO_ALT_FN_2_OUT)
67 #define GPIO_NR_HTCBEETLES_STD_RXD_MD (46 | GPIO_ALT_FN_2_IN)
68 #define GPIO_NR_HTCBEETLES_STD_TXD_MD (47 | GPIO_ALT_FN_1_OUT)
70 #define GPIO_NR_HTCBEETLES_POE_N_MD (48 | GPIO_ALT_FN_2_OUT | GPIO_DFLT_HIGH)
71 #define GPIO_NR_HTCBEETLES_PWE_N_MD (49 | GPIO_ALT_FN_2_OUT | GPIO_DFLT_HIGH)
73 #define GPIO_NR_HTCBEETLES_I2S_SYSCLK_MD (113 | GPIO_ALT_FN_1_OUT)
75 #define GPIO_NR_HTCBEETLES_PWM1OUT_MD (115 | GPIO_ALT_FN_3_OUT)
77 #define GPIO_NR_HTCBEETLES_I2C_SCL_MD (117 | GPIO_ALT_FN_1_OUT)
78 #define GPIO_NR_HTCBEETLES_I2C_SDA_MD (118 | GPIO_ALT_FN_1_OUT)
80 #endif /* _HTCBEETLES_GPIO_H */