summaryrefslogtreecommitdiffstats
path: root/include/asm-arm/arch-pxa/magician.h
blob: b34fd5683e2d20876805e6b7abe25a8708babced (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
/*
 * GPIO and IRQ definitions for HTC Magician PDA phones
 *
 * Copyright (c) 2007 Philipp Zabel
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 *
 */

#ifndef _MAGICIAN_H_
#define _MAGICIAN_H_

#include <asm/arch/irqs.h>
#include <asm/arch/pxa2xx-gpio.h>

/*
 * PXA GPIOs
 */

#define GPIO0_MAGICIAN_KEY_POWER		0
#define GPIO9_MAGICIAN_UNKNOWN			9
#define GPIO10_MAGICIAN_GSM_IRQ			10
#define GPIO11_MAGICIAN_GSM_OUT1		11
#define GPIO13_MAGICIAN_CPLD_IRQ		13
#define GPIO18_MAGICIAN_UNKNOWN			18
#define GPIO22_MAGICIAN_VIBRA_EN		22
#define GPIO26_MAGICIAN_GSM_POWER		26
#define GPIO27_MAGICIAN_USBC_PUEN		27
#define GPIO30_MAGICIAN_nCHARGE_EN		30
#define GPIO37_MAGICIAN_KEY_HANGUP		37
#define GPIO38_MAGICIAN_KEY_CONTACTS		38
#define GPIO40_MAGICIAN_GSM_OUT2		40
#define GPIO48_MAGICIAN_UNKNOWN			48
#define GPIO56_MAGICIAN_UNKNOWN			56
#define GPIO57_MAGICIAN_CAM_RESET		57
#define GPIO75_MAGICIAN_SAMSUNG_POWER		75
#define GPIO83_MAGICIAN_nIR_EN			83
#define GPIO86_MAGICIAN_GSM_RESET		86
#define GPIO87_MAGICIAN_GSM_SELECT		87
#define GPIO90_MAGICIAN_KEY_CALENDAR		90
#define GPIO91_MAGICIAN_KEY_CAMERA		91
#define GPIO93_MAGICIAN_KEY_UP			93
#define GPIO94_MAGICIAN_KEY_DOWN		94
#define GPIO95_MAGICIAN_KEY_LEFT		95
#define GPIO96_MAGICIAN_KEY_RIGHT		96
#define GPIO97_MAGICIAN_KEY_ENTER		97
#define GPIO98_MAGICIAN_KEY_RECORD		98
#define GPIO99_MAGICIAN_HEADPHONE_IN		99
#define GPIO100_MAGICIAN_KEY_VOL_UP		100
#define GPIO101_MAGICIAN_KEY_VOL_DOWN 		101
#define GPIO102_MAGICIAN_KEY_PHONE		102
#define GPIO103_MAGICIAN_LED_KP			103
#define GPIO104_MAGICIAN_LCD_POWER_1 		104
#define GPIO105_MAGICIAN_LCD_POWER_2		105
#define GPIO106_MAGICIAN_LCD_POWER_3		106
#define GPIO107_MAGICIAN_DS1WM_IRQ		107
#define GPIO108_MAGICIAN_GSM_READY		108
#define GPIO114_MAGICIAN_UNKNOWN		114
#define GPIO115_MAGICIAN_nPEN_IRQ		115
#define GPIO116_MAGICIAN_nCAM_EN		116
#define GPIO119_MAGICIAN_UNKNOWN		119
#define GPIO120_MAGICIAN_UNKNOWN		120

/*
 * PXA GPIO alternate function mode & direction
 */

#define GPIO0_MAGICIAN_KEY_POWER_MD		(0 | GPIO_IN)
#define GPIO9_MAGICIAN_UNKNOWN_MD		(9 | GPIO_IN)
#define GPIO10_MAGICIAN_GSM_IRQ_MD		(10 | GPIO_IN)
#define GPIO11_MAGICIAN_GSM_OUT1_MD		(11 | GPIO_OUT)
#define GPIO13_MAGICIAN_CPLD_IRQ_MD		(13 | GPIO_IN)
#define GPIO18_MAGICIAN_UNKNOWN_MD		(18 | GPIO_OUT)
#define GPIO22_MAGICIAN_VIBRA_EN_MD		(22 | GPIO_OUT)
#define GPIO26_MAGICIAN_GSM_POWER_MD		(26 | GPIO_OUT)
#define GPIO27_MAGICIAN_USBC_PUEN_MD		(27 | GPIO_OUT)
#define GPIO30_MAGICIAN_nCHARGE_EN_MD		(30 | GPIO_OUT)
#define GPIO37_MAGICIAN_KEY_HANGUP_MD		(37 | GPIO_OUT)
#define GPIO38_MAGICIAN_KEY_CONTACTS_MD		(38 | GPIO_OUT)
#define GPIO40_MAGICIAN_GSM_OUT2_MD		(40 | GPIO_OUT)
#define GPIO48_MAGICIAN_UNKNOWN_MD		(48 | GPIO_OUT)
#define GPIO56_MAGICIAN_UNKNOWN_MD		(56 | GPIO_OUT)
#define GPIO57_MAGICIAN_CAM_RESET_MD		(57 | GPIO_OUT)
#define GPIO75_MAGICIAN_SAMSUNG_POWER_MD	(75 | GPIO_OUT)
#define GPIO83_MAGICIAN_nIR_EN_MD		(83 | GPIO_OUT)
#define GPIO86_MAGICIAN_GSM_RESET_MD		(86 | GPIO_OUT)
#define GPIO87_MAGICIAN_GSM_SELECT_MD		(87 | GPIO_OUT)
#define GPIO90_MAGICIAN_KEY_CALENDAR_MD		(90 | GPIO_OUT)
#define GPIO91_MAGICIAN_KEY_CAMERA_MD		(91 | GPIO_OUT)
#define GPIO93_MAGICIAN_KEY_UP_MD		(93 | GPIO_IN)
#define GPIO94_MAGICIAN_KEY_DOWN_MD		(94 | GPIO_IN)
#define GPIO95_MAGICIAN_KEY_LEFT_MD		(95 | GPIO_IN)
#define GPIO96_MAGICIAN_KEY_RIGHT_MD		(96 | GPIO_IN)
#define GPIO97_MAGICIAN_KEY_ENTER_MD		(97 | GPIO_IN)
#define GPIO98_MAGICIAN_KEY_RECORD_MD		(98 | GPIO_IN)
#define GPIO99_MAGICIAN_HEADPHONE_IN_MD		(99 | GPIO_IN)
#define GPIO100_MAGICIAN_KEY_VOL_UP_MD		(100 | GPIO_IN)
#define GPIO101_MAGICIAN_KEY_VOL_DOWN_MD 	(101 | GPIO_IN)
#define GPIO102_MAGICIAN_KEY_PHONE_MD		(102 | GPIO_IN)
#define GPIO103_MAGICIAN_LED_KP_MD		(103 | GPIO_OUT)
#define GPIO104_MAGICIAN_LCD_POWER_1_MD 	(104 | GPIO_OUT)
#define GPIO105_MAGICIAN_LCD_POWER_2_MD		(105 | GPIO_OUT)
#define GPIO106_MAGICIAN_LCD_POWER_3_MD		(106 | GPIO_OUT)
#define GPIO107_MAGICIAN_DS1WM_IRQ_MD		(107 | GPIO_IN)
#define GPIO108_MAGICIAN_GSM_READY_MD		(108 | GPIO_IN)
#define GPIO114_MAGICIAN_UNKNOWN_MD		(114 | GPIO_OUT)
#define GPIO115_MAGICIAN_nPEN_IRQ_MD		(115 | GPIO_IN)
#define GPIO116_MAGICIAN_nCAM_EN_MD		(116 | GPIO_OUT)
#define GPIO119_MAGICIAN_UNKNOWN_MD		(119 | GPIO_OUT)
#define GPIO120_MAGICIAN_UNKNOWN_MD		(120 | GPIO_OUT)

/*
 * CPLD IRQs
 */

#define IRQ_MAGICIAN_SD		(IRQ_BOARD_START + 0)
#define IRQ_MAGICIAN_EP		(IRQ_BOARD_START + 1)
#define IRQ_MAGICIAN_BT		(IRQ_BOARD_START + 2)
#define IRQ_MAGICIAN_AC		(IRQ_BOARD_START + 3)

/*
 * CPLD EGPIOs
 */

#define MAGICIAN_EGPIO_BASE			0x80 /* GPIO_BOARD_START */
#define MAGICIAN_EGPIO(reg,bit) \
	(MAGICIAN_EGPIO_BASE + 8*reg + bit)

/* output */

#define EGPIO_MAGICIAN_TOPPOLY_POWER		MAGICIAN_EGPIO(0, 2)
#define EGPIO_MAGICIAN_LED_POWER		MAGICIAN_EGPIO(0, 5)
#define EGPIO_MAGICIAN_GSM_RESET		MAGICIAN_EGPIO(0, 6)
#define EGPIO_MAGICIAN_LCD_POWER		MAGICIAN_EGPIO(0, 7)
#define EGPIO_MAGICIAN_SPK_POWER		MAGICIAN_EGPIO(1, 0)
#define EGPIO_MAGICIAN_EP_POWER			MAGICIAN_EGPIO(1, 1)
#define EGPIO_MAGICIAN_IN_SEL0			MAGICIAN_EGPIO(1, 2)
#define EGPIO_MAGICIAN_IN_SEL1			MAGICIAN_EGPIO(1, 3)
#define EGPIO_MAGICIAN_MIC_POWER		MAGICIAN_EGPIO(1, 4)
#define EGPIO_MAGICIAN_CODEC_RESET		MAGICIAN_EGPIO(1, 5)
#define EGPIO_MAGICIAN_CODEC_POWER		MAGICIAN_EGPIO(1, 6)
#define EGPIO_MAGICIAN_BL_POWER			MAGICIAN_EGPIO(1, 7)
#define EGPIO_MAGICIAN_SD_POWER			MAGICIAN_EGPIO(2, 0)
#define EGPIO_MAGICIAN_CARKIT_MIC		MAGICIAN_EGPIO(2, 1)
#define EGPIO_MAGICIAN_UNKNOWN_WAVEDEV_DLL	MAGICIAN_EGPIO(2, 2)
#define EGPIO_MAGICIAN_FLASH_VPP		MAGICIAN_EGPIO(2, 3)
#define EGPIO_MAGICIAN_BL_POWER2		MAGICIAN_EGPIO(2, 4)
#define EGPIO_MAGICIAN_CHARGE_EN		MAGICIAN_EGPIO(2, 5)
#define EGPIO_MAGICIAN_GSM_POWER		MAGICIAN_EGPIO(2, 7)

/* input */

#define EGPIO_MAGICIAN_CABLE_STATE_AC		MAGICIAN_EGPIO(4, 0)
#define EGPIO_MAGICIAN_CABLE_STATE_USB		MAGICIAN_EGPIO(4, 1)

#define EGPIO_MAGICIAN_BOARD_ID0		MAGICIAN_EGPIO(5, 0)
#define EGPIO_MAGICIAN_BOARD_ID1		MAGICIAN_EGPIO(5, 1)
#define EGPIO_MAGICIAN_BOARD_ID2		MAGICIAN_EGPIO(5, 2)
#define EGPIO_MAGICIAN_LCD_SELECT		MAGICIAN_EGPIO(5, 3)
#define EGPIO_MAGICIAN_nSD_READONLY		MAGICIAN_EGPIO(5, 4)

#define EGPIO_MAGICIAN_EP_INSERT		MAGICIAN_EGPIO(6, 1)

#endif /* _MAGICIAN_H_ */