1
2
3
4 #ifndef __RTL8723E_PWRSEQ_H__
5 #define __RTL8723E_PWRSEQ_H__
6
7 #include "../pwrseqcmd.h"
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30 #define RTL8188EE_TRANS_CARDEMU_TO_ACT_STEPS 10
31 #define RTL8188EE_TRANS_ACT_TO_CARDEMU_STEPS 10
32 #define RTL8188EE_TRANS_CARDEMU_TO_SUS_STEPS 10
33 #define RTL8188EE_TRANS_SUS_TO_CARDEMU_STEPS 10
34 #define RTL8188EE_TRANS_CARDEMU_TO_PDN_STEPS 10
35 #define RTL8188EE_TRANS_PDN_TO_CARDEMU_STEPS 10
36 #define RTL8188EE_TRANS_ACT_TO_LPS_STEPS 15
37 #define RTL8188EE_TRANS_LPS_TO_ACT_STEPS 15
38 #define RTL8188EE_TRANS_END_STEPS 1
39
40
41
42
43
44 #define RTL8188EE_TRANS_CARDEMU_TO_ACT \
45 {0x0006, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
46 PWR_BASEADDR_MAC, PWR_CMD_POLLING, BIT(1), BIT(1) \
47 }, \
48 {0x0002, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
49 PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(0)|BIT(1), 0 \
50 }, \
51 {0x0026, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
52 PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(7), BIT(7) \
53 }, \
54 {0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
55 PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(7), 0 \
56 }, \
57 {0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
58 PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(4)|BIT(3), 0 \
59 }, \
60 {0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
61 PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(0), BIT(0) \
62 }, \
63 {0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
64 PWR_BASEADDR_MAC, PWR_CMD_POLLING, BIT(0), 0 \
65 }, \
66 {0x0023, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
67 PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(4), 0 \
68 }, \
69 {0x0074, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK, \
70 PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(4), BIT(4) \
71 },
72
73 #define RTL8188EE_TRANS_ACT_TO_CARDEMU \
74 {0x001F, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
75 PWR_BASEADDR_MAC, PWR_CMD_WRITE, 0xFF, 0 \
76 }, \
77 {0x0023, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
78 PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(4), BIT(4) \
79 }, \
80 {0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
81 PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(1), BIT(1) \
82 }, \
83 {0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
84 PWR_BASEADDR_MAC, PWR_CMD_POLLING, BIT(1), 0 \
85 },
86
87 #define RTL8188EE_TRANS_CARDEMU_TO_SUS \
88 {0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, \
89 PWR_INTF_USB_MSK|PWR_INTF_SDIO_MSK, \
90 PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(3)|BIT(4), BIT(3) \
91 }, \
92 {0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_PCI_MSK, \
93 PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(3)|BIT(4), BIT(3)|BIT(4) \
94 }, \
95 {0x0007, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, \
96 PWR_INTF_USB_MSK|PWR_INTF_SDIO_MSK, \
97 PWR_BASEADDR_MAC, PWR_CMD_WRITE, 0xFF, BIT(7) \
98 },\
99 {0x0041, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, \
100 PWR_INTF_USB_MSK|PWR_INTF_SDIO_MSK, \
101 PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(4), 0 \
102 }, \
103 {0xfe10, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, \
104 PWR_INTF_USB_MSK|PWR_INTF_SDIO_MSK, \
105 PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(4), BIT(4) \
106 }, \
107 {0x0086, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK, \
108 PWR_BASEADDR_SDIO, PWR_CMD_WRITE, BIT(0), BIT(0) \
109 }, \
110 {0x0086, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK, \
111 PWR_BASEADDR_SDIO, PWR_CMD_POLLING, BIT(1), 0 \
112 },
113
114 #define RTL8188EE_TRANS_SUS_TO_CARDEMU \
115 {0x0086, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK, \
116 PWR_BASEADDR_SDIO, PWR_CMD_WRITE, BIT(0), 0 \
117 }, \
118 {0x0086, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK, \
119 PWR_BASEADDR_SDIO, PWR_CMD_POLLING, BIT(1), BIT(1) \
120 }, \
121 {0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
122 PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(3) | BIT(4), 0 \
123 },
124
125 #define RTL8188EE_TRANS_CARDEMU_TO_CARDDIS \
126 {0x0026, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
127 PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(7), BIT(7) \
128 }, \
129 {0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, \
130 PWR_INTF_USB_MSK|PWR_INTF_SDIO_MSK, \
131 PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(3) | BIT(4), BIT(3) \
132 }, \
133 {0x0007, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, \
134 PWR_INTF_USB_MSK|PWR_INTF_SDIO_MSK, \
135 PWR_BASEADDR_MAC, PWR_CMD_WRITE, 0xFF, 0 \
136 },\
137 {0x0041, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, \
138 PWR_INTF_USB_MSK|PWR_INTF_SDIO_MSK, \
139 PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(4), 0 \
140 }, \
141 {0xfe10, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_USB_MSK, \
142 PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(4), BIT(4) \
143 }, \
144 {0x0086, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK, \
145 PWR_BASEADDR_SDIO, PWR_CMD_WRITE, BIT(0), BIT(0) \
146 }, \
147 {0x0086, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK, \
148 PWR_BASEADDR_SDIO, PWR_CMD_POLLING, BIT(1), 0 \
149 },
150
151 #define RTL8188EE_TRANS_CARDDIS_TO_CARDEMU \
152 {0x0086, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK, \
153 PWR_BASEADDR_SDIO, PWR_CMD_WRITE, BIT(0), 0 \
154 }, \
155 {0x0086, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK, \
156 PWR_BASEADDR_SDIO, PWR_CMD_POLLING, BIT(1), BIT(1) \
157 }, \
158 {0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
159 PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(3)|BIT(4), 0 \
160 },
161
162 #define RTL8188EE_TRANS_CARDEMU_TO_PDN \
163 {0x0006, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
164 PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(0), 0}, \
165 {0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
166 PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(7), BIT(7) \
167 },
168
169 #define RTL8188EE_TRANS_PDN_TO_CARDEMU \
170 {0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
171 PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(7), 0},
172
173 #define RTL8188EE_TRANS_ACT_TO_LPS \
174 {0x0522, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
175 PWR_BASEADDR_MAC, PWR_CMD_WRITE, 0xFF, 0x7F \
176 }, \
177 {0x05F8, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
178 PWR_BASEADDR_MAC, PWR_CMD_POLLING, 0xFF, 0 \
179 }, \
180 {0x05F9, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
181 PWR_BASEADDR_MAC, PWR_CMD_POLLING, 0xFF, 0 \
182 }, \
183 {0x05FA, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
184 PWR_BASEADDR_MAC, PWR_CMD_POLLING, 0xFF, 0 \
185 }, \
186 {0x05FB, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
187 PWR_BASEADDR_MAC, PWR_CMD_POLLING, 0xFF, 0 \
188 }, \
189 {0x0002, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
190 PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(0), 0 \
191 }, \
192 {0x0002, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
193 PWR_BASEADDR_MAC, PWR_CMD_DELAY, 0, PWRSEQ_DELAY_US \
194 }, \
195 {0x0100, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
196 PWR_BASEADDR_MAC, PWR_CMD_WRITE, 0xFF, 0x3F \
197 }, \
198 {0x0101, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
199 PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(1), 0 \
200 }, \
201 {0x0553, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
202 PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(5), BIT(5) \
203 },
204
205
206 #define RTL8188EE_TRANS_LPS_TO_ACT \
207 {0x0080, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK, \
208 PWR_BASEADDR_SDIO, PWR_CMD_WRITE, 0xFF, 0x84 \
209 }, \
210 {0xFE58, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_USB_MSK, \
211 PWR_BASEADDR_MAC, PWR_CMD_WRITE, 0xFF, 0x84 \
212 }, \
213 {0x0361, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_PCI_MSK, \
214 PWR_BASEADDR_MAC, PWR_CMD_WRITE, 0xFF, 0x84 \
215 }, \
216 {0x0002, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
217 PWR_BASEADDR_MAC, PWR_CMD_DELAY, 0, PWRSEQ_DELAY_MS \
218 }, \
219 {0x0008, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
220 PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(4), 0 \
221 }, \
222 {0x0109, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
223 PWR_BASEADDR_MAC, PWR_CMD_POLLING, BIT(7), 0 \
224 }, \
225 {0x0029, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
226 PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(6)|BIT(7), 0 \
227 }, \
228 {0x0101, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
229 PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(1), BIT(1) \
230 }, \
231 {0x0100, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
232 PWR_BASEADDR_MAC, PWR_CMD_WRITE, 0xFF, 0xFF \
233 }, \
234 {0x0002, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
235 PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(1)|BIT(0), BIT(1)|BIT(0) \
236 }, \
237 {0x0522, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
238 PWR_BASEADDR_MAC, PWR_CMD_WRITE, 0xFF, 0 \
239 },
240
241 #define RTL8188EE_TRANS_END \
242 {0xFFFF, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,\
243 0, PWR_CMD_END, 0, 0}
244
245 extern struct wlan_pwr_cfg rtl8188ee_power_on_flow
246 [RTL8188EE_TRANS_CARDEMU_TO_ACT_STEPS +
247 RTL8188EE_TRANS_END_STEPS];
248 extern struct wlan_pwr_cfg rtl8188ee_radio_off_flow
249 [RTL8188EE_TRANS_ACT_TO_CARDEMU_STEPS +
250 RTL8188EE_TRANS_END_STEPS];
251 extern struct wlan_pwr_cfg rtl8188ee_card_disable_flow
252 [RTL8188EE_TRANS_ACT_TO_CARDEMU_STEPS +
253 RTL8188EE_TRANS_CARDEMU_TO_PDN_STEPS +
254 RTL8188EE_TRANS_END_STEPS];
255 extern struct wlan_pwr_cfg rtl8188ee_card_enable_flow
256 [RTL8188EE_TRANS_ACT_TO_CARDEMU_STEPS +
257 RTL8188EE_TRANS_CARDEMU_TO_PDN_STEPS +
258 RTL8188EE_TRANS_END_STEPS];
259 extern struct wlan_pwr_cfg rtl8188ee_suspend_flow
260 [RTL8188EE_TRANS_ACT_TO_CARDEMU_STEPS +
261 RTL8188EE_TRANS_CARDEMU_TO_SUS_STEPS +
262 RTL8188EE_TRANS_END_STEPS];
263 extern struct wlan_pwr_cfg rtl8188ee_resume_flow
264 [RTL8188EE_TRANS_ACT_TO_CARDEMU_STEPS +
265 RTL8188EE_TRANS_CARDEMU_TO_SUS_STEPS +
266 RTL8188EE_TRANS_END_STEPS];
267 extern struct wlan_pwr_cfg rtl8188ee_hwpdn_flow
268 [RTL8188EE_TRANS_ACT_TO_CARDEMU_STEPS +
269 RTL8188EE_TRANS_CARDEMU_TO_PDN_STEPS +
270 RTL8188EE_TRANS_END_STEPS];
271 extern struct wlan_pwr_cfg rtl8188ee_enter_lps_flow
272 [RTL8188EE_TRANS_ACT_TO_LPS_STEPS +
273 RTL8188EE_TRANS_END_STEPS];
274 extern struct wlan_pwr_cfg rtl8188ee_leave_lps_flow
275 [RTL8188EE_TRANS_LPS_TO_ACT_STEPS +
276 RTL8188EE_TRANS_END_STEPS];
277
278
279 #define RTL8188EE_NIC_PWR_ON_FLOW rtl8188ee_power_on_flow
280 #define RTL8188EE_NIC_RF_OFF_FLOW rtl8188ee_radio_off_flow
281 #define RTL8188EE_NIC_DISABLE_FLOW rtl8188ee_card_disable_flow
282 #define RTL8188EE_NIC_ENABLE_FLOW rtl8188ee_card_enable_flow
283 #define RTL8188EE_NIC_SUSPEND_FLOW rtl8188ee_suspend_flow
284 #define RTL8188EE_NIC_RESUME_FLOW rtl8188ee_resume_flow
285 #define RTL8188EE_NIC_PDN_FLOW rtl8188ee_hwpdn_flow
286 #define RTL8188EE_NIC_LPS_ENTER_FLOW rtl8188ee_enter_lps_flow
287 #define RTL8188EE_NIC_LPS_LEAVE_FLOW rtl8188ee_leave_lps_flow
288
289 #endif