1
2
3
4 #ifndef __RTL92E_PWRSEQ_H__
5 #define __RTL92E_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
31 #define RTL8192E_TRANS_CARDEMU_TO_ACT_STEPS 18
32 #define RTL8192E_TRANS_ACT_TO_CARDEMU_STEPS 18
33 #define RTL8192E_TRANS_CARDEMU_TO_SUS_STEPS 18
34 #define RTL8192E_TRANS_SUS_TO_CARDEMU_STEPS 18
35 #define RTL8192E_TRANS_CARDEMU_TO_PDN_STEPS 18
36 #define RTL8192E_TRANS_PDN_TO_CARDEMU_STEPS 18
37 #define RTL8192E_TRANS_ACT_TO_LPS_STEPS 23
38 #define RTL8192E_TRANS_LPS_TO_ACT_STEPS 23
39 #define RTL8192E_TRANS_END_STEPS 1
40
41 #define RTL8192E_TRANS_CARDEMU_TO_ACT \
42 \
43 \
44 \
45 \
46 {0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
47 PWR_BASEADDR_MAC , PWR_CMD_WRITE, BIT(7), 0}, \
48 \
49 {0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
50 PWR_BASEADDR_MAC , PWR_CMD_WRITE, BIT(2), 0}, \
51 \
52 {0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
53 PWR_BASEADDR_MAC , PWR_CMD_WRITE, (BIT(4)|BIT(3)), 0}, \
54 \
55 {0x0006, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
56 PWR_BASEADDR_MAC , PWR_CMD_POLLING, BIT(1), BIT(1)}, \
57 \
58 {0x0006, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
59 PWR_BASEADDR_MAC , PWR_CMD_WRITE, BIT(0), BIT(0)}, \
60 \
61 {0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
62 PWR_BASEADDR_MAC , PWR_CMD_WRITE, BIT(0), BIT(0)}, \
63 \
64 {0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
65 PWR_BASEADDR_MAC , PWR_CMD_POLLING, BIT(0), 0},
66
67 #define RTL8192E_TRANS_ACT_TO_CARDEMU \
68 \
69 \
70 \
71 \
72 {0x001F, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
73 PWR_BASEADDR_MAC , PWR_CMD_WRITE, 0xFF, 0}, \
74 \
75 {0x004E, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
76 PWR_BASEADDR_MAC , PWR_CMD_WRITE, BIT(7), 0}, \
77 \
78 {0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
79 PWR_BASEADDR_MAC , PWR_CMD_WRITE, BIT(1), BIT(1)}, \
80 \
81 {0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
82 PWR_BASEADDR_MAC , PWR_CMD_POLLING, BIT(1), 0},
83
84 #define RTL8192E_TRANS_CARDEMU_TO_SUS \
85 \
86 \
87 \
88 \
89 {0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_PCI_MSK, \
90 PWR_BASEADDR_MAC , PWR_CMD_WRITE, BIT(4) | BIT(3), (BIT(4) | BIT(3))},\
91 \
92 {0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, \
93 PWR_INTF_USB_MSK | PWR_INTF_SDIO_MSK, PWR_BASEADDR_MAC, \
94 PWR_CMD_WRITE, BIT(3)|BIT(4), BIT(3)}, \
95 \
96 {0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_PCI_MSK, \
97 PWR_BASEADDR_MAC , PWR_CMD_WRITE, BIT(3) | BIT(4), BIT(3) | BIT(4)},\
98 \
99 {0x0086, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK, \
100 PWR_BASEADDR_SDIO , PWR_CMD_WRITE, BIT(0), BIT(0)}, \
101 \
102 {0x0086, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK, \
103 PWR_BASEADDR_SDIO , PWR_CMD_POLLING, BIT(1), 0},
104
105 #define RTL8192E_TRANS_SUS_TO_CARDEMU \
106 \
107 \
108 \
109 \
110 {0x0086, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK, \
111 PWR_BASEADDR_SDIO , PWR_CMD_WRITE, BIT(0), 0}, \
112 \
113 {0x0086, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK, \
114 PWR_BASEADDR_SDIO , PWR_CMD_POLLING, BIT(1), BIT(1)}, \
115 \
116 {0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
117 PWR_BASEADDR_MAC , PWR_CMD_WRITE, BIT(3) | BIT(4), 0},
118
119 #define RTL8192E_TRANS_CARDEMU_TO_CARDDIS \
120 \
121 \
122 \
123 \
124 {0x0007, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK, \
125 PWR_BASEADDR_MAC , PWR_CMD_WRITE, 0xFF, 0x20}, \
126 \
127 {0x00CC, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK, \
128 PWR_BASEADDR_MAC , PWR_CMD_WRITE, BIT(2), BIT(2)}, \
129 \
130 {0x0011, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK, \
131 PWR_BASEADDR_MAC , PWR_CMD_WRITE, BIT(0), 0}, \
132 \
133 {0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, \
134 PWR_INTF_USB_MSK|PWR_INTF_SDIO_MSK, PWR_BASEADDR_MAC, \
135 PWR_CMD_WRITE, BIT(3)|BIT(4), BIT(3)}, \
136 \
137 {0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_PCI_MSK, \
138 PWR_BASEADDR_MAC , PWR_CMD_WRITE, BIT(2), BIT(2)}, \
139 \
140 {0x0086, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK, \
141 PWR_BASEADDR_SDIO , PWR_CMD_WRITE, BIT(0), BIT(0)}, \
142 \
143 {0x0086, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK, \
144 PWR_BASEADDR_SDIO , PWR_CMD_POLLING, BIT(1), 0},
145
146 #define RTL8192E_TRANS_CARDDIS_TO_CARDEMU \
147 \
148 \
149 \
150 \
151 {0x0086, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK, \
152 PWR_BASEADDR_SDIO , PWR_CMD_WRITE, BIT(0), 0}, \
153 \
154 {0x0086, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK, \
155 PWR_BASEADDR_SDIO , PWR_CMD_POLLING, BIT(1), BIT(1)}, \
156 \
157 {0x0011, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK, \
158 PWR_BASEADDR_MAC , PWR_CMD_WRITE, BIT(0), BIT(0)}, \
159 \
160 {0x00CC, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK, \
161 PWR_BASEADDR_MAC , PWR_CMD_WRITE, BIT(2), 0}, \
162 \
163 {0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
164 PWR_BASEADDR_MAC , PWR_CMD_WRITE, BIT(3) | BIT(4), 0},
165
166 #define RTL8192E_TRANS_CARDEMU_TO_PDN \
167 \
168 \
169 \
170 \
171 {0x0006, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
172 PWR_BASEADDR_MAC , PWR_CMD_WRITE, BIT(0), 0}, \
173 \
174 {0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
175 PWR_BASEADDR_MAC , PWR_CMD_WRITE, BIT(7), BIT(7)},
176
177 #define RTL8192E_TRANS_PDN_TO_CARDEMU \
178 \
179 \
180 \
181 \
182 {0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
183 PWR_BASEADDR_MAC , PWR_CMD_WRITE, BIT(7), 0},
184
185 #define RTL8192E_TRANS_ACT_TO_LPS \
186 \
187 \
188 \
189 \
190 {0x0301, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_PCI_MSK, \
191 PWR_BASEADDR_MAC , PWR_CMD_WRITE, 0xFF, 0xFF}, \
192 \
193 {0x0522, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
194 PWR_BASEADDR_MAC , PWR_CMD_WRITE, 0xFF, 0xFF}, \
195 \
196 {0x05F8, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
197 PWR_BASEADDR_MAC , PWR_CMD_POLLING, 0xFF, 0}, \
198 \
199 {0x05F9, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
200 PWR_BASEADDR_MAC , PWR_CMD_POLLING, 0xFF, 0}, \
201 \
202 {0x05FA, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
203 PWR_BASEADDR_MAC , PWR_CMD_POLLING, 0xFF, 0}, \
204 \
205 {0x05FB, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
206 PWR_BASEADDR_MAC , PWR_CMD_POLLING, 0xFF, 0}, \
207 \
208 {0x0002, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
209 PWR_BASEADDR_MAC , PWR_CMD_WRITE, BIT(0), 0}, \
210 \
211 {0x0002, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
212 PWR_BASEADDR_MAC , PWR_CMD_DELAY, 0, PWRSEQ_DELAY_US}, \
213 \
214 {0x0002, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
215 PWR_BASEADDR_MAC , PWR_CMD_WRITE, BIT(1), 0}, \
216 \
217 {0x0100, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
218 PWR_BASEADDR_MAC , PWR_CMD_WRITE, 0xFF, 0x03}, \
219 \
220 {0x0101, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
221 PWR_BASEADDR_MAC , PWR_CMD_WRITE, BIT(1), 0}, \
222 \
223 {0x0093, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK, \
224 PWR_BASEADDR_MAC , PWR_CMD_WRITE, 0xFF, 0x00}, \
225 \
226 {0x0553, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
227 PWR_BASEADDR_MAC , PWR_CMD_WRITE, BIT(5), BIT(5)},
228
229 #define RTL8192E_TRANS_LPS_TO_ACT \
230 \
231 \
232 \
233 \
234 {0x0080, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK, \
235 PWR_BASEADDR_SDIO , PWR_CMD_WRITE, 0xFF, 0x84}, \
236 \
237 {0xFE58, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_USB_MSK, \
238 PWR_BASEADDR_MAC , PWR_CMD_WRITE, 0xFF, 0x84}, \
239 \
240 {0x0361, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_PCI_MSK, \
241 PWR_BASEADDR_MAC , PWR_CMD_WRITE, 0xFF, 0x84}, \
242 \
243 {0x0002, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
244 PWR_BASEADDR_MAC , PWR_CMD_DELAY, 0, PWRSEQ_DELAY_MS}, \
245 \
246 {0x0008, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
247 PWR_BASEADDR_MAC , PWR_CMD_WRITE, BIT(4), 0}, \
248 \
249 {0x0109, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
250 PWR_BASEADDR_MAC , PWR_CMD_POLLING, BIT(7), 0}, \
251 \
252 {0x0101, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
253 PWR_BASEADDR_MAC , PWR_CMD_WRITE, BIT(1), BIT(1)}, \
254 \
255 {0x0100, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
256 PWR_BASEADDR_MAC , PWR_CMD_WRITE, 0xFF, 0xFF}, \
257 \
258 {0x0002, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
259 PWR_BASEADDR_MAC , PWR_CMD_WRITE, BIT(1) | BIT(0), BIT(1) | BIT(0)},\
260 \
261 {0x0522, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
262 PWR_BASEADDR_MAC , PWR_CMD_WRITE, 0xFF, 0}, \
263 \
264 {0x013D, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
265 PWR_BASEADDR_MAC , PWR_CMD_WRITE, 0xFF, 0xFF},
266
267 #define RTL8192E_TRANS_END \
268 \
269 \
270 \
271 {0xFFFF, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
272 0, PWR_CMD_END, 0, 0},
273
274 extern struct wlan_pwr_cfg rtl8192E_power_on_flow
275 [RTL8192E_TRANS_CARDEMU_TO_ACT_STEPS +
276 RTL8192E_TRANS_END_STEPS];
277 extern struct wlan_pwr_cfg rtl8192E_radio_off_flow
278 [RTL8192E_TRANS_ACT_TO_CARDEMU_STEPS +
279 RTL8192E_TRANS_END_STEPS];
280 extern struct wlan_pwr_cfg rtl8192E_card_disable_flow
281 [RTL8192E_TRANS_ACT_TO_CARDEMU_STEPS +
282 RTL8192E_TRANS_CARDEMU_TO_PDN_STEPS +
283 RTL8192E_TRANS_END_STEPS];
284 extern struct wlan_pwr_cfg rtl8192E_card_enable_flow
285 [RTL8192E_TRANS_ACT_TO_CARDEMU_STEPS +
286 RTL8192E_TRANS_CARDEMU_TO_PDN_STEPS +
287 RTL8192E_TRANS_END_STEPS];
288 extern struct wlan_pwr_cfg rtl8192E_suspend_flow
289 [RTL8192E_TRANS_ACT_TO_CARDEMU_STEPS +
290 RTL8192E_TRANS_CARDEMU_TO_SUS_STEPS +
291 RTL8192E_TRANS_END_STEPS];
292 extern struct wlan_pwr_cfg rtl8192E_resume_flow
293 [RTL8192E_TRANS_ACT_TO_CARDEMU_STEPS +
294 RTL8192E_TRANS_CARDEMU_TO_SUS_STEPS +
295 RTL8192E_TRANS_END_STEPS];
296 extern struct wlan_pwr_cfg rtl8192E_hwpdn_flow
297 [RTL8192E_TRANS_ACT_TO_CARDEMU_STEPS +
298 RTL8192E_TRANS_CARDEMU_TO_PDN_STEPS +
299 RTL8192E_TRANS_END_STEPS];
300 extern struct wlan_pwr_cfg rtl8192E_enter_lps_flow
301 [RTL8192E_TRANS_ACT_TO_LPS_STEPS +
302 RTL8192E_TRANS_END_STEPS];
303 extern struct wlan_pwr_cfg rtl8192E_leave_lps_flow
304 [RTL8192E_TRANS_LPS_TO_ACT_STEPS +
305 RTL8192E_TRANS_END_STEPS];
306
307
308 #define RTL8192E_NIC_PWR_ON_FLOW rtl8192E_power_on_flow
309 #define RTL8192E_NIC_RF_OFF_FLOW rtl8192E_radio_off_flow
310 #define RTL8192E_NIC_DISABLE_FLOW rtl8192E_card_disable_flow
311 #define RTL8192E_NIC_ENABLE_FLOW rtl8192E_card_enable_flow
312 #define RTL8192E_NIC_SUSPEND_FLOW rtl8192E_suspend_flow
313 #define RTL8192E_NIC_RESUME_FLOW rtl8192E_resume_flow
314 #define RTL8192E_NIC_PDN_FLOW rtl8192E_hwpdn_flow
315 #define RTL8192E_NIC_LPS_ENTER_FLOW rtl8192E_enter_lps_flow
316 #define RTL8192E_NIC_LPS_LEAVE_FLOW rtl8192E_leave_lps_flow
317
318 #endif