xref: /linux/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/pwrseq.h (revision 692f5deccdae665925cd9542d460fe4771835be5)
1f1d2b4d3SLarry Finger /******************************************************************************
2f1d2b4d3SLarry Finger  *
3f1d2b4d3SLarry Finger  * Copyright(c) 2009-2013  Realtek Corporation.
4f1d2b4d3SLarry Finger  *
5f1d2b4d3SLarry Finger  * This program is free software; you can redistribute it and/or modify it
6f1d2b4d3SLarry Finger  * under the terms of version 2 of the GNU General Public License as
7f1d2b4d3SLarry Finger  * published by the Free Software Foundation.
8f1d2b4d3SLarry Finger  *
9f1d2b4d3SLarry Finger  * This program is distributed in the hope that it will be useful, but WITHOUT
10f1d2b4d3SLarry Finger  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11f1d2b4d3SLarry Finger  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
12f1d2b4d3SLarry Finger  * more details.
13f1d2b4d3SLarry Finger  *
14f1d2b4d3SLarry Finger  * The full GNU General Public License is included in this distribution in the
15f1d2b4d3SLarry Finger  * file called LICENSE.
16f1d2b4d3SLarry Finger  *
17f1d2b4d3SLarry Finger  * Contact Information:
18f1d2b4d3SLarry Finger  * wlanfae <wlanfae@realtek.com>
19f1d2b4d3SLarry Finger  * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park,
20f1d2b4d3SLarry Finger  * Hsinchu 300, Taiwan.
21f1d2b4d3SLarry Finger  *
22f1d2b4d3SLarry Finger  * Larry Finger <Larry.Finger@lwfinger.net>
23f1d2b4d3SLarry Finger  *
24f1d2b4d3SLarry Finger  *****************************************************************************/
25f1d2b4d3SLarry Finger 
26f1d2b4d3SLarry Finger #ifndef __RTL8723E_PWRSEQ_H__
27f1d2b4d3SLarry Finger #define __RTL8723E_PWRSEQ_H__
28f1d2b4d3SLarry Finger 
29f1d2b4d3SLarry Finger #include "../pwrseqcmd.h"
30f1d2b4d3SLarry Finger /* Check document WM-20110607-Paul-RTL8188EE_Power_Architecture-R02.vsd
31f1d2b4d3SLarry Finger  *	There are 6 HW Power States:
32f1d2b4d3SLarry Finger  *	0: POFF--Power Off
33f1d2b4d3SLarry Finger  *	1: PDN--Power Down
34f1d2b4d3SLarry Finger  *	2: CARDEMU--Card Emulation
35f1d2b4d3SLarry Finger  *	3: ACT--Active Mode
36f1d2b4d3SLarry Finger  *	4: LPS--Low Power State
37f1d2b4d3SLarry Finger  *	5: SUS--Suspend
38f1d2b4d3SLarry Finger  *
39f1d2b4d3SLarry Finger  *	The transision from different states are defined below
40f1d2b4d3SLarry Finger  *	TRANS_CARDEMU_TO_ACT
41f1d2b4d3SLarry Finger  *	TRANS_ACT_TO_CARDEMU
42f1d2b4d3SLarry Finger  *	TRANS_CARDEMU_TO_SUS
43f1d2b4d3SLarry Finger  *	TRANS_SUS_TO_CARDEMU
44f1d2b4d3SLarry Finger  *	TRANS_CARDEMU_TO_PDN
45f1d2b4d3SLarry Finger  *	TRANS_ACT_TO_LPS
46f1d2b4d3SLarry Finger  *	TRANS_LPS_TO_ACT
47f1d2b4d3SLarry Finger  *
48f1d2b4d3SLarry Finger  *	TRANS_END
49f1d2b4d3SLarry Finger  *	PWR SEQ Version: rtl8188ee_PwrSeq_V09.h
50f1d2b4d3SLarry Finger  */
51f1d2b4d3SLarry Finger 
52f1d2b4d3SLarry Finger #define	RTL8188EE_TRANS_CARDEMU_TO_ACT_STEPS	10
53f1d2b4d3SLarry Finger #define	RTL8188EE_TRANS_ACT_TO_CARDEMU_STEPS	10
54f1d2b4d3SLarry Finger #define	RTL8188EE_TRANS_CARDEMU_TO_SUS_STEPS	10
55f1d2b4d3SLarry Finger #define	RTL8188EE_TRANS_SUS_TO_CARDEMU_STEPS	10
56f1d2b4d3SLarry Finger #define	RTL8188EE_TRANS_CARDEMU_TO_PDN_STEPS	10
57f1d2b4d3SLarry Finger #define	RTL8188EE_TRANS_PDN_TO_CARDEMU_STEPS	10
58f1d2b4d3SLarry Finger #define	RTL8188EE_TRANS_ACT_TO_LPS_STEPS		15
59f1d2b4d3SLarry Finger #define	RTL8188EE_TRANS_LPS_TO_ACT_STEPS		15
60f1d2b4d3SLarry Finger #define	RTL8188EE_TRANS_END_STEPS		1
61f1d2b4d3SLarry Finger 
62f1d2b4d3SLarry Finger /* The following macros have the following format:
63f1d2b4d3SLarry Finger  * { offset, cut_msk, fab_msk|interface_msk, base|cmd, msk, value
64f1d2b4d3SLarry Finger  *   comments },
65f1d2b4d3SLarry Finger  */
66f1d2b4d3SLarry Finger #define RTL8188EE_TRANS_CARDEMU_TO_ACT					\
67f1d2b4d3SLarry Finger 	{0x0006, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,	\
68f1d2b4d3SLarry Finger 	PWR_BASEADDR_MAC, PWR_CMD_POLLING, BIT(1), BIT(1)		\
69f1d2b4d3SLarry Finger 	/* wait till 0x04[17] = 1    power ready*/},			\
70f1d2b4d3SLarry Finger 	{0x0002, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,	\
71f1d2b4d3SLarry Finger 	PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(0)|BIT(1), 0		\
72f1d2b4d3SLarry Finger 	/* 0x02[1:0] = 0	reset BB*/},				\
73f1d2b4d3SLarry Finger 	{0x0026, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,	\
74f1d2b4d3SLarry Finger 	PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(7), BIT(7)			\
75f1d2b4d3SLarry Finger 	/*0x24[23] = 2b'01 schmit trigger */},				\
76f1d2b4d3SLarry Finger 	{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,	\
77f1d2b4d3SLarry Finger 	PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(7), 0			\
78f1d2b4d3SLarry Finger 	/* 0x04[15] = 0 disable HWPDN (control by DRV)*/},		\
79f1d2b4d3SLarry Finger 	{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,	\
80f1d2b4d3SLarry Finger 	PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(4)|BIT(3), 0		\
81f1d2b4d3SLarry Finger 	/*0x04[12:11] = 2b'00 disable WL suspend*/},			\
82f1d2b4d3SLarry Finger 	{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,	\
83f1d2b4d3SLarry Finger 	PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(0), BIT(0)			\
84f1d2b4d3SLarry Finger 	/*0x04[8] = 1 polling until return 0*/},			\
85f1d2b4d3SLarry Finger 	{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,	\
86f1d2b4d3SLarry Finger 	PWR_BASEADDR_MAC, PWR_CMD_POLLING, BIT(0), 0			\
87f1d2b4d3SLarry Finger 	/*wait till 0x04[8] = 0*/},					\
88f1d2b4d3SLarry Finger 	{0x0023, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,	\
89f1d2b4d3SLarry Finger 	PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(4), 0			\
90f1d2b4d3SLarry Finger 	/*LDO normal mode*/},						\
91f1d2b4d3SLarry Finger 	{0x0074, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK,	\
92f1d2b4d3SLarry Finger 	PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(4), BIT(4)			\
93f1d2b4d3SLarry Finger 	/*SDIO Driving*/},
94f1d2b4d3SLarry Finger 
95f1d2b4d3SLarry Finger #define RTL8188EE_TRANS_ACT_TO_CARDEMU					\
96f1d2b4d3SLarry Finger 	{0x001F, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,	\
97f1d2b4d3SLarry Finger 	PWR_BASEADDR_MAC, PWR_CMD_WRITE, 0xFF, 0			\
98f1d2b4d3SLarry Finger 	/*0x1F[7:0] = 0 turn off RF*/},					\
99f1d2b4d3SLarry Finger 	{0x0023, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,	\
100f1d2b4d3SLarry Finger 	PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(4), BIT(4)			\
101f1d2b4d3SLarry Finger 	/*LDO Sleep mode*/},						\
102f1d2b4d3SLarry Finger 	{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,	\
103f1d2b4d3SLarry Finger 	PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(1), BIT(1)			\
104f1d2b4d3SLarry Finger 	/*0x04[9] = 1 turn off MAC by HW state machine*/},		\
105f1d2b4d3SLarry Finger 	{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,	\
106f1d2b4d3SLarry Finger 	PWR_BASEADDR_MAC, PWR_CMD_POLLING, BIT(1), 0			\
107f1d2b4d3SLarry Finger 	/*wait till 0x04[9] = 0 polling until return 0 to disable*/},
108f1d2b4d3SLarry Finger 
109f1d2b4d3SLarry Finger #define RTL8188EE_TRANS_CARDEMU_TO_SUS					\
110f1d2b4d3SLarry Finger 	{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK,			\
111f1d2b4d3SLarry Finger 	PWR_INTF_USB_MSK|PWR_INTF_SDIO_MSK,				\
112f1d2b4d3SLarry Finger 	PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(3)|BIT(4), BIT(3)		\
113f1d2b4d3SLarry Finger 	/*0x04[12:11] = 2b'01enable WL suspend*/},			\
114f1d2b4d3SLarry Finger 	{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_PCI_MSK,	\
115f1d2b4d3SLarry Finger 	PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(3)|BIT(4), BIT(3)|BIT(4)	\
116f1d2b4d3SLarry Finger 	/*0x04[12:11] = 2b'11enable WL suspend for PCIe*/},		\
117f1d2b4d3SLarry Finger 	{0x0007, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK,			\
118f1d2b4d3SLarry Finger 	PWR_INTF_USB_MSK|PWR_INTF_SDIO_MSK,				\
119f1d2b4d3SLarry Finger 	PWR_BASEADDR_MAC, PWR_CMD_WRITE, 0xFF, BIT(7)			\
120f1d2b4d3SLarry Finger 	/*  0x04[31:30] = 2b'10 enable enable bandgap mbias in suspend */},\
121f1d2b4d3SLarry Finger 	{0x0041, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK,			\
122f1d2b4d3SLarry Finger 	PWR_INTF_USB_MSK|PWR_INTF_SDIO_MSK,				\
123f1d2b4d3SLarry Finger 	PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(4), 0			\
124f1d2b4d3SLarry Finger 	/*Clear SIC_EN register 0x40[12] = 1'b0 */},			\
125f1d2b4d3SLarry Finger 	{0xfe10, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK,			\
126f1d2b4d3SLarry Finger 	PWR_INTF_USB_MSK|PWR_INTF_SDIO_MSK,				\
127f1d2b4d3SLarry Finger 	PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(4), BIT(4)			\
128f1d2b4d3SLarry Finger 	/*Set USB suspend enable local register  0xfe10[4]=1 */},	\
129f1d2b4d3SLarry Finger 	{0x0086, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK,	\
130f1d2b4d3SLarry Finger 	PWR_BASEADDR_SDIO, PWR_CMD_WRITE, BIT(0), BIT(0)		\
131f1d2b4d3SLarry Finger 	/*Set SDIO suspend local register*/},				\
132f1d2b4d3SLarry Finger 	{0x0086, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK,	\
133f1d2b4d3SLarry Finger 	PWR_BASEADDR_SDIO, PWR_CMD_POLLING, BIT(1), 0			\
134f1d2b4d3SLarry Finger 	/*wait power state to suspend*/},
135f1d2b4d3SLarry Finger 
136f1d2b4d3SLarry Finger #define RTL8188EE_TRANS_SUS_TO_CARDEMU					\
137f1d2b4d3SLarry Finger 	{0x0086, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK,	\
138f1d2b4d3SLarry Finger 	PWR_BASEADDR_SDIO, PWR_CMD_WRITE, BIT(0), 0			\
139f1d2b4d3SLarry Finger 	/*Set SDIO suspend local register*/},				\
140f1d2b4d3SLarry Finger 	{0x0086, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK,	\
141f1d2b4d3SLarry Finger 	PWR_BASEADDR_SDIO, PWR_CMD_POLLING, BIT(1), BIT(1)		\
142f1d2b4d3SLarry Finger 	/*wait power state to suspend*/},				\
143f1d2b4d3SLarry Finger 	{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,	\
144f1d2b4d3SLarry Finger 	PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(3) | BIT(4), 0		\
145*692f5decSKevin Lo 	/*0x04[12:11] = 2b'00 disable WL suspend*/},
146f1d2b4d3SLarry Finger 
147f1d2b4d3SLarry Finger #define RTL8188EE_TRANS_CARDEMU_TO_CARDDIS				\
148f1d2b4d3SLarry Finger 	{0x0026, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,	\
149f1d2b4d3SLarry Finger 	PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(7), BIT(7)			\
150f1d2b4d3SLarry Finger 	/*0x24[23] = 2b'01 schmit trigger */},				\
151f1d2b4d3SLarry Finger 	{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK,			\
152f1d2b4d3SLarry Finger 	PWR_INTF_USB_MSK|PWR_INTF_SDIO_MSK,				\
153f1d2b4d3SLarry Finger 	PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(3) | BIT(4), BIT(3)	\
154f1d2b4d3SLarry Finger 	/*0x04[12:11] = 2b'01 enable WL suspend*/},			\
155f1d2b4d3SLarry Finger 	{0x0007, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK,			\
156f1d2b4d3SLarry Finger 	PWR_INTF_USB_MSK|PWR_INTF_SDIO_MSK,				\
157f1d2b4d3SLarry Finger 	PWR_BASEADDR_MAC, PWR_CMD_WRITE, 0xFF, 0			\
158f1d2b4d3SLarry Finger 	/*  0x04[31:30] = 2b'10 enable enable bandgap mbias in suspend */},\
159f1d2b4d3SLarry Finger 	{0x0041, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK,			\
160f1d2b4d3SLarry Finger 	PWR_INTF_USB_MSK|PWR_INTF_SDIO_MSK,				\
161f1d2b4d3SLarry Finger 	PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(4), 0			\
162f1d2b4d3SLarry Finger 	/*Clear SIC_EN register 0x40[12] = 1'b0 */},			\
163f1d2b4d3SLarry Finger 	{0xfe10, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_USB_MSK,	\
164f1d2b4d3SLarry Finger 	PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(4), BIT(4)			\
165f1d2b4d3SLarry Finger 	/*Set USB suspend enable local register  0xfe10[4]=1 */},	\
166f1d2b4d3SLarry Finger 	{0x0086, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK,	\
167f1d2b4d3SLarry Finger 	PWR_BASEADDR_SDIO, PWR_CMD_WRITE, BIT(0), BIT(0)		\
168f1d2b4d3SLarry Finger 	/*Set SDIO suspend local register*/},				\
169f1d2b4d3SLarry Finger 	{0x0086, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK,	\
170f1d2b4d3SLarry Finger 	PWR_BASEADDR_SDIO, PWR_CMD_POLLING, BIT(1), 0			\
171f1d2b4d3SLarry Finger 	/*wait power state to suspend*/},
172f1d2b4d3SLarry Finger 
173f1d2b4d3SLarry Finger #define RTL8188EE_TRANS_CARDDIS_TO_CARDEMU				\
174f1d2b4d3SLarry Finger 	{0x0086, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK,	\
175f1d2b4d3SLarry Finger 	PWR_BASEADDR_SDIO, PWR_CMD_WRITE, BIT(0), 0			\
176f1d2b4d3SLarry Finger 	/*Set SDIO suspend local register*/},				\
177f1d2b4d3SLarry Finger 	{0x0086, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK,	\
178f1d2b4d3SLarry Finger 	PWR_BASEADDR_SDIO, PWR_CMD_POLLING, BIT(1), BIT(1)		\
179f1d2b4d3SLarry Finger 	/*wait power state to suspend*/},				\
180f1d2b4d3SLarry Finger 	{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,	\
181f1d2b4d3SLarry Finger 	PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(3)|BIT(4), 0		\
182*692f5decSKevin Lo 	/*0x04[12:11] = 2b'00 disable WL suspend*/},
183f1d2b4d3SLarry Finger 
184f1d2b4d3SLarry Finger #define RTL8188EE_TRANS_CARDEMU_TO_PDN					\
185f1d2b4d3SLarry Finger 	{0x0006, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,	\
186f1d2b4d3SLarry Finger 	PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(0), 0/* 0x04[16] = 0*/},	\
187f1d2b4d3SLarry Finger 	{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,	\
188f1d2b4d3SLarry Finger 	PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(7), BIT(7)			\
189f1d2b4d3SLarry Finger 	/* 0x04[15] = 1*/},
190f1d2b4d3SLarry Finger 
191f1d2b4d3SLarry Finger #define RTL8188EE_TRANS_PDN_TO_CARDEMU					\
192f1d2b4d3SLarry Finger 	{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,	\
193f1d2b4d3SLarry Finger 	PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(7), 0/* 0x04[15] = 0*/},
194f1d2b4d3SLarry Finger 
195f1d2b4d3SLarry Finger #define RTL8188EE_TRANS_ACT_TO_LPS					\
196f1d2b4d3SLarry Finger 	{0x0522, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,	\
197f1d2b4d3SLarry Finger 	PWR_BASEADDR_MAC, PWR_CMD_WRITE, 0xFF, 0x7F			\
198f1d2b4d3SLarry Finger 	/*Tx Pause*/},							\
199f1d2b4d3SLarry Finger 	{0x05F8, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,	\
200f1d2b4d3SLarry Finger 	PWR_BASEADDR_MAC, PWR_CMD_POLLING, 0xFF, 0			\
201f1d2b4d3SLarry Finger 	/*Should be zero if no packet is transmitting*/},		\
202f1d2b4d3SLarry Finger 	{0x05F9, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,	\
203f1d2b4d3SLarry Finger 	PWR_BASEADDR_MAC, PWR_CMD_POLLING, 0xFF, 0			\
204f1d2b4d3SLarry Finger 	/*Should be zero if no packet is transmitting*/},		\
205f1d2b4d3SLarry Finger 	{0x05FA, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,	\
206f1d2b4d3SLarry Finger 	PWR_BASEADDR_MAC, PWR_CMD_POLLING, 0xFF, 0			\
207f1d2b4d3SLarry Finger 	/*Should be zero if no packet is transmitting*/},		\
208f1d2b4d3SLarry Finger 	{0x05FB, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,	\
209f1d2b4d3SLarry Finger 	PWR_BASEADDR_MAC, PWR_CMD_POLLING, 0xFF, 0			\
210f1d2b4d3SLarry Finger 	/*Should be zero if no packet is transmitting*/},		\
211f1d2b4d3SLarry Finger 	{0x0002, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,	\
212f1d2b4d3SLarry Finger 	PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(0), 0			\
213f1d2b4d3SLarry Finger 	/*CCK and OFDM are disabled,and clock are gated*/},		\
214f1d2b4d3SLarry Finger 	{0x0002, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,	\
215f1d2b4d3SLarry Finger 	PWR_BASEADDR_MAC, PWR_CMD_DELAY, 0, PWRSEQ_DELAY_US		\
216f1d2b4d3SLarry Finger 	/*Delay 1us*/},							\
217f1d2b4d3SLarry Finger 	{0x0100, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,	\
218f1d2b4d3SLarry Finger 	PWR_BASEADDR_MAC, PWR_CMD_WRITE, 0xFF, 0x3F			\
219f1d2b4d3SLarry Finger 	/*Reset MAC TRX*/},						\
220f1d2b4d3SLarry Finger 	{0x0101, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,	\
221f1d2b4d3SLarry Finger 	PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(1), 0			\
222f1d2b4d3SLarry Finger 	/*check if removed later*/},					\
223f1d2b4d3SLarry Finger 	{0x0553, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,	\
224f1d2b4d3SLarry Finger 	PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(5), BIT(5)			\
225f1d2b4d3SLarry Finger 	/*Respond TxOK to scheduler*/},
226f1d2b4d3SLarry Finger 
227f1d2b4d3SLarry Finger 
228f1d2b4d3SLarry Finger #define RTL8188EE_TRANS_LPS_TO_ACT					\
229f1d2b4d3SLarry Finger 	{0x0080, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK,	\
230f1d2b4d3SLarry Finger 	PWR_BASEADDR_SDIO, PWR_CMD_WRITE, 0xFF, 0x84			\
231f1d2b4d3SLarry Finger 	/*SDIO RPWM*/},							\
232f1d2b4d3SLarry Finger 	{0xFE58, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_USB_MSK,	\
233f1d2b4d3SLarry Finger 	PWR_BASEADDR_MAC, PWR_CMD_WRITE, 0xFF, 0x84			\
234f1d2b4d3SLarry Finger 	/*USB RPWM*/},							\
235f1d2b4d3SLarry Finger 	{0x0361, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_PCI_MSK,	\
236f1d2b4d3SLarry Finger 	PWR_BASEADDR_MAC, PWR_CMD_WRITE, 0xFF, 0x84			\
237f1d2b4d3SLarry Finger 	/*PCIe RPWM*/},							\
238f1d2b4d3SLarry Finger 	{0x0002, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,	\
239f1d2b4d3SLarry Finger 	PWR_BASEADDR_MAC, PWR_CMD_DELAY, 0, PWRSEQ_DELAY_MS		\
240f1d2b4d3SLarry Finger 	/*Delay*/},							\
241f1d2b4d3SLarry Finger 	{0x0008, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,	\
242f1d2b4d3SLarry Finger 	PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(4), 0			\
243f1d2b4d3SLarry Finger 	/*.	0x08[4] = 0		 switch TSF to 40M*/},		\
244f1d2b4d3SLarry Finger 	{0x0109, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,	\
245f1d2b4d3SLarry Finger 	PWR_BASEADDR_MAC, PWR_CMD_POLLING, BIT(7), 0			\
246f1d2b4d3SLarry Finger 	/*Polling 0x109[7]=0  TSF in 40M*/},				\
247f1d2b4d3SLarry Finger 	{0x0029, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,	\
248f1d2b4d3SLarry Finger 	PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(6)|BIT(7), 0		\
249f1d2b4d3SLarry Finger 	/*.	0x29[7:6] = 2b'00	 enable BB clock*/},		\
250f1d2b4d3SLarry Finger 	{0x0101, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,	\
251f1d2b4d3SLarry Finger 	PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(1), BIT(1)			\
252f1d2b4d3SLarry Finger 	/*.	0x101[1] = 1*/},					\
253f1d2b4d3SLarry Finger 	{0x0100, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,	\
254f1d2b4d3SLarry Finger 	PWR_BASEADDR_MAC, PWR_CMD_WRITE, 0xFF, 0xFF			\
255f1d2b4d3SLarry Finger 	/*.	0x100[7:0] = 0xFF	 enable WMAC TRX*/},		\
256f1d2b4d3SLarry Finger 	{0x0002, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,	\
257f1d2b4d3SLarry Finger 	PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(1)|BIT(0), BIT(1)|BIT(0)	\
258f1d2b4d3SLarry Finger 	/*.	0x02[1:0] = 2b'11	 enable BB macro*/},		\
259f1d2b4d3SLarry Finger 	{0x0522, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,	\
260f1d2b4d3SLarry Finger 	PWR_BASEADDR_MAC, PWR_CMD_WRITE, 0xFF, 0			\
261f1d2b4d3SLarry Finger 	/*.	0x522 = 0*/},
262f1d2b4d3SLarry Finger 
263f1d2b4d3SLarry Finger #define RTL8188EE_TRANS_END		\
264f1d2b4d3SLarry Finger 	{0xFFFF, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,\
265f1d2b4d3SLarry Finger 	0, PWR_CMD_END, 0, 0}
266f1d2b4d3SLarry Finger 
267f1d2b4d3SLarry Finger extern struct wlan_pwr_cfg rtl8188ee_power_on_flow
268f1d2b4d3SLarry Finger 		[RTL8188EE_TRANS_CARDEMU_TO_ACT_STEPS +
269f1d2b4d3SLarry Finger 		 RTL8188EE_TRANS_END_STEPS];
270f1d2b4d3SLarry Finger extern struct wlan_pwr_cfg rtl8188ee_radio_off_flow
271f1d2b4d3SLarry Finger 		[RTL8188EE_TRANS_ACT_TO_CARDEMU_STEPS +
272f1d2b4d3SLarry Finger 		 RTL8188EE_TRANS_END_STEPS];
273f1d2b4d3SLarry Finger extern struct wlan_pwr_cfg rtl8188ee_card_disable_flow
274f1d2b4d3SLarry Finger 		[RTL8188EE_TRANS_ACT_TO_CARDEMU_STEPS +
275f1d2b4d3SLarry Finger 		 RTL8188EE_TRANS_CARDEMU_TO_PDN_STEPS +
276f1d2b4d3SLarry Finger 		 RTL8188EE_TRANS_END_STEPS];
277f1d2b4d3SLarry Finger extern struct wlan_pwr_cfg rtl8188ee_card_enable_flow
278f1d2b4d3SLarry Finger 		[RTL8188EE_TRANS_ACT_TO_CARDEMU_STEPS +
279f1d2b4d3SLarry Finger 		 RTL8188EE_TRANS_CARDEMU_TO_PDN_STEPS +
280f1d2b4d3SLarry Finger 		 RTL8188EE_TRANS_END_STEPS];
281f1d2b4d3SLarry Finger extern struct wlan_pwr_cfg rtl8188ee_suspend_flow
282f1d2b4d3SLarry Finger 		[RTL8188EE_TRANS_ACT_TO_CARDEMU_STEPS +
283f1d2b4d3SLarry Finger 		 RTL8188EE_TRANS_CARDEMU_TO_SUS_STEPS +
284f1d2b4d3SLarry Finger 		 RTL8188EE_TRANS_END_STEPS];
285f1d2b4d3SLarry Finger extern struct wlan_pwr_cfg rtl8188ee_resume_flow
286f1d2b4d3SLarry Finger 		[RTL8188EE_TRANS_ACT_TO_CARDEMU_STEPS +
287f1d2b4d3SLarry Finger 		 RTL8188EE_TRANS_CARDEMU_TO_SUS_STEPS +
288f1d2b4d3SLarry Finger 		 RTL8188EE_TRANS_END_STEPS];
289f1d2b4d3SLarry Finger extern struct wlan_pwr_cfg rtl8188ee_hwpdn_flow
290f1d2b4d3SLarry Finger 		[RTL8188EE_TRANS_ACT_TO_CARDEMU_STEPS +
291f1d2b4d3SLarry Finger 		 RTL8188EE_TRANS_CARDEMU_TO_PDN_STEPS +
292f1d2b4d3SLarry Finger 		 RTL8188EE_TRANS_END_STEPS];
293f1d2b4d3SLarry Finger extern struct wlan_pwr_cfg rtl8188ee_enter_lps_flow
294f1d2b4d3SLarry Finger 		[RTL8188EE_TRANS_ACT_TO_LPS_STEPS +
295f1d2b4d3SLarry Finger 		 RTL8188EE_TRANS_END_STEPS];
296f1d2b4d3SLarry Finger extern struct wlan_pwr_cfg rtl8188ee_leave_lps_flow
297f1d2b4d3SLarry Finger 		[RTL8188EE_TRANS_LPS_TO_ACT_STEPS +
298f1d2b4d3SLarry Finger 		 RTL8188EE_TRANS_END_STEPS];
299f1d2b4d3SLarry Finger 
300f1d2b4d3SLarry Finger /* RTL8723 Power Configuration CMDs for PCIe interface */
301f1d2b4d3SLarry Finger #define RTL8188EE_NIC_PWR_ON_FLOW	rtl8188ee_power_on_flow
302f1d2b4d3SLarry Finger #define RTL8188EE_NIC_RF_OFF_FLOW	rtl8188ee_radio_off_flow
303f1d2b4d3SLarry Finger #define RTL8188EE_NIC_DISABLE_FLOW	rtl8188ee_card_disable_flow
304f1d2b4d3SLarry Finger #define RTL8188EE_NIC_ENABLE_FLOW	rtl8188ee_card_enable_flow
305f1d2b4d3SLarry Finger #define RTL8188EE_NIC_SUSPEND_FLOW	rtl8188ee_suspend_flow
306f1d2b4d3SLarry Finger #define RTL8188EE_NIC_RESUME_FLOW	rtl8188ee_resume_flow
307f1d2b4d3SLarry Finger #define RTL8188EE_NIC_PDN_FLOW		rtl8188ee_hwpdn_flow
308f1d2b4d3SLarry Finger #define RTL8188EE_NIC_LPS_ENTER_FLOW	rtl8188ee_enter_lps_flow
309f1d2b4d3SLarry Finger #define RTL8188EE_NIC_LPS_LEAVE_FLOW	rtl8188ee_leave_lps_flow
310f1d2b4d3SLarry Finger 
311f1d2b4d3SLarry Finger #endif
312