]> err.no Git - linux-2.6/blob - include/asm-arm/arch-pxa/magician.h
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
[linux-2.6] / include / asm-arm / arch-pxa / magician.h
1 /*
2  * GPIO and IRQ definitions for HTC Magician PDA phones
3  *
4  * Copyright (c) 2007 Philipp Zabel
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License version 2 as
8  * published by the Free Software Foundation.
9  *
10  */
11
12 #ifndef _MAGICIAN_H_
13 #define _MAGICIAN_H_
14
15 #include <asm/arch/irqs.h>
16 #include <asm/arch/pxa2xx-gpio.h>
17
18 /*
19  * PXA GPIOs
20  */
21
22 #define GPIO0_MAGICIAN_KEY_POWER                0
23 #define GPIO9_MAGICIAN_UNKNOWN                  9
24 #define GPIO10_MAGICIAN_GSM_IRQ                 10
25 #define GPIO11_MAGICIAN_GSM_OUT1                11
26 #define GPIO13_MAGICIAN_CPLD_IRQ                13
27 #define GPIO18_MAGICIAN_UNKNOWN                 18
28 #define GPIO22_MAGICIAN_VIBRA_EN                22
29 #define GPIO26_MAGICIAN_GSM_POWER               26
30 #define GPIO27_MAGICIAN_USBC_PUEN               27
31 #define GPIO30_MAGICIAN_nCHARGE_EN              30
32 #define GPIO37_MAGICIAN_KEY_HANGUP              37
33 #define GPIO38_MAGICIAN_KEY_CONTACTS            38
34 #define GPIO40_MAGICIAN_GSM_OUT2                40
35 #define GPIO48_MAGICIAN_UNKNOWN                 48
36 #define GPIO56_MAGICIAN_UNKNOWN                 56
37 #define GPIO57_MAGICIAN_CAM_RESET               57
38 #define GPIO75_MAGICIAN_SAMSUNG_POWER           75
39 #define GPIO83_MAGICIAN_nIR_EN                  83
40 #define GPIO86_MAGICIAN_GSM_RESET               86
41 #define GPIO87_MAGICIAN_GSM_SELECT              87
42 #define GPIO90_MAGICIAN_KEY_CALENDAR            90
43 #define GPIO91_MAGICIAN_KEY_CAMERA              91
44 #define GPIO93_MAGICIAN_KEY_UP                  93
45 #define GPIO94_MAGICIAN_KEY_DOWN                94
46 #define GPIO95_MAGICIAN_KEY_LEFT                95
47 #define GPIO96_MAGICIAN_KEY_RIGHT               96
48 #define GPIO97_MAGICIAN_KEY_ENTER               97
49 #define GPIO98_MAGICIAN_KEY_RECORD              98
50 #define GPIO99_MAGICIAN_HEADPHONE_IN            99
51 #define GPIO100_MAGICIAN_KEY_VOL_UP             100
52 #define GPIO101_MAGICIAN_KEY_VOL_DOWN           101
53 #define GPIO102_MAGICIAN_KEY_PHONE              102
54 #define GPIO103_MAGICIAN_LED_KP                 103
55 #define GPIO104_MAGICIAN_LCD_POWER_1            104
56 #define GPIO105_MAGICIAN_LCD_POWER_2            105
57 #define GPIO106_MAGICIAN_LCD_POWER_3            106
58 #define GPIO107_MAGICIAN_DS1WM_IRQ              107
59 #define GPIO108_MAGICIAN_GSM_READY              108
60 #define GPIO114_MAGICIAN_UNKNOWN                114
61 #define GPIO115_MAGICIAN_nPEN_IRQ               115
62 #define GPIO116_MAGICIAN_nCAM_EN                116
63 #define GPIO119_MAGICIAN_UNKNOWN                119
64 #define GPIO120_MAGICIAN_UNKNOWN                120
65
66 /*
67  * PXA GPIO alternate function mode & direction
68  */
69
70 #define GPIO0_MAGICIAN_KEY_POWER_MD             (0 | GPIO_IN)
71 #define GPIO9_MAGICIAN_UNKNOWN_MD               (9 | GPIO_IN)
72 #define GPIO10_MAGICIAN_GSM_IRQ_MD              (10 | GPIO_IN)
73 #define GPIO11_MAGICIAN_GSM_OUT1_MD             (11 | GPIO_OUT)
74 #define GPIO13_MAGICIAN_CPLD_IRQ_MD             (13 | GPIO_IN)
75 #define GPIO18_MAGICIAN_UNKNOWN_MD              (18 | GPIO_OUT)
76 #define GPIO22_MAGICIAN_VIBRA_EN_MD             (22 | GPIO_OUT)
77 #define GPIO26_MAGICIAN_GSM_POWER_MD            (26 | GPIO_OUT)
78 #define GPIO27_MAGICIAN_USBC_PUEN_MD            (27 | GPIO_OUT)
79 #define GPIO30_MAGICIAN_nCHARGE_EN_MD           (30 | GPIO_OUT)
80 #define GPIO37_MAGICIAN_KEY_HANGUP_MD           (37 | GPIO_OUT)
81 #define GPIO38_MAGICIAN_KEY_CONTACTS_MD         (38 | GPIO_OUT)
82 #define GPIO40_MAGICIAN_GSM_OUT2_MD             (40 | GPIO_OUT)
83 #define GPIO48_MAGICIAN_UNKNOWN_MD              (48 | GPIO_OUT)
84 #define GPIO56_MAGICIAN_UNKNOWN_MD              (56 | GPIO_OUT)
85 #define GPIO57_MAGICIAN_CAM_RESET_MD            (57 | GPIO_OUT)
86 #define GPIO75_MAGICIAN_SAMSUNG_POWER_MD        (75 | GPIO_OUT)
87 #define GPIO83_MAGICIAN_nIR_EN_MD               (83 | GPIO_OUT)
88 #define GPIO86_MAGICIAN_GSM_RESET_MD            (86 | GPIO_OUT)
89 #define GPIO87_MAGICIAN_GSM_SELECT_MD           (87 | GPIO_OUT)
90 #define GPIO90_MAGICIAN_KEY_CALENDAR_MD         (90 | GPIO_OUT)
91 #define GPIO91_MAGICIAN_KEY_CAMERA_MD           (91 | GPIO_OUT)
92 #define GPIO93_MAGICIAN_KEY_UP_MD               (93 | GPIO_IN)
93 #define GPIO94_MAGICIAN_KEY_DOWN_MD             (94 | GPIO_IN)
94 #define GPIO95_MAGICIAN_KEY_LEFT_MD             (95 | GPIO_IN)
95 #define GPIO96_MAGICIAN_KEY_RIGHT_MD            (96 | GPIO_IN)
96 #define GPIO97_MAGICIAN_KEY_ENTER_MD            (97 | GPIO_IN)
97 #define GPIO98_MAGICIAN_KEY_RECORD_MD           (98 | GPIO_IN)
98 #define GPIO99_MAGICIAN_HEADPHONE_IN_MD         (99 | GPIO_IN)
99 #define GPIO100_MAGICIAN_KEY_VOL_UP_MD          (100 | GPIO_IN)
100 #define GPIO101_MAGICIAN_KEY_VOL_DOWN_MD        (101 | GPIO_IN)
101 #define GPIO102_MAGICIAN_KEY_PHONE_MD           (102 | GPIO_IN)
102 #define GPIO103_MAGICIAN_LED_KP_MD              (103 | GPIO_OUT)
103 #define GPIO104_MAGICIAN_LCD_POWER_1_MD         (104 | GPIO_OUT)
104 #define GPIO105_MAGICIAN_LCD_POWER_2_MD         (105 | GPIO_OUT)
105 #define GPIO106_MAGICIAN_LCD_POWER_3_MD         (106 | GPIO_OUT)
106 #define GPIO107_MAGICIAN_DS1WM_IRQ_MD           (107 | GPIO_IN)
107 #define GPIO108_MAGICIAN_GSM_READY_MD           (108 | GPIO_IN)
108 #define GPIO114_MAGICIAN_UNKNOWN_MD             (114 | GPIO_OUT)
109 #define GPIO115_MAGICIAN_nPEN_IRQ_MD            (115 | GPIO_IN)
110 #define GPIO116_MAGICIAN_nCAM_EN_MD             (116 | GPIO_OUT)
111 #define GPIO119_MAGICIAN_UNKNOWN_MD             (119 | GPIO_OUT)
112 #define GPIO120_MAGICIAN_UNKNOWN_MD             (120 | GPIO_OUT)
113
114 /*
115  * CPLD IRQs
116  */
117
118 #define IRQ_MAGICIAN_SD         (IRQ_BOARD_START + 0)
119 #define IRQ_MAGICIAN_EP         (IRQ_BOARD_START + 1)
120 #define IRQ_MAGICIAN_BT         (IRQ_BOARD_START + 2)
121 #define IRQ_MAGICIAN_AC         (IRQ_BOARD_START + 3)
122
123 /*
124  * CPLD EGPIOs
125  */
126
127 #define MAGICIAN_EGPIO_BASE                     0x80 /* GPIO_BOARD_START */
128 #define MAGICIAN_EGPIO(reg,bit) \
129         (MAGICIAN_EGPIO_BASE + 8*reg + bit)
130
131 /* output */
132
133 #define EGPIO_MAGICIAN_TOPPOLY_POWER            MAGICIAN_EGPIO(0, 2)
134 #define EGPIO_MAGICIAN_LED_POWER                MAGICIAN_EGPIO(0, 5)
135 #define EGPIO_MAGICIAN_GSM_RESET                MAGICIAN_EGPIO(0, 6)
136 #define EGPIO_MAGICIAN_LCD_POWER                MAGICIAN_EGPIO(0, 7)
137 #define EGPIO_MAGICIAN_SPK_POWER                MAGICIAN_EGPIO(1, 0)
138 #define EGPIO_MAGICIAN_EP_POWER                 MAGICIAN_EGPIO(1, 1)
139 #define EGPIO_MAGICIAN_IN_SEL0                  MAGICIAN_EGPIO(1, 2)
140 #define EGPIO_MAGICIAN_IN_SEL1                  MAGICIAN_EGPIO(1, 3)
141 #define EGPIO_MAGICIAN_MIC_POWER                MAGICIAN_EGPIO(1, 4)
142 #define EGPIO_MAGICIAN_CODEC_RESET              MAGICIAN_EGPIO(1, 5)
143 #define EGPIO_MAGICIAN_CODEC_POWER              MAGICIAN_EGPIO(1, 6)
144 #define EGPIO_MAGICIAN_BL_POWER                 MAGICIAN_EGPIO(1, 7)
145 #define EGPIO_MAGICIAN_SD_POWER                 MAGICIAN_EGPIO(2, 0)
146 #define EGPIO_MAGICIAN_CARKIT_MIC               MAGICIAN_EGPIO(2, 1)
147 #define EGPIO_MAGICIAN_UNKNOWN_WAVEDEV_DLL      MAGICIAN_EGPIO(2, 2)
148 #define EGPIO_MAGICIAN_FLASH_VPP                MAGICIAN_EGPIO(2, 3)
149 #define EGPIO_MAGICIAN_BL_POWER2                MAGICIAN_EGPIO(2, 4)
150 #define EGPIO_MAGICIAN_CHARGE_EN                MAGICIAN_EGPIO(2, 5)
151 #define EGPIO_MAGICIAN_GSM_POWER                MAGICIAN_EGPIO(2, 7)
152
153 /* input */
154
155 #define EGPIO_MAGICIAN_CABLE_STATE_AC           MAGICIAN_EGPIO(4, 0)
156 #define EGPIO_MAGICIAN_CABLE_STATE_USB          MAGICIAN_EGPIO(4, 1)
157
158 #define EGPIO_MAGICIAN_BOARD_ID0                MAGICIAN_EGPIO(5, 0)
159 #define EGPIO_MAGICIAN_BOARD_ID1                MAGICIAN_EGPIO(5, 1)
160 #define EGPIO_MAGICIAN_BOARD_ID2                MAGICIAN_EGPIO(5, 2)
161 #define EGPIO_MAGICIAN_LCD_SELECT               MAGICIAN_EGPIO(5, 3)
162 #define EGPIO_MAGICIAN_nSD_READONLY             MAGICIAN_EGPIO(5, 4)
163
164 #define EGPIO_MAGICIAN_EP_INSERT                MAGICIAN_EGPIO(6, 1)
165
166 #endif /* _MAGICIAN_H_ */