162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
262306a36Sopenharmony_ci/* Copyright(c) 2009-2014  Realtek Corporation.*/
362306a36Sopenharmony_ci
462306a36Sopenharmony_ci#ifndef __RTL92E_PWRSEQ_H__
562306a36Sopenharmony_ci#define __RTL92E_PWRSEQ_H__
662306a36Sopenharmony_ci
762306a36Sopenharmony_ci#include "../pwrseqcmd.h"
862306a36Sopenharmony_ci/**
962306a36Sopenharmony_ci *	Check document WM-20110607-Paul-RTL8192E_Power_Architecture-R02.vsd
1062306a36Sopenharmony_ci *	There are 6 HW Power States:
1162306a36Sopenharmony_ci *	0: POFF--Power Off
1262306a36Sopenharmony_ci *	1: PDN--Power Down
1362306a36Sopenharmony_ci *	2: CARDEMU--Card Emulation
1462306a36Sopenharmony_ci *	3: ACT--Active Mode
1562306a36Sopenharmony_ci *	4: LPS--Low Power State
1662306a36Sopenharmony_ci *	5: SUS--Suspend
1762306a36Sopenharmony_ci *
1862306a36Sopenharmony_ci *	The transision from different states are defined below
1962306a36Sopenharmony_ci *	TRANS_CARDEMU_TO_ACT
2062306a36Sopenharmony_ci *	TRANS_ACT_TO_CARDEMU
2162306a36Sopenharmony_ci *	TRANS_CARDEMU_TO_SUS
2262306a36Sopenharmony_ci *	TRANS_SUS_TO_CARDEMU
2362306a36Sopenharmony_ci *	TRANS_CARDEMU_TO_PDN
2462306a36Sopenharmony_ci *	TRANS_ACT_TO_LPS
2562306a36Sopenharmony_ci *	TRANS_LPS_TO_ACT
2662306a36Sopenharmony_ci *
2762306a36Sopenharmony_ci *	TRANS_END
2862306a36Sopenharmony_ci *	PWR SEQ Version: rtl8192E_PwrSeq_V09.h
2962306a36Sopenharmony_ci */
3062306a36Sopenharmony_ci
3162306a36Sopenharmony_ci#define	RTL8192E_TRANS_CARDEMU_TO_ACT_STEPS	18
3262306a36Sopenharmony_ci#define	RTL8192E_TRANS_ACT_TO_CARDEMU_STEPS	18
3362306a36Sopenharmony_ci#define	RTL8192E_TRANS_CARDEMU_TO_SUS_STEPS	18
3462306a36Sopenharmony_ci#define	RTL8192E_TRANS_SUS_TO_CARDEMU_STEPS	18
3562306a36Sopenharmony_ci#define	RTL8192E_TRANS_CARDEMU_TO_PDN_STEPS	18
3662306a36Sopenharmony_ci#define	RTL8192E_TRANS_PDN_TO_CARDEMU_STEPS	18
3762306a36Sopenharmony_ci#define	RTL8192E_TRANS_ACT_TO_LPS_STEPS		23
3862306a36Sopenharmony_ci#define	RTL8192E_TRANS_LPS_TO_ACT_STEPS		23
3962306a36Sopenharmony_ci#define	RTL8192E_TRANS_END_STEPS		1
4062306a36Sopenharmony_ci
4162306a36Sopenharmony_ci#define RTL8192E_TRANS_CARDEMU_TO_ACT					\
4262306a36Sopenharmony_ci	/* format */							\
4362306a36Sopenharmony_ci	/* comments here */						\
4462306a36Sopenharmony_ci	/* { offset, cut_msk, fab_msk|interface_msk, base|cmd, msk, value },*/\
4562306a36Sopenharmony_ci	/* disable HWPDN 0x04[15]=0*/					\
4662306a36Sopenharmony_ci	{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,	\
4762306a36Sopenharmony_ci	 PWR_BASEADDR_MAC , PWR_CMD_WRITE, BIT(7), 0},			\
4862306a36Sopenharmony_ci	/* disable SW LPS 0x04[10]=0*/					\
4962306a36Sopenharmony_ci	{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,	\
5062306a36Sopenharmony_ci	 PWR_BASEADDR_MAC , PWR_CMD_WRITE, BIT(2), 0},			\
5162306a36Sopenharmony_ci	/* disable WL suspend*/						\
5262306a36Sopenharmony_ci	{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,	\
5362306a36Sopenharmony_ci	 PWR_BASEADDR_MAC , PWR_CMD_WRITE, (BIT(4)|BIT(3)), 0},		\
5462306a36Sopenharmony_ci	/* wait till 0x04[17] = 1    power ready*/			\
5562306a36Sopenharmony_ci	{0x0006, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,	\
5662306a36Sopenharmony_ci	 PWR_BASEADDR_MAC , PWR_CMD_POLLING, BIT(1), BIT(1)},		\
5762306a36Sopenharmony_ci	/* release WLON reset  0x04[16]=1*/				\
5862306a36Sopenharmony_ci	{0x0006, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,	\
5962306a36Sopenharmony_ci	 PWR_BASEADDR_MAC , PWR_CMD_WRITE, BIT(0), BIT(0)},		\
6062306a36Sopenharmony_ci	/* polling until return 0*/					\
6162306a36Sopenharmony_ci	{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,	\
6262306a36Sopenharmony_ci	 PWR_BASEADDR_MAC , PWR_CMD_WRITE, BIT(0), BIT(0)},		\
6362306a36Sopenharmony_ci	/**/								\
6462306a36Sopenharmony_ci	{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,	\
6562306a36Sopenharmony_ci	 PWR_BASEADDR_MAC , PWR_CMD_POLLING, BIT(0), 0},
6662306a36Sopenharmony_ci
6762306a36Sopenharmony_ci#define RTL8192E_TRANS_ACT_TO_CARDEMU					\
6862306a36Sopenharmony_ci	/* format */							\
6962306a36Sopenharmony_ci	/* comments here */						\
7062306a36Sopenharmony_ci	/* { offset, cut_msk, fab_msk|interface_msk, base|cmd, msk, value },*/\
7162306a36Sopenharmony_ci	/*0x1F[7:0] = 0 turn off RF*/					\
7262306a36Sopenharmony_ci	{0x001F, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,	\
7362306a36Sopenharmony_ci	 PWR_BASEADDR_MAC , PWR_CMD_WRITE, 0xFF, 0},			\
7462306a36Sopenharmony_ci	/*0x4C[23]=0x4E[7]=0, switch DPDT_SEL_P output from register 0x65[2] */\
7562306a36Sopenharmony_ci	{0x004E, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,	\
7662306a36Sopenharmony_ci	 PWR_BASEADDR_MAC , PWR_CMD_WRITE, BIT(7), 0},			\
7762306a36Sopenharmony_ci	/*0x04[9] = 1 turn off MAC by HW state machine*/		\
7862306a36Sopenharmony_ci	{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,	\
7962306a36Sopenharmony_ci	 PWR_BASEADDR_MAC , PWR_CMD_WRITE, BIT(1), BIT(1)},		\
8062306a36Sopenharmony_ci	/*wait till 0x04[9] = 0 polling until return 0 to disable*/	\
8162306a36Sopenharmony_ci	{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,	\
8262306a36Sopenharmony_ci	 PWR_BASEADDR_MAC , PWR_CMD_POLLING, BIT(1), 0},
8362306a36Sopenharmony_ci
8462306a36Sopenharmony_ci#define RTL8192E_TRANS_CARDEMU_TO_SUS					\
8562306a36Sopenharmony_ci	/* format */							\
8662306a36Sopenharmony_ci	/* comments here */						\
8762306a36Sopenharmony_ci	/* { offset, cut_msk, fab_msk|interface_msk, base|cmd, msk, value },*/\
8862306a36Sopenharmony_ci	/*0x04[12:11] = 2b'11 enable WL suspend for PCIe*/		\
8962306a36Sopenharmony_ci	{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_PCI_MSK,	\
9062306a36Sopenharmony_ci	 PWR_BASEADDR_MAC , PWR_CMD_WRITE, BIT(4) | BIT(3), (BIT(4) | BIT(3))},\
9162306a36Sopenharmony_ci	/*0x04[12:11] = 2b'01 enable WL suspend*/			\
9262306a36Sopenharmony_ci	{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK,			\
9362306a36Sopenharmony_ci	 PWR_INTF_USB_MSK | PWR_INTF_SDIO_MSK, PWR_BASEADDR_MAC,	\
9462306a36Sopenharmony_ci	 PWR_CMD_WRITE, BIT(3)|BIT(4), BIT(3)},				\
9562306a36Sopenharmony_ci	/*0x04[12:11] = 2b'11 enable WL suspend for PCIe*/		\
9662306a36Sopenharmony_ci	{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_PCI_MSK,	\
9762306a36Sopenharmony_ci	 PWR_BASEADDR_MAC , PWR_CMD_WRITE, BIT(3) | BIT(4), BIT(3) | BIT(4)},\
9862306a36Sopenharmony_ci	/*Set SDIO suspend local register*/				\
9962306a36Sopenharmony_ci	{0x0086, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK,	\
10062306a36Sopenharmony_ci	 PWR_BASEADDR_SDIO , PWR_CMD_WRITE, BIT(0), BIT(0)},		\
10162306a36Sopenharmony_ci	 /*wait power state to suspend*/				\
10262306a36Sopenharmony_ci	{0x0086, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK,	\
10362306a36Sopenharmony_ci	 PWR_BASEADDR_SDIO , PWR_CMD_POLLING, BIT(1), 0},
10462306a36Sopenharmony_ci
10562306a36Sopenharmony_ci#define RTL8192E_TRANS_SUS_TO_CARDEMU					\
10662306a36Sopenharmony_ci	/* format */							\
10762306a36Sopenharmony_ci	/* comments here */						\
10862306a36Sopenharmony_ci	/* { offset, cut_msk, fab_msk|interface_msk, base|cmd, msk, value },*/\
10962306a36Sopenharmony_ci	/*Set SDIO suspend local register*/				\
11062306a36Sopenharmony_ci	{0x0086, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK,	\
11162306a36Sopenharmony_ci	 PWR_BASEADDR_SDIO , PWR_CMD_WRITE, BIT(0), 0},			\
11262306a36Sopenharmony_ci	/*wait power state to suspend*/					\
11362306a36Sopenharmony_ci	{0x0086, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK,	\
11462306a36Sopenharmony_ci	 PWR_BASEADDR_SDIO , PWR_CMD_POLLING, BIT(1), BIT(1)},		\
11562306a36Sopenharmony_ci	/*0x04[12:11] = 2b'00 disable WL suspend*/			\
11662306a36Sopenharmony_ci	{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,	\
11762306a36Sopenharmony_ci	 PWR_BASEADDR_MAC , PWR_CMD_WRITE, BIT(3) | BIT(4), 0},
11862306a36Sopenharmony_ci
11962306a36Sopenharmony_ci#define RTL8192E_TRANS_CARDEMU_TO_CARDDIS				\
12062306a36Sopenharmony_ci	/* format */							\
12162306a36Sopenharmony_ci	/* comments here */						\
12262306a36Sopenharmony_ci	/* { offset, cut_msk, fab_msk|interface_msk, base|cmd, msk, value },*/\
12362306a36Sopenharmony_ci	/*0x07=0x20 , SOP option to disable BG/MB*/			\
12462306a36Sopenharmony_ci	{0x0007, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK,	\
12562306a36Sopenharmony_ci	 PWR_BASEADDR_MAC , PWR_CMD_WRITE, 0xFF, 0x20},			\
12662306a36Sopenharmony_ci	/*Unlock small LDO Register*/					\
12762306a36Sopenharmony_ci	{0x00CC, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK,	\
12862306a36Sopenharmony_ci	 PWR_BASEADDR_MAC , PWR_CMD_WRITE, BIT(2), BIT(2)},		\
12962306a36Sopenharmony_ci	/*Disable small LDO*/						\
13062306a36Sopenharmony_ci	{0x0011, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK,	\
13162306a36Sopenharmony_ci	 PWR_BASEADDR_MAC , PWR_CMD_WRITE, BIT(0), 0},			\
13262306a36Sopenharmony_ci	/*0x04[12:11] = 2b'01 enable WL suspend*/			\
13362306a36Sopenharmony_ci	{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK,			\
13462306a36Sopenharmony_ci	 PWR_INTF_USB_MSK|PWR_INTF_SDIO_MSK, PWR_BASEADDR_MAC,		\
13562306a36Sopenharmony_ci	 PWR_CMD_WRITE, BIT(3)|BIT(4), BIT(3)},				\
13662306a36Sopenharmony_ci	/*0x04[10] = 1, enable SW LPS*/					\
13762306a36Sopenharmony_ci	{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_PCI_MSK,	\
13862306a36Sopenharmony_ci	 PWR_BASEADDR_MAC , PWR_CMD_WRITE, BIT(2), BIT(2)},		\
13962306a36Sopenharmony_ci	/*Set SDIO suspend local register*/				\
14062306a36Sopenharmony_ci	{0x0086, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK,	\
14162306a36Sopenharmony_ci	 PWR_BASEADDR_SDIO , PWR_CMD_WRITE, BIT(0), BIT(0)},		\
14262306a36Sopenharmony_ci	/*wait power state to suspend*/					\
14362306a36Sopenharmony_ci	{0x0086, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK,	\
14462306a36Sopenharmony_ci	 PWR_BASEADDR_SDIO , PWR_CMD_POLLING, BIT(1), 0},
14562306a36Sopenharmony_ci
14662306a36Sopenharmony_ci#define RTL8192E_TRANS_CARDDIS_TO_CARDEMU				\
14762306a36Sopenharmony_ci	/* format */							\
14862306a36Sopenharmony_ci	/* comments here */						\
14962306a36Sopenharmony_ci	/* { offset, cut_msk, fab_msk|interface_msk, base|cmd, msk, value },*/\
15062306a36Sopenharmony_ci	/*Set SDIO suspend local register*/				\
15162306a36Sopenharmony_ci	{0x0086, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK,	\
15262306a36Sopenharmony_ci	 PWR_BASEADDR_SDIO , PWR_CMD_WRITE, BIT(0), 0},			\
15362306a36Sopenharmony_ci	/*wait power state to suspend*/					\
15462306a36Sopenharmony_ci	{0x0086, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK,	\
15562306a36Sopenharmony_ci	 PWR_BASEADDR_SDIO , PWR_CMD_POLLING, BIT(1), BIT(1)},		\
15662306a36Sopenharmony_ci	/*Enable small LDO*/						\
15762306a36Sopenharmony_ci	{0x0011, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK,	\
15862306a36Sopenharmony_ci	 PWR_BASEADDR_MAC , PWR_CMD_WRITE, BIT(0), BIT(0)},		\
15962306a36Sopenharmony_ci	/*Lock small LDO Register*/					\
16062306a36Sopenharmony_ci	{0x00CC, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK,	\
16162306a36Sopenharmony_ci	 PWR_BASEADDR_MAC , PWR_CMD_WRITE, BIT(2), 0},			\
16262306a36Sopenharmony_ci	/*0x04[12:11] = 2b'00 disable WL suspend*/			\
16362306a36Sopenharmony_ci	{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,	\
16462306a36Sopenharmony_ci	 PWR_BASEADDR_MAC , PWR_CMD_WRITE, BIT(3) | BIT(4), 0},
16562306a36Sopenharmony_ci
16662306a36Sopenharmony_ci#define RTL8192E_TRANS_CARDEMU_TO_PDN					\
16762306a36Sopenharmony_ci	/* format */							\
16862306a36Sopenharmony_ci	/* comments here */						\
16962306a36Sopenharmony_ci	/* { offset, cut_msk, fab_msk|interface_msk, base|cmd, msk, value },*/\
17062306a36Sopenharmony_ci	/* 0x04[16] = 0*/						\
17162306a36Sopenharmony_ci	{0x0006, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,	\
17262306a36Sopenharmony_ci	 PWR_BASEADDR_MAC , PWR_CMD_WRITE, BIT(0), 0},			\
17362306a36Sopenharmony_ci	/* 0x04[15] = 1*/						\
17462306a36Sopenharmony_ci	{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,	\
17562306a36Sopenharmony_ci	 PWR_BASEADDR_MAC , PWR_CMD_WRITE, BIT(7), BIT(7)},
17662306a36Sopenharmony_ci
17762306a36Sopenharmony_ci#define RTL8192E_TRANS_PDN_TO_CARDEMU					\
17862306a36Sopenharmony_ci	/* format */							\
17962306a36Sopenharmony_ci	/* comments here */						\
18062306a36Sopenharmony_ci	/* { offset, cut_msk, fab_msk|interface_msk, base|cmd, msk, value },*/\
18162306a36Sopenharmony_ci	/* 0x04[15] = 0*/						\
18262306a36Sopenharmony_ci	{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,	\
18362306a36Sopenharmony_ci	 PWR_BASEADDR_MAC , PWR_CMD_WRITE, BIT(7), 0},
18462306a36Sopenharmony_ci
18562306a36Sopenharmony_ci#define RTL8192E_TRANS_ACT_TO_LPS					\
18662306a36Sopenharmony_ci	/* format */							\
18762306a36Sopenharmony_ci	/* comments here */						\
18862306a36Sopenharmony_ci	/* { offset, cut_msk, fab_msk|interface_msk, base|cmd, msk, value },*/\
18962306a36Sopenharmony_ci	/*PCIe DMA stop*/						\
19062306a36Sopenharmony_ci	{0x0301, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_PCI_MSK,	\
19162306a36Sopenharmony_ci	 PWR_BASEADDR_MAC , PWR_CMD_WRITE, 0xFF, 0xFF},			\
19262306a36Sopenharmony_ci	/*Tx Pause*/							\
19362306a36Sopenharmony_ci	{0x0522, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,	\
19462306a36Sopenharmony_ci	 PWR_BASEADDR_MAC , PWR_CMD_WRITE, 0xFF, 0xFF},			\
19562306a36Sopenharmony_ci	/*Should be zero if no packet is transmitting*/			\
19662306a36Sopenharmony_ci	{0x05F8, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,	\
19762306a36Sopenharmony_ci	 PWR_BASEADDR_MAC , PWR_CMD_POLLING, 0xFF, 0},			\
19862306a36Sopenharmony_ci	/*Should be zero if no packet is transmitting*/			\
19962306a36Sopenharmony_ci	{0x05F9, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,	\
20062306a36Sopenharmony_ci	 PWR_BASEADDR_MAC , PWR_CMD_POLLING, 0xFF, 0},			\
20162306a36Sopenharmony_ci	/*Should be zero if no packet is transmitting*/			\
20262306a36Sopenharmony_ci	{0x05FA, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,	\
20362306a36Sopenharmony_ci	 PWR_BASEADDR_MAC , PWR_CMD_POLLING, 0xFF, 0},			\
20462306a36Sopenharmony_ci	/*Should be zero if no packet is transmitting*/			\
20562306a36Sopenharmony_ci	{0x05FB, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,	\
20662306a36Sopenharmony_ci	 PWR_BASEADDR_MAC , PWR_CMD_POLLING, 0xFF, 0},			\
20762306a36Sopenharmony_ci	/*CCK and OFDM are disabled,and clock are gated*/		\
20862306a36Sopenharmony_ci	{0x0002, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,	\
20962306a36Sopenharmony_ci	 PWR_BASEADDR_MAC , PWR_CMD_WRITE, BIT(0), 0},			\
21062306a36Sopenharmony_ci	/*Delay 1us*/							\
21162306a36Sopenharmony_ci	{0x0002, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,	\
21262306a36Sopenharmony_ci	 PWR_BASEADDR_MAC , PWR_CMD_DELAY, 0, PWRSEQ_DELAY_US},		\
21362306a36Sopenharmony_ci	/*Whole BB is reset*/						\
21462306a36Sopenharmony_ci	{0x0002, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,	\
21562306a36Sopenharmony_ci	 PWR_BASEADDR_MAC , PWR_CMD_WRITE, BIT(1), 0},			\
21662306a36Sopenharmony_ci	/*Reset MAC TRX*/						\
21762306a36Sopenharmony_ci	{0x0100, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,	\
21862306a36Sopenharmony_ci	 PWR_BASEADDR_MAC , PWR_CMD_WRITE, 0xFF, 0x03},			\
21962306a36Sopenharmony_ci	/*check if removed later*/					\
22062306a36Sopenharmony_ci	{0x0101, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,	\
22162306a36Sopenharmony_ci	 PWR_BASEADDR_MAC , PWR_CMD_WRITE, BIT(1), 0},			\
22262306a36Sopenharmony_ci	/*When driver enter Sus/ Disable, enable LOP for BT*/		\
22362306a36Sopenharmony_ci	{0x0093, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK,	\
22462306a36Sopenharmony_ci	 PWR_BASEADDR_MAC , PWR_CMD_WRITE, 0xFF, 0x00},			\
22562306a36Sopenharmony_ci	/*Respond TxOK to scheduler*/					\
22662306a36Sopenharmony_ci	{0x0553, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,	\
22762306a36Sopenharmony_ci	 PWR_BASEADDR_MAC , PWR_CMD_WRITE, BIT(5), BIT(5)},
22862306a36Sopenharmony_ci
22962306a36Sopenharmony_ci#define RTL8192E_TRANS_LPS_TO_ACT					\
23062306a36Sopenharmony_ci	/* format */							\
23162306a36Sopenharmony_ci	/* comments here */						\
23262306a36Sopenharmony_ci	/* { offset, cut_msk, fab_msk|interface_msk, base|cmd, msk, value },*/\
23362306a36Sopenharmony_ci	/*SDIO RPWM, For Repeatly In and out, Taggle bit should be changed*/\
23462306a36Sopenharmony_ci	{0x0080, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK,	\
23562306a36Sopenharmony_ci	 PWR_BASEADDR_SDIO , PWR_CMD_WRITE, 0xFF, 0x84},		\
23662306a36Sopenharmony_ci	/*USB RPWM*/							\
23762306a36Sopenharmony_ci	{0xFE58, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_USB_MSK,	\
23862306a36Sopenharmony_ci	 PWR_BASEADDR_MAC , PWR_CMD_WRITE, 0xFF, 0x84},			\
23962306a36Sopenharmony_ci	/*PCIe RPWM*/							\
24062306a36Sopenharmony_ci	{0x0361, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_PCI_MSK,	\
24162306a36Sopenharmony_ci	 PWR_BASEADDR_MAC , PWR_CMD_WRITE, 0xFF, 0x84},			\
24262306a36Sopenharmony_ci	/*Delay*/							\
24362306a36Sopenharmony_ci	{0x0002, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,	\
24462306a36Sopenharmony_ci	 PWR_BASEADDR_MAC , PWR_CMD_DELAY, 0, PWRSEQ_DELAY_MS},		\
24562306a36Sopenharmony_ci	/*0x08[4] = 0 switch TSF to 40M*/				\
24662306a36Sopenharmony_ci	{0x0008, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,	\
24762306a36Sopenharmony_ci	 PWR_BASEADDR_MAC , PWR_CMD_WRITE, BIT(4), 0},			\
24862306a36Sopenharmony_ci	/*Polling 0x109[7]=0  TSF in 40M*/				\
24962306a36Sopenharmony_ci	{0x0109, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,	\
25062306a36Sopenharmony_ci	 PWR_BASEADDR_MAC , PWR_CMD_POLLING, BIT(7), 0},		\
25162306a36Sopenharmony_ci	/*0x101[1] = 1*/						\
25262306a36Sopenharmony_ci	{0x0101, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,	\
25362306a36Sopenharmony_ci	 PWR_BASEADDR_MAC , PWR_CMD_WRITE, BIT(1), BIT(1)},		\
25462306a36Sopenharmony_ci	/*0x100[7:0] = 0xFF  enable WMAC TRX*/				\
25562306a36Sopenharmony_ci	{0x0100, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,	\
25662306a36Sopenharmony_ci	 PWR_BASEADDR_MAC , PWR_CMD_WRITE, 0xFF, 0xFF},			\
25762306a36Sopenharmony_ci	/* 0x02[1:0] = 2b'11 enable BB macro*/				\
25862306a36Sopenharmony_ci	{0x0002, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,	\
25962306a36Sopenharmony_ci	 PWR_BASEADDR_MAC , PWR_CMD_WRITE, BIT(1) | BIT(0), BIT(1) | BIT(0)},\
26062306a36Sopenharmony_ci	/*0x522 = 0*/							\
26162306a36Sopenharmony_ci	{0x0522, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,	\
26262306a36Sopenharmony_ci	 PWR_BASEADDR_MAC , PWR_CMD_WRITE, 0xFF, 0},			\
26362306a36Sopenharmony_ci	/*Clear ISR*/							\
26462306a36Sopenharmony_ci	{0x013D, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,	\
26562306a36Sopenharmony_ci	 PWR_BASEADDR_MAC , PWR_CMD_WRITE, 0xFF, 0xFF},
26662306a36Sopenharmony_ci
26762306a36Sopenharmony_ci#define RTL8192E_TRANS_END						\
26862306a36Sopenharmony_ci	/* format */							\
26962306a36Sopenharmony_ci	/* comments here */						\
27062306a36Sopenharmony_ci	/* { offset, cut_msk, fab_msk|interface_msk, base|cmd, msk, value },*/\
27162306a36Sopenharmony_ci	{0xFFFF, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,	\
27262306a36Sopenharmony_ci	 0, PWR_CMD_END, 0, 0},
27362306a36Sopenharmony_ci
27462306a36Sopenharmony_ciextern struct wlan_pwr_cfg rtl8192E_power_on_flow
27562306a36Sopenharmony_ci					[RTL8192E_TRANS_CARDEMU_TO_ACT_STEPS +
27662306a36Sopenharmony_ci					 RTL8192E_TRANS_END_STEPS];
27762306a36Sopenharmony_ciextern struct wlan_pwr_cfg rtl8192E_radio_off_flow
27862306a36Sopenharmony_ci					[RTL8192E_TRANS_ACT_TO_CARDEMU_STEPS +
27962306a36Sopenharmony_ci					 RTL8192E_TRANS_END_STEPS];
28062306a36Sopenharmony_ciextern struct wlan_pwr_cfg rtl8192E_card_disable_flow
28162306a36Sopenharmony_ci					[RTL8192E_TRANS_ACT_TO_CARDEMU_STEPS +
28262306a36Sopenharmony_ci					 RTL8192E_TRANS_CARDEMU_TO_PDN_STEPS +
28362306a36Sopenharmony_ci					 RTL8192E_TRANS_END_STEPS];
28462306a36Sopenharmony_ciextern struct wlan_pwr_cfg rtl8192E_card_enable_flow
28562306a36Sopenharmony_ci					[RTL8192E_TRANS_ACT_TO_CARDEMU_STEPS +
28662306a36Sopenharmony_ci					 RTL8192E_TRANS_CARDEMU_TO_PDN_STEPS +
28762306a36Sopenharmony_ci					 RTL8192E_TRANS_END_STEPS];
28862306a36Sopenharmony_ciextern struct wlan_pwr_cfg rtl8192E_suspend_flow
28962306a36Sopenharmony_ci					[RTL8192E_TRANS_ACT_TO_CARDEMU_STEPS +
29062306a36Sopenharmony_ci					 RTL8192E_TRANS_CARDEMU_TO_SUS_STEPS +
29162306a36Sopenharmony_ci					 RTL8192E_TRANS_END_STEPS];
29262306a36Sopenharmony_ciextern struct wlan_pwr_cfg rtl8192E_resume_flow
29362306a36Sopenharmony_ci					[RTL8192E_TRANS_ACT_TO_CARDEMU_STEPS +
29462306a36Sopenharmony_ci					 RTL8192E_TRANS_CARDEMU_TO_SUS_STEPS +
29562306a36Sopenharmony_ci					 RTL8192E_TRANS_END_STEPS];
29662306a36Sopenharmony_ciextern struct wlan_pwr_cfg rtl8192E_hwpdn_flow
29762306a36Sopenharmony_ci					[RTL8192E_TRANS_ACT_TO_CARDEMU_STEPS +
29862306a36Sopenharmony_ci					 RTL8192E_TRANS_CARDEMU_TO_PDN_STEPS +
29962306a36Sopenharmony_ci					 RTL8192E_TRANS_END_STEPS];
30062306a36Sopenharmony_ciextern struct wlan_pwr_cfg rtl8192E_enter_lps_flow
30162306a36Sopenharmony_ci					[RTL8192E_TRANS_ACT_TO_LPS_STEPS +
30262306a36Sopenharmony_ci					 RTL8192E_TRANS_END_STEPS];
30362306a36Sopenharmony_ciextern struct wlan_pwr_cfg rtl8192E_leave_lps_flow
30462306a36Sopenharmony_ci					[RTL8192E_TRANS_LPS_TO_ACT_STEPS +
30562306a36Sopenharmony_ci					 RTL8192E_TRANS_END_STEPS];
30662306a36Sopenharmony_ci
30762306a36Sopenharmony_ci/* RTL8192EE Power Configuration CMDs for PCIe interface */
30862306a36Sopenharmony_ci#define RTL8192E_NIC_PWR_ON_FLOW	rtl8192E_power_on_flow
30962306a36Sopenharmony_ci#define RTL8192E_NIC_RF_OFF_FLOW	rtl8192E_radio_off_flow
31062306a36Sopenharmony_ci#define RTL8192E_NIC_DISABLE_FLOW	rtl8192E_card_disable_flow
31162306a36Sopenharmony_ci#define RTL8192E_NIC_ENABLE_FLOW	rtl8192E_card_enable_flow
31262306a36Sopenharmony_ci#define RTL8192E_NIC_SUSPEND_FLOW	rtl8192E_suspend_flow
31362306a36Sopenharmony_ci#define RTL8192E_NIC_RESUME_FLOW	rtl8192E_resume_flow
31462306a36Sopenharmony_ci#define RTL8192E_NIC_PDN_FLOW		rtl8192E_hwpdn_flow
31562306a36Sopenharmony_ci#define RTL8192E_NIC_LPS_ENTER_FLOW	rtl8192E_enter_lps_flow
31662306a36Sopenharmony_ci#define RTL8192E_NIC_LPS_LEAVE_FLOW	rtl8192E_leave_lps_flow
31762306a36Sopenharmony_ci
31862306a36Sopenharmony_ci#endif
319