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
167
168
169
170
171
172
173
174
175
176
177
178
|
/* -------------------- NOTES ------------------- */
/* I have a suspicion this isn't right for AXP_IRQ,
* and it's not used right now anyway. copied from m3k. */
/* DEFINE_GPIO(AXP_IRQ, GPIO_PB(10), GPIOF_INPUT) */
/* ---------------------------------------------- */
/* WARNING WARNING WARNING WARNING WARNING WARNING WARNING */
/* ======================================================= */
/* DO NOT CHANGE THE ORDER OF THESE DEFINES */
/* WITHOUT CONSIDERING GPIO-X1000.C!! */
/* ======================================================= */
/* WARNING WARNING WARNING WARNING WARNING WARNING WARNING */
/**************************/
/* PIN GROUPINGS */
/************************ */
/* Name Port Pins Function */
DEFINE_PINGROUP(LCD_DATA, GPIO_A, 0xffff << 0, GPIOF_DEVICE(1))
DEFINE_PINGROUP(LCD_CONTROL, GPIO_B, 0x1a << 16, GPIOF_DEVICE(1))
DEFINE_PINGROUP(MSC0, GPIO_A, 0x3f << 20, GPIOF_DEVICE(1))
DEFINE_PINGROUP(SFC, GPIO_A, 0x3f << 26, GPIOF_DEVICE(1))
DEFINE_PINGROUP(I2S, GPIO_B, 0x1f << 0, GPIOF_DEVICE(1))
DEFINE_PINGROUP(I2C1, GPIO_C, 3 << 26, GPIOF_DEVICE(0))
DEFINE_PINGROUP(I2C2, GPIO_D, 3 << 0, GPIOF_DEVICE(1))
/* Name Pin Function */
/*************************/
/* AUDIO STUFF */
/*************************/
/* mute DAC: 0 - mute, 1 - play */
/* Note: This seems to actually be power to the DAC in general,
* at least on the ES9018K2M devices. Was "DAC_XMIT". */
DEFINE_GPIO(DAC_PWR, GPIO_PB(12), GPIOF_OUTPUT(0))
/* Headphone Amp power */
DEFINE_GPIO(HPAMP_POWER, GPIO_PB(6), GPIOF_OUTPUT(0))
/* DAC AVDD */
DEFINE_GPIO(DAC_ANALOG_PWR, GPIO_PB(9), GPIOF_OUTPUT(0))
/* SPDIF power? */
// gpio 53 --> port B, pin 21
DEFINE_GPIO(SPDIF_PWR, GPIO_PB(21), GPIOF_OUTPUT(0))
/* mute HP amp: 0 - mute, 1 - play */
DEFINE_GPIO(HPAMP_SHDN, GPIO_PB(8), GPIOF_OUTPUT(0))
/* mute audio mux: 0 - play, 1 - mute */
DEFINE_GPIO(STEREOSW_MUTE, GPIO_PB(15), GPIOF_OUTPUT(1))
/*
* Original devices: switches HP on/off - 0 HP on, 1 HP off, no effect on LO.
* Newer devices: switches between HP and LO - 0 HP, 1 LO.
*/
DEFINE_GPIO(STEREOSW_SEL, GPIO_PB(5), GPIOF_OUTPUT(0))
/**************/
/* SD and USB */
/**************/
/* SD card */
DEFINE_GPIO(MMC_PWR, GPIO_PB(10), GPIOF_OUTPUT(1))
DEFINE_GPIO(MSC0_CD, GPIO_PB(11), GPIOF_INPUT)
/* USB */
/* USB_DETECT D3 chosen by trial-and-error. */
DEFINE_GPIO(USB_DETECT, GPIO_PD(3), GPIOF_INPUT)
DEFINE_GPIO(USB_DRVVBUS, GPIO_PB(25), GPIOF_OUTPUT(0))
/* TCS1421_CFG (USB) CFG1 */
// set TCS1421_CFG0:1 to 00, Upstream Facing Port (tried others, they don't work)
// GPIO 62 --> PORT B, PIN 30
DEFINE_GPIO(TCS1421_CFG1, GPIO_PB(30), GPIOF_OUTPUT(0))
/* BL POWER */
// gpio 89 --> port c, pin 25
// oh, this is probably backlight power, isn't it?
DEFINE_GPIO(BL_PWR, GPIO_PC(25), GPIOF_OUTPUT(0))
/************/
/* LCD */
/************/
/* LCD */
DEFINE_GPIO(LCD_RESET, GPIO_PB(13), GPIOF_OUTPUT(0))
DEFINE_GPIO(LCD_CE, GPIO_PB(18), GPIOF_OUTPUT(1))
DEFINE_GPIO(LCD_RD, GPIO_PB(16), GPIOF_OUTPUT(1))
/************/
/* BUTTONS */
/************/
/* Buttons */
DEFINE_GPIO(BTN_PLAY, GPIO_PA(16), GPIOF_INPUT)
DEFINE_GPIO(BTN_VOL_UP, GPIO_PA(17), GPIOF_INPUT)
DEFINE_GPIO(BTN_VOL_DOWN, GPIO_PA(19), GPIOF_INPUT)
DEFINE_GPIO(BTN_MENU, GPIO_PB(28), GPIOF_INPUT)
DEFINE_GPIO(BTN_PREV, GPIO_PD(4), GPIOF_INPUT)
DEFINE_GPIO(BTN_NEXT, GPIO_PC(24), GPIOF_INPUT)
DEFINE_GPIO(BTN_SCROLL_A, GPIO_PB(24), GPIOF_INPUT)
DEFINE_GPIO(BTN_SCROLL_B, GPIO_PB(23), GPIOF_INPUT)
/**********************/
/* BLUETOOTH STUFF */
/**********************/
/* BT Power */
// GPIO 86 --> Port C, Pin 22
DEFINE_GPIO(BT_PWR, GPIO_PC(22), GPIOF_OUTPUT(0))
/****************************** */
/* HW1/2/3-ONLY STUFF */
/****************************** */
DEFINE_GPIO(HW1_START, GPIO_PC(0), GPIOF_OUTPUT(0))
/************/
/* BUTTONS */
/************/
DEFINE_GPIO(BTN_BACK_HW1, GPIO_PD(5), GPIOF_INPUT)
DEFINE_GPIO(BTN_POWER_HW1, GPIO_PB(7), GPIOF_INPUT)
/**********************/
/* BLUETOOTH STUFF */
/**********************/
// GPIO 83 --> port C, pin 19
DEFINE_GPIO(BT_REG_ON_HW1, GPIO_PC(19), GPIOF_OUTPUT(0))
/************/
/* LCD */
/************/
/* LCD */
DEFINE_GPIO(LCD_PWR_HW1, GPIO_PB(14), GPIOF_OUTPUT(0))
DEFINE_GPIO(HW1_END, GPIO_PC(0), GPIOF_OUTPUT(0))
/****************************** */
/* HW4-ONLY STUFF */
/****************************** */
DEFINE_GPIO(HW4_START, GPIO_PC(0), GPIOF_OUTPUT(0))
DEFINE_GPIO(BLUELIGHT_HW4, GPIO_PB(7), GPIOF_OUTPUT(1))
/************/
/* BUTTONS */
/************/
DEFINE_GPIO(BTN_BACK_HW4, GPIO_PA(18), GPIOF_INPUT)
DEFINE_GPIO(BTN_POWER_HW4, GPIO_PB(31), GPIOF_INPUT)
/**********************/
/* BLUETOOTH STUFF */
/**********************/
/* bt_wake_host */
// gpio 84 --> port C, pin 20
DEFINE_GPIO(BT_WAKE_HOST, GPIO_PC(20), GPIOF_INPUT)
/* host_wake_bt */
// gpio 83 --> port C, pin 19
DEFINE_GPIO(HOST_WAKE_BT, GPIO_PC(19), GPIOF_OUTPUT(0))
/**************/
/* USB */
/**************/
/* USB_TCS1421_CFG0 */
// set TCS1421_CFG0:1 to 00, Upstream Facing Port (tried others, they don't work)
// gpio 101 --> port D, pin 5
DEFINE_GPIO(TCS1421_CFG0, GPIO_PD(5), GPIOF_OUTPUT(0))
/***************/
/* PLUG DETECT */
/***************/
/* HP_DETECT */
// gpio 46 --> port B, pin 14
DEFINE_GPIO(HP_DETECT_HW4, GPIO_PB(14), GPIOF_INPUT)
/* LO_DETECT */
// gpio 54 --> Port B, pin 22
DEFINE_GPIO(LO_DETECT_HW4, GPIO_PB(22), GPIOF_INPUT)
DEFINE_GPIO(HW4_END, GPIO_PC(0), GPIOF_OUTPUT(0))
|