18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
28c2ecf20Sopenharmony_ci/* Copyright(c) 2009-2013  Realtek Corporation.*/
38c2ecf20Sopenharmony_ci
48c2ecf20Sopenharmony_ci#ifndef __RTL8723E_PWRSEQ_H__
58c2ecf20Sopenharmony_ci#define __RTL8723E_PWRSEQ_H__
68c2ecf20Sopenharmony_ci
78c2ecf20Sopenharmony_ci#include "../pwrseqcmd.h"
88c2ecf20Sopenharmony_ci/* Check document WM-20110607-Paul-RTL8188EE_Power_Architecture-R02.vsd
98c2ecf20Sopenharmony_ci *	There are 6 HW Power States:
108c2ecf20Sopenharmony_ci *	0: POFF--Power Off
118c2ecf20Sopenharmony_ci *	1: PDN--Power Down
128c2ecf20Sopenharmony_ci *	2: CARDEMU--Card Emulation
138c2ecf20Sopenharmony_ci *	3: ACT--Active Mode
148c2ecf20Sopenharmony_ci *	4: LPS--Low Power State
158c2ecf20Sopenharmony_ci *	5: SUS--Suspend
168c2ecf20Sopenharmony_ci *
178c2ecf20Sopenharmony_ci *	The transision from different states are defined below
188c2ecf20Sopenharmony_ci *	TRANS_CARDEMU_TO_ACT
198c2ecf20Sopenharmony_ci *	TRANS_ACT_TO_CARDEMU
208c2ecf20Sopenharmony_ci *	TRANS_CARDEMU_TO_SUS
218c2ecf20Sopenharmony_ci *	TRANS_SUS_TO_CARDEMU
228c2ecf20Sopenharmony_ci *	TRANS_CARDEMU_TO_PDN
238c2ecf20Sopenharmony_ci *	TRANS_ACT_TO_LPS
248c2ecf20Sopenharmony_ci *	TRANS_LPS_TO_ACT
258c2ecf20Sopenharmony_ci *
268c2ecf20Sopenharmony_ci *	TRANS_END
278c2ecf20Sopenharmony_ci *	PWR SEQ Version: rtl8188ee_PwrSeq_V09.h
288c2ecf20Sopenharmony_ci */
298c2ecf20Sopenharmony_ci
308c2ecf20Sopenharmony_ci#define	RTL8188EE_TRANS_CARDEMU_TO_ACT_STEPS	10
318c2ecf20Sopenharmony_ci#define	RTL8188EE_TRANS_ACT_TO_CARDEMU_STEPS	10
328c2ecf20Sopenharmony_ci#define	RTL8188EE_TRANS_CARDEMU_TO_SUS_STEPS	10
338c2ecf20Sopenharmony_ci#define	RTL8188EE_TRANS_SUS_TO_CARDEMU_STEPS	10
348c2ecf20Sopenharmony_ci#define	RTL8188EE_TRANS_CARDEMU_TO_PDN_STEPS	10
358c2ecf20Sopenharmony_ci#define	RTL8188EE_TRANS_PDN_TO_CARDEMU_STEPS	10
368c2ecf20Sopenharmony_ci#define	RTL8188EE_TRANS_ACT_TO_LPS_STEPS		15
378c2ecf20Sopenharmony_ci#define	RTL8188EE_TRANS_LPS_TO_ACT_STEPS		15
388c2ecf20Sopenharmony_ci#define	RTL8188EE_TRANS_END_STEPS		1
398c2ecf20Sopenharmony_ci
408c2ecf20Sopenharmony_ci/* The following macros have the following format:
418c2ecf20Sopenharmony_ci * { offset, cut_msk, fab_msk|interface_msk, base|cmd, msk, value
428c2ecf20Sopenharmony_ci *   comments },
438c2ecf20Sopenharmony_ci */
448c2ecf20Sopenharmony_ci#define RTL8188EE_TRANS_CARDEMU_TO_ACT					\
458c2ecf20Sopenharmony_ci	{0x0006, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,	\
468c2ecf20Sopenharmony_ci	PWR_BASEADDR_MAC, PWR_CMD_POLLING, BIT(1), BIT(1)		\
478c2ecf20Sopenharmony_ci	/* wait till 0x04[17] = 1    power ready*/},			\
488c2ecf20Sopenharmony_ci	{0x0002, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,	\
498c2ecf20Sopenharmony_ci	PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(0)|BIT(1), 0		\
508c2ecf20Sopenharmony_ci	/* 0x02[1:0] = 0	reset BB*/},				\
518c2ecf20Sopenharmony_ci	{0x0026, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,	\
528c2ecf20Sopenharmony_ci	PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(7), BIT(7)			\
538c2ecf20Sopenharmony_ci	/*0x24[23] = 2b'01 schmit trigger */},				\
548c2ecf20Sopenharmony_ci	{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,	\
558c2ecf20Sopenharmony_ci	PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(7), 0			\
568c2ecf20Sopenharmony_ci	/* 0x04[15] = 0 disable HWPDN (control by DRV)*/},		\
578c2ecf20Sopenharmony_ci	{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,	\
588c2ecf20Sopenharmony_ci	PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(4)|BIT(3), 0		\
598c2ecf20Sopenharmony_ci	/*0x04[12:11] = 2b'00 disable WL suspend*/},			\
608c2ecf20Sopenharmony_ci	{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,	\
618c2ecf20Sopenharmony_ci	PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(0), BIT(0)			\
628c2ecf20Sopenharmony_ci	/*0x04[8] = 1 polling until return 0*/},			\
638c2ecf20Sopenharmony_ci	{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,	\
648c2ecf20Sopenharmony_ci	PWR_BASEADDR_MAC, PWR_CMD_POLLING, BIT(0), 0			\
658c2ecf20Sopenharmony_ci	/*wait till 0x04[8] = 0*/},					\
668c2ecf20Sopenharmony_ci	{0x0023, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,	\
678c2ecf20Sopenharmony_ci	PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(4), 0			\
688c2ecf20Sopenharmony_ci	/*LDO normal mode*/},						\
698c2ecf20Sopenharmony_ci	{0x0074, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK,	\
708c2ecf20Sopenharmony_ci	PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(4), BIT(4)			\
718c2ecf20Sopenharmony_ci	/*SDIO Driving*/},
728c2ecf20Sopenharmony_ci
738c2ecf20Sopenharmony_ci#define RTL8188EE_TRANS_ACT_TO_CARDEMU					\
748c2ecf20Sopenharmony_ci	{0x001F, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,	\
758c2ecf20Sopenharmony_ci	PWR_BASEADDR_MAC, PWR_CMD_WRITE, 0xFF, 0			\
768c2ecf20Sopenharmony_ci	/*0x1F[7:0] = 0 turn off RF*/},					\
778c2ecf20Sopenharmony_ci	{0x0023, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,	\
788c2ecf20Sopenharmony_ci	PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(4), BIT(4)			\
798c2ecf20Sopenharmony_ci	/*LDO Sleep mode*/},						\
808c2ecf20Sopenharmony_ci	{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,	\
818c2ecf20Sopenharmony_ci	PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(1), BIT(1)			\
828c2ecf20Sopenharmony_ci	/*0x04[9] = 1 turn off MAC by HW state machine*/},		\
838c2ecf20Sopenharmony_ci	{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,	\
848c2ecf20Sopenharmony_ci	PWR_BASEADDR_MAC, PWR_CMD_POLLING, BIT(1), 0			\
858c2ecf20Sopenharmony_ci	/*wait till 0x04[9] = 0 polling until return 0 to disable*/},
868c2ecf20Sopenharmony_ci
878c2ecf20Sopenharmony_ci#define RTL8188EE_TRANS_CARDEMU_TO_SUS					\
888c2ecf20Sopenharmony_ci	{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK,			\
898c2ecf20Sopenharmony_ci	PWR_INTF_USB_MSK|PWR_INTF_SDIO_MSK,				\
908c2ecf20Sopenharmony_ci	PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(3)|BIT(4), BIT(3)		\
918c2ecf20Sopenharmony_ci	/*0x04[12:11] = 2b'01enable WL suspend*/},			\
928c2ecf20Sopenharmony_ci	{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_PCI_MSK,	\
938c2ecf20Sopenharmony_ci	PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(3)|BIT(4), BIT(3)|BIT(4)	\
948c2ecf20Sopenharmony_ci	/*0x04[12:11] = 2b'11enable WL suspend for PCIe*/},		\
958c2ecf20Sopenharmony_ci	{0x0007, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK,			\
968c2ecf20Sopenharmony_ci	PWR_INTF_USB_MSK|PWR_INTF_SDIO_MSK,				\
978c2ecf20Sopenharmony_ci	PWR_BASEADDR_MAC, PWR_CMD_WRITE, 0xFF, BIT(7)			\
988c2ecf20Sopenharmony_ci	/*  0x04[31:30] = 2b'10 enable enable bandgap mbias in suspend */},\
998c2ecf20Sopenharmony_ci	{0x0041, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK,			\
1008c2ecf20Sopenharmony_ci	PWR_INTF_USB_MSK|PWR_INTF_SDIO_MSK,				\
1018c2ecf20Sopenharmony_ci	PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(4), 0			\
1028c2ecf20Sopenharmony_ci	/*Clear SIC_EN register 0x40[12] = 1'b0 */},			\
1038c2ecf20Sopenharmony_ci	{0xfe10, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK,			\
1048c2ecf20Sopenharmony_ci	PWR_INTF_USB_MSK|PWR_INTF_SDIO_MSK,				\
1058c2ecf20Sopenharmony_ci	PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(4), BIT(4)			\
1068c2ecf20Sopenharmony_ci	/*Set USB suspend enable local register  0xfe10[4]=1 */},	\
1078c2ecf20Sopenharmony_ci	{0x0086, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK,	\
1088c2ecf20Sopenharmony_ci	PWR_BASEADDR_SDIO, PWR_CMD_WRITE, BIT(0), BIT(0)		\
1098c2ecf20Sopenharmony_ci	/*Set SDIO suspend local register*/},				\
1108c2ecf20Sopenharmony_ci	{0x0086, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK,	\
1118c2ecf20Sopenharmony_ci	PWR_BASEADDR_SDIO, PWR_CMD_POLLING, BIT(1), 0			\
1128c2ecf20Sopenharmony_ci	/*wait power state to suspend*/},
1138c2ecf20Sopenharmony_ci
1148c2ecf20Sopenharmony_ci#define RTL8188EE_TRANS_SUS_TO_CARDEMU					\
1158c2ecf20Sopenharmony_ci	{0x0086, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK,	\
1168c2ecf20Sopenharmony_ci	PWR_BASEADDR_SDIO, PWR_CMD_WRITE, BIT(0), 0			\
1178c2ecf20Sopenharmony_ci	/*Set SDIO suspend local register*/},				\
1188c2ecf20Sopenharmony_ci	{0x0086, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK,	\
1198c2ecf20Sopenharmony_ci	PWR_BASEADDR_SDIO, PWR_CMD_POLLING, BIT(1), BIT(1)		\
1208c2ecf20Sopenharmony_ci	/*wait power state to suspend*/},				\
1218c2ecf20Sopenharmony_ci	{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,	\
1228c2ecf20Sopenharmony_ci	PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(3) | BIT(4), 0		\
1238c2ecf20Sopenharmony_ci	/*0x04[12:11] = 2b'00 disable WL suspend*/},
1248c2ecf20Sopenharmony_ci
1258c2ecf20Sopenharmony_ci#define RTL8188EE_TRANS_CARDEMU_TO_CARDDIS				\
1268c2ecf20Sopenharmony_ci	{0x0026, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,	\
1278c2ecf20Sopenharmony_ci	PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(7), BIT(7)			\
1288c2ecf20Sopenharmony_ci	/*0x24[23] = 2b'01 schmit trigger */},				\
1298c2ecf20Sopenharmony_ci	{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK,			\
1308c2ecf20Sopenharmony_ci	PWR_INTF_USB_MSK|PWR_INTF_SDIO_MSK,				\
1318c2ecf20Sopenharmony_ci	PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(3) | BIT(4), BIT(3)	\
1328c2ecf20Sopenharmony_ci	/*0x04[12:11] = 2b'01 enable WL suspend*/},			\
1338c2ecf20Sopenharmony_ci	{0x0007, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK,			\
1348c2ecf20Sopenharmony_ci	PWR_INTF_USB_MSK|PWR_INTF_SDIO_MSK,				\
1358c2ecf20Sopenharmony_ci	PWR_BASEADDR_MAC, PWR_CMD_WRITE, 0xFF, 0			\
1368c2ecf20Sopenharmony_ci	/*  0x04[31:30] = 2b'10 enable enable bandgap mbias in suspend */},\
1378c2ecf20Sopenharmony_ci	{0x0041, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK,			\
1388c2ecf20Sopenharmony_ci	PWR_INTF_USB_MSK|PWR_INTF_SDIO_MSK,				\
1398c2ecf20Sopenharmony_ci	PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(4), 0			\
1408c2ecf20Sopenharmony_ci	/*Clear SIC_EN register 0x40[12] = 1'b0 */},			\
1418c2ecf20Sopenharmony_ci	{0xfe10, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_USB_MSK,	\
1428c2ecf20Sopenharmony_ci	PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(4), BIT(4)			\
1438c2ecf20Sopenharmony_ci	/*Set USB suspend enable local register  0xfe10[4]=1 */},	\
1448c2ecf20Sopenharmony_ci	{0x0086, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK,	\
1458c2ecf20Sopenharmony_ci	PWR_BASEADDR_SDIO, PWR_CMD_WRITE, BIT(0), BIT(0)		\
1468c2ecf20Sopenharmony_ci	/*Set SDIO suspend local register*/},				\
1478c2ecf20Sopenharmony_ci	{0x0086, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK,	\
1488c2ecf20Sopenharmony_ci	PWR_BASEADDR_SDIO, PWR_CMD_POLLING, BIT(1), 0			\
1498c2ecf20Sopenharmony_ci	/*wait power state to suspend*/},
1508c2ecf20Sopenharmony_ci
1518c2ecf20Sopenharmony_ci#define RTL8188EE_TRANS_CARDDIS_TO_CARDEMU				\
1528c2ecf20Sopenharmony_ci	{0x0086, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK,	\
1538c2ecf20Sopenharmony_ci	PWR_BASEADDR_SDIO, PWR_CMD_WRITE, BIT(0), 0			\
1548c2ecf20Sopenharmony_ci	/*Set SDIO suspend local register*/},				\
1558c2ecf20Sopenharmony_ci	{0x0086, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK,	\
1568c2ecf20Sopenharmony_ci	PWR_BASEADDR_SDIO, PWR_CMD_POLLING, BIT(1), BIT(1)		\
1578c2ecf20Sopenharmony_ci	/*wait power state to suspend*/},				\
1588c2ecf20Sopenharmony_ci	{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,	\
1598c2ecf20Sopenharmony_ci	PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(3)|BIT(4), 0		\
1608c2ecf20Sopenharmony_ci	/*0x04[12:11] = 2b'00 disable WL suspend*/},
1618c2ecf20Sopenharmony_ci
1628c2ecf20Sopenharmony_ci#define RTL8188EE_TRANS_CARDEMU_TO_PDN					\
1638c2ecf20Sopenharmony_ci	{0x0006, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,	\
1648c2ecf20Sopenharmony_ci	PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(0), 0/* 0x04[16] = 0*/},	\
1658c2ecf20Sopenharmony_ci	{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,	\
1668c2ecf20Sopenharmony_ci	PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(7), BIT(7)			\
1678c2ecf20Sopenharmony_ci	/* 0x04[15] = 1*/},
1688c2ecf20Sopenharmony_ci
1698c2ecf20Sopenharmony_ci#define RTL8188EE_TRANS_PDN_TO_CARDEMU					\
1708c2ecf20Sopenharmony_ci	{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,	\
1718c2ecf20Sopenharmony_ci	PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(7), 0/* 0x04[15] = 0*/},
1728c2ecf20Sopenharmony_ci
1738c2ecf20Sopenharmony_ci#define RTL8188EE_TRANS_ACT_TO_LPS					\
1748c2ecf20Sopenharmony_ci	{0x0522, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,	\
1758c2ecf20Sopenharmony_ci	PWR_BASEADDR_MAC, PWR_CMD_WRITE, 0xFF, 0x7F			\
1768c2ecf20Sopenharmony_ci	/*Tx Pause*/},							\
1778c2ecf20Sopenharmony_ci	{0x05F8, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,	\
1788c2ecf20Sopenharmony_ci	PWR_BASEADDR_MAC, PWR_CMD_POLLING, 0xFF, 0			\
1798c2ecf20Sopenharmony_ci	/*Should be zero if no packet is transmitting*/},		\
1808c2ecf20Sopenharmony_ci	{0x05F9, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,	\
1818c2ecf20Sopenharmony_ci	PWR_BASEADDR_MAC, PWR_CMD_POLLING, 0xFF, 0			\
1828c2ecf20Sopenharmony_ci	/*Should be zero if no packet is transmitting*/},		\
1838c2ecf20Sopenharmony_ci	{0x05FA, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,	\
1848c2ecf20Sopenharmony_ci	PWR_BASEADDR_MAC, PWR_CMD_POLLING, 0xFF, 0			\
1858c2ecf20Sopenharmony_ci	/*Should be zero if no packet is transmitting*/},		\
1868c2ecf20Sopenharmony_ci	{0x05FB, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,	\
1878c2ecf20Sopenharmony_ci	PWR_BASEADDR_MAC, PWR_CMD_POLLING, 0xFF, 0			\
1888c2ecf20Sopenharmony_ci	/*Should be zero if no packet is transmitting*/},		\
1898c2ecf20Sopenharmony_ci	{0x0002, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,	\
1908c2ecf20Sopenharmony_ci	PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(0), 0			\
1918c2ecf20Sopenharmony_ci	/*CCK and OFDM are disabled,and clock are gated*/},		\
1928c2ecf20Sopenharmony_ci	{0x0002, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,	\
1938c2ecf20Sopenharmony_ci	PWR_BASEADDR_MAC, PWR_CMD_DELAY, 0, PWRSEQ_DELAY_US		\
1948c2ecf20Sopenharmony_ci	/*Delay 1us*/},							\
1958c2ecf20Sopenharmony_ci	{0x0100, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,	\
1968c2ecf20Sopenharmony_ci	PWR_BASEADDR_MAC, PWR_CMD_WRITE, 0xFF, 0x3F			\
1978c2ecf20Sopenharmony_ci	/*Reset MAC TRX*/},						\
1988c2ecf20Sopenharmony_ci	{0x0101, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,	\
1998c2ecf20Sopenharmony_ci	PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(1), 0			\
2008c2ecf20Sopenharmony_ci	/*check if removed later*/},					\
2018c2ecf20Sopenharmony_ci	{0x0553, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,	\
2028c2ecf20Sopenharmony_ci	PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(5), BIT(5)			\
2038c2ecf20Sopenharmony_ci	/*Respond TxOK to scheduler*/},
2048c2ecf20Sopenharmony_ci
2058c2ecf20Sopenharmony_ci
2068c2ecf20Sopenharmony_ci#define RTL8188EE_TRANS_LPS_TO_ACT					\
2078c2ecf20Sopenharmony_ci	{0x0080, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK,	\
2088c2ecf20Sopenharmony_ci	PWR_BASEADDR_SDIO, PWR_CMD_WRITE, 0xFF, 0x84			\
2098c2ecf20Sopenharmony_ci	/*SDIO RPWM*/},							\
2108c2ecf20Sopenharmony_ci	{0xFE58, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_USB_MSK,	\
2118c2ecf20Sopenharmony_ci	PWR_BASEADDR_MAC, PWR_CMD_WRITE, 0xFF, 0x84			\
2128c2ecf20Sopenharmony_ci	/*USB RPWM*/},							\
2138c2ecf20Sopenharmony_ci	{0x0361, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_PCI_MSK,	\
2148c2ecf20Sopenharmony_ci	PWR_BASEADDR_MAC, PWR_CMD_WRITE, 0xFF, 0x84			\
2158c2ecf20Sopenharmony_ci	/*PCIe RPWM*/},							\
2168c2ecf20Sopenharmony_ci	{0x0002, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,	\
2178c2ecf20Sopenharmony_ci	PWR_BASEADDR_MAC, PWR_CMD_DELAY, 0, PWRSEQ_DELAY_MS		\
2188c2ecf20Sopenharmony_ci	/*Delay*/},							\
2198c2ecf20Sopenharmony_ci	{0x0008, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,	\
2208c2ecf20Sopenharmony_ci	PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(4), 0			\
2218c2ecf20Sopenharmony_ci	/*.	0x08[4] = 0		 switch TSF to 40M*/},		\
2228c2ecf20Sopenharmony_ci	{0x0109, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,	\
2238c2ecf20Sopenharmony_ci	PWR_BASEADDR_MAC, PWR_CMD_POLLING, BIT(7), 0			\
2248c2ecf20Sopenharmony_ci	/*Polling 0x109[7]=0  TSF in 40M*/},				\
2258c2ecf20Sopenharmony_ci	{0x0029, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,	\
2268c2ecf20Sopenharmony_ci	PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(6)|BIT(7), 0		\
2278c2ecf20Sopenharmony_ci	/*.	0x29[7:6] = 2b'00	 enable BB clock*/},		\
2288c2ecf20Sopenharmony_ci	{0x0101, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,	\
2298c2ecf20Sopenharmony_ci	PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(1), BIT(1)			\
2308c2ecf20Sopenharmony_ci	/*.	0x101[1] = 1*/},					\
2318c2ecf20Sopenharmony_ci	{0x0100, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,	\
2328c2ecf20Sopenharmony_ci	PWR_BASEADDR_MAC, PWR_CMD_WRITE, 0xFF, 0xFF			\
2338c2ecf20Sopenharmony_ci	/*.	0x100[7:0] = 0xFF	 enable WMAC TRX*/},		\
2348c2ecf20Sopenharmony_ci	{0x0002, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,	\
2358c2ecf20Sopenharmony_ci	PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(1)|BIT(0), BIT(1)|BIT(0)	\
2368c2ecf20Sopenharmony_ci	/*.	0x02[1:0] = 2b'11	 enable BB macro*/},		\
2378c2ecf20Sopenharmony_ci	{0x0522, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,	\
2388c2ecf20Sopenharmony_ci	PWR_BASEADDR_MAC, PWR_CMD_WRITE, 0xFF, 0			\
2398c2ecf20Sopenharmony_ci	/*.	0x522 = 0*/},
2408c2ecf20Sopenharmony_ci
2418c2ecf20Sopenharmony_ci#define RTL8188EE_TRANS_END		\
2428c2ecf20Sopenharmony_ci	{0xFFFF, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,\
2438c2ecf20Sopenharmony_ci	0, PWR_CMD_END, 0, 0}
2448c2ecf20Sopenharmony_ci
2458c2ecf20Sopenharmony_ciextern struct wlan_pwr_cfg rtl8188ee_power_on_flow
2468c2ecf20Sopenharmony_ci		[RTL8188EE_TRANS_CARDEMU_TO_ACT_STEPS +
2478c2ecf20Sopenharmony_ci		 RTL8188EE_TRANS_END_STEPS];
2488c2ecf20Sopenharmony_ciextern struct wlan_pwr_cfg rtl8188ee_radio_off_flow
2498c2ecf20Sopenharmony_ci		[RTL8188EE_TRANS_ACT_TO_CARDEMU_STEPS +
2508c2ecf20Sopenharmony_ci		 RTL8188EE_TRANS_END_STEPS];
2518c2ecf20Sopenharmony_ciextern struct wlan_pwr_cfg rtl8188ee_card_disable_flow
2528c2ecf20Sopenharmony_ci		[RTL8188EE_TRANS_ACT_TO_CARDEMU_STEPS +
2538c2ecf20Sopenharmony_ci		 RTL8188EE_TRANS_CARDEMU_TO_PDN_STEPS +
2548c2ecf20Sopenharmony_ci		 RTL8188EE_TRANS_END_STEPS];
2558c2ecf20Sopenharmony_ciextern struct wlan_pwr_cfg rtl8188ee_card_enable_flow
2568c2ecf20Sopenharmony_ci		[RTL8188EE_TRANS_ACT_TO_CARDEMU_STEPS +
2578c2ecf20Sopenharmony_ci		 RTL8188EE_TRANS_CARDEMU_TO_PDN_STEPS +
2588c2ecf20Sopenharmony_ci		 RTL8188EE_TRANS_END_STEPS];
2598c2ecf20Sopenharmony_ciextern struct wlan_pwr_cfg rtl8188ee_suspend_flow
2608c2ecf20Sopenharmony_ci		[RTL8188EE_TRANS_ACT_TO_CARDEMU_STEPS +
2618c2ecf20Sopenharmony_ci		 RTL8188EE_TRANS_CARDEMU_TO_SUS_STEPS +
2628c2ecf20Sopenharmony_ci		 RTL8188EE_TRANS_END_STEPS];
2638c2ecf20Sopenharmony_ciextern struct wlan_pwr_cfg rtl8188ee_resume_flow
2648c2ecf20Sopenharmony_ci		[RTL8188EE_TRANS_ACT_TO_CARDEMU_STEPS +
2658c2ecf20Sopenharmony_ci		 RTL8188EE_TRANS_CARDEMU_TO_SUS_STEPS +
2668c2ecf20Sopenharmony_ci		 RTL8188EE_TRANS_END_STEPS];
2678c2ecf20Sopenharmony_ciextern struct wlan_pwr_cfg rtl8188ee_hwpdn_flow
2688c2ecf20Sopenharmony_ci		[RTL8188EE_TRANS_ACT_TO_CARDEMU_STEPS +
2698c2ecf20Sopenharmony_ci		 RTL8188EE_TRANS_CARDEMU_TO_PDN_STEPS +
2708c2ecf20Sopenharmony_ci		 RTL8188EE_TRANS_END_STEPS];
2718c2ecf20Sopenharmony_ciextern struct wlan_pwr_cfg rtl8188ee_enter_lps_flow
2728c2ecf20Sopenharmony_ci		[RTL8188EE_TRANS_ACT_TO_LPS_STEPS +
2738c2ecf20Sopenharmony_ci		 RTL8188EE_TRANS_END_STEPS];
2748c2ecf20Sopenharmony_ciextern struct wlan_pwr_cfg rtl8188ee_leave_lps_flow
2758c2ecf20Sopenharmony_ci		[RTL8188EE_TRANS_LPS_TO_ACT_STEPS +
2768c2ecf20Sopenharmony_ci		 RTL8188EE_TRANS_END_STEPS];
2778c2ecf20Sopenharmony_ci
2788c2ecf20Sopenharmony_ci/* RTL8723 Power Configuration CMDs for PCIe interface */
2798c2ecf20Sopenharmony_ci#define RTL8188EE_NIC_PWR_ON_FLOW	rtl8188ee_power_on_flow
2808c2ecf20Sopenharmony_ci#define RTL8188EE_NIC_RF_OFF_FLOW	rtl8188ee_radio_off_flow
2818c2ecf20Sopenharmony_ci#define RTL8188EE_NIC_DISABLE_FLOW	rtl8188ee_card_disable_flow
2828c2ecf20Sopenharmony_ci#define RTL8188EE_NIC_ENABLE_FLOW	rtl8188ee_card_enable_flow
2838c2ecf20Sopenharmony_ci#define RTL8188EE_NIC_SUSPEND_FLOW	rtl8188ee_suspend_flow
2848c2ecf20Sopenharmony_ci#define RTL8188EE_NIC_RESUME_FLOW	rtl8188ee_resume_flow
2858c2ecf20Sopenharmony_ci#define RTL8188EE_NIC_PDN_FLOW		rtl8188ee_hwpdn_flow
2868c2ecf20Sopenharmony_ci#define RTL8188EE_NIC_LPS_ENTER_FLOW	rtl8188ee_enter_lps_flow
2878c2ecf20Sopenharmony_ci#define RTL8188EE_NIC_LPS_LEAVE_FLOW	rtl8188ee_leave_lps_flow
2888c2ecf20Sopenharmony_ci
2898c2ecf20Sopenharmony_ci#endif
290