sync hh.org
[hh.org.git] / include / asm-arm / arch-pxa / h2200-gpio.h
blob35f1576325c001f1aa40485bf2568bb1b557fb6a
1 /*
2 * include/asm-arm/arch-pxa/h2200-gpio.h
3 * History:
5 * 2003-12-08 Jamey Hicks Copied over h22xx gpio definitions and beginnings of h22xx (hamcop) asic declarations
6 * 2004-01-26 Michael Opdenacker Replaced "_H5200_GPIO_H_" by "_H2200_GPIO_H_"
7 * Added definition for IRQ_GPIO_H2200_ASIC_INT (like in h5400-gpio.h)
8 * 2004-02-05 Koen Kooi Added definition for IRQ_NR_H2200_CF_DETECT_N
9 */
11 #ifndef _H2200_GPIO_H_
12 #define _H2200_GPIO_H_
14 #define GET_H2200_GPIO(gpio) \
15 (GPLR(GPIO_NR_H2200_ ## gpio) & GPIO_bit(GPIO_NR_H2200_ ## gpio))
17 #define SET_H2200_GPIO(gpio, setp) \
18 do { \
19 if (setp) \
20 GPSR(GPIO_NR_H2200_ ## gpio) = GPIO_bit(GPIO_NR_H2200_ ## gpio); \
21 else \
22 GPCR(GPIO_NR_H2200_ ## gpio) = GPIO_bit(GPIO_NR_H2200_ ## gpio); \
23 } while (0)
25 #define SET_H2200_GPIO_N(gpio, setp) \
26 do { \
27 if (setp) \
28 GPCR(GPIO_NR_H2200_ ## gpio ## _N) = GPIO_bit(GPIO_NR_H2200_ ## gpio ## _N); \
29 else \
30 GPSR(GPIO_NR_H2200_ ## gpio ## _N) = GPIO_bit(GPIO_NR_H2200_ ## gpio ## _N); \
31 } while (0)
33 #define H2200_IRQ(gpio) \
34 IRQ_GPIO(GPIO_NR_H2200_ ## gpio)
36 #define GPIO_NR_H2200_POWER_BUTTON_N 0 /* really? */
37 #define GPIO_NR_H2200_RESET_BUTTON_N 1 /* really? */
38 #define GPIO_NR_H2200_BATT_DOOR_N 2
39 #define GPIO_NR_H2200_USB_DETECT_N 3
40 /* the following pin is connected to DCD signal on FFUART that is available
41 even when RS232 transceiver is powered off by GPIO80 (0-off; 1-active) */
42 #define GPIO_NR_H2200_RS232_DCD 4
43 #define GPIO_NR_H2200_ASIC_INT_N 5
44 #define GPIO_NR_H2200_CIR_SIR_N 6 /* high for 512Mb nand flash, low for 256Mb NAND flash (judging from the bootloader, the comment is correct, not the name) */
45 #define GPIO_NR_H2200_CF_INT_N 7
46 #define GPIO_NR_H2200_SD_DETECT_N 8
47 #define GPIO_NR_H2200_CF_DETECT_N 9
48 #define GPIO_NR_H2200_BT_WAKE 10 /* wakeup signal to bluetooth module */
49 /* 11 is 3.6MHz out; wince configures as output, alt func 1 */
50 #define GPIO_NR_H2200_AC_IN_N 12 /* AC adapter inserted */
51 #define GPIO_NR_H2200_POWER_ON_N 13 /* power on key signal input ? */
52 #define GPIO_NR_H2200_MQ1178_IRQ_N 14 /* interrupt request from mq11xx */
53 /* 15 is CS1# */
54 /* 16 is PWM0 if configured as an output, alt func 2 */
55 #define GPIO_NR_H2200_BACKLIGHT_ON 17
56 /* 18 is ext memory rdy, alternate function 2 */
57 #define GPIO_NR_H2200_CPU_200MHZ 19
58 /* 20 is dreq0 */
59 #define GPIO_NR_H2200_CHG_EN 21 /* connected to MAX1898 charger */
60 /* 22 video related??? */
61 #define GPIO_NR_H2200_CF_RESET 23
62 #define GPIO_NR_H2200_RS232_CIR_N 24 /* rs232 or CIR control signal selection: 1->RS232, 0->CIR */
63 #define GPIO_NR_H2200_CF_ADD_EN_N 25 /* !enable address to be driven to CF bus */
64 #define GPIO_NR_H2200_CF_POWER_EN 26 /* enable power to CF device */
65 #define GPIO_NR_H2200_CPU_400MHZ 27 /* see table below */
66 /*
67 * GPIO19 GPIO27 CPUSPEED
68 * 0 0 300MHz
69 * 1 0 400MHz
70 * 0 1 200MHz
71 * 1 1 reserved
74 /* 28 - 32 are AC97/I2S */
76 #define GPIO_NR_H2200_USB_PULL_UP_N 33
78 /* 34 - 41 FFUART, MMC (unused) */
79 /* 42 - 45 BTUART/HWUART */
80 /* 46 - 47 STUART/ICP */
81 /* 48 - 51 HWUART/memory controller */
82 /* 52 - 57 MMC (unused)/memory controller */
83 /* 58 - 59 LCD controller (unused) */
85 #define GPIO_NR_H2200_MQ1178_VDD 60 /* MediaQ 1178 VDD: Nominally 0 (?) */
86 #define GPIO_NR_H2200_SD_POWER_EN 61
87 #define GPIO_NR_H2200_BOOTLOADER_DETECT_N 62 /* boot loader detect input: Nominally 0*/
88 #define GPIO_NR_H2200_CF_BUFF_EN 63 /* enable CF buffers */
89 #define GPIO_NR_H2200_IR_ON_N 64
90 #define GPIO_NR_H2200_TDA_MODE 65 /* speaker mode control */
91 #define GPIO_NR_H2200_MIC_ON_N 66
92 #define GPIO_NR_H2200_MQ1178_POWER_ON 67 /* PDWN#/GPIO4 on MediaQ 1178: Nominally 1 */
93 #define GPIO_NR_H2200_MQ1178_RESET_N 68 /* Nominally 1 */
94 #define GPIO_NR_H2200_SPEAKER_ON 69
95 #define GPIO_NR_H2200_CODEC_ON 70
96 #define GPIO_NR_H2200_CODEC_RESET 71
97 #define GPIO_NR_H2200_CIR_RESET 72
98 #define GPIO_NR_H2200_CIR_POWER_ON 73 /* consumer IR power on */
99 #define GPIO_NR_H2200_BT_RESET_N 74 /* bluetooth module reset */
100 #define GPIO_NR_H2200_BT_IDENT 75 /* 0 -> SMART, 1->zeevo module */
101 #define GPIO_NR_H2200_BT_POWER_ON 76
102 #define GPIO_NR_H2200_BT_IRQ 77 /* wakeup signal from bluetooth to cpu */
103 /* 78 is CS2# */
104 #define GPIO_NR_H2200_SDRAM_128MB_N 79 /* 0 -> 128Mbit, 1 -> 256Mbit */
105 #define GPIO_NR_H2200_RS232_ON 80
106 /* 81 ??? */
107 /* 82 ??? */
108 /* 83 ??? */
110 #define IRQ_GPIO_H2200_ASIC_INT IRQ_GPIO(GPIO_NR_H2200_ASIC_INT_N)
112 #endif /* _H2200_GPIO_H */