18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */ 28c2ecf20Sopenharmony_ci/* Copyright(c) 2009-2014 Realtek Corporation.*/ 38c2ecf20Sopenharmony_ci 48c2ecf20Sopenharmony_ci#ifndef __RTL92E_PWRSEQ_H__ 58c2ecf20Sopenharmony_ci#define __RTL92E_PWRSEQ_H__ 68c2ecf20Sopenharmony_ci 78c2ecf20Sopenharmony_ci#include "../pwrseqcmd.h" 88c2ecf20Sopenharmony_ci/** 98c2ecf20Sopenharmony_ci * Check document WM-20110607-Paul-RTL8192E_Power_Architecture-R02.vsd 108c2ecf20Sopenharmony_ci * There are 6 HW Power States: 118c2ecf20Sopenharmony_ci * 0: POFF--Power Off 128c2ecf20Sopenharmony_ci * 1: PDN--Power Down 138c2ecf20Sopenharmony_ci * 2: CARDEMU--Card Emulation 148c2ecf20Sopenharmony_ci * 3: ACT--Active Mode 158c2ecf20Sopenharmony_ci * 4: LPS--Low Power State 168c2ecf20Sopenharmony_ci * 5: SUS--Suspend 178c2ecf20Sopenharmony_ci * 188c2ecf20Sopenharmony_ci * The transision from different states are defined below 198c2ecf20Sopenharmony_ci * TRANS_CARDEMU_TO_ACT 208c2ecf20Sopenharmony_ci * TRANS_ACT_TO_CARDEMU 218c2ecf20Sopenharmony_ci * TRANS_CARDEMU_TO_SUS 228c2ecf20Sopenharmony_ci * TRANS_SUS_TO_CARDEMU 238c2ecf20Sopenharmony_ci * TRANS_CARDEMU_TO_PDN 248c2ecf20Sopenharmony_ci * TRANS_ACT_TO_LPS 258c2ecf20Sopenharmony_ci * TRANS_LPS_TO_ACT 268c2ecf20Sopenharmony_ci * 278c2ecf20Sopenharmony_ci * TRANS_END 288c2ecf20Sopenharmony_ci * PWR SEQ Version: rtl8192E_PwrSeq_V09.h 298c2ecf20Sopenharmony_ci */ 308c2ecf20Sopenharmony_ci 318c2ecf20Sopenharmony_ci#define RTL8192E_TRANS_CARDEMU_TO_ACT_STEPS 18 328c2ecf20Sopenharmony_ci#define RTL8192E_TRANS_ACT_TO_CARDEMU_STEPS 18 338c2ecf20Sopenharmony_ci#define RTL8192E_TRANS_CARDEMU_TO_SUS_STEPS 18 348c2ecf20Sopenharmony_ci#define RTL8192E_TRANS_SUS_TO_CARDEMU_STEPS 18 358c2ecf20Sopenharmony_ci#define RTL8192E_TRANS_CARDEMU_TO_PDN_STEPS 18 368c2ecf20Sopenharmony_ci#define RTL8192E_TRANS_PDN_TO_CARDEMU_STEPS 18 378c2ecf20Sopenharmony_ci#define RTL8192E_TRANS_ACT_TO_LPS_STEPS 23 388c2ecf20Sopenharmony_ci#define RTL8192E_TRANS_LPS_TO_ACT_STEPS 23 398c2ecf20Sopenharmony_ci#define RTL8192E_TRANS_END_STEPS 1 408c2ecf20Sopenharmony_ci 418c2ecf20Sopenharmony_ci#define RTL8192E_TRANS_CARDEMU_TO_ACT \ 428c2ecf20Sopenharmony_ci /* format */ \ 438c2ecf20Sopenharmony_ci /* comments here */ \ 448c2ecf20Sopenharmony_ci /* { offset, cut_msk, fab_msk|interface_msk, base|cmd, msk, value },*/\ 458c2ecf20Sopenharmony_ci /* disable HWPDN 0x04[15]=0*/ \ 468c2ecf20Sopenharmony_ci {0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \ 478c2ecf20Sopenharmony_ci PWR_BASEADDR_MAC , PWR_CMD_WRITE, BIT(7), 0}, \ 488c2ecf20Sopenharmony_ci /* disable SW LPS 0x04[10]=0*/ \ 498c2ecf20Sopenharmony_ci {0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \ 508c2ecf20Sopenharmony_ci PWR_BASEADDR_MAC , PWR_CMD_WRITE, BIT(2), 0}, \ 518c2ecf20Sopenharmony_ci /* disable WL suspend*/ \ 528c2ecf20Sopenharmony_ci {0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \ 538c2ecf20Sopenharmony_ci PWR_BASEADDR_MAC , PWR_CMD_WRITE, (BIT(4)|BIT(3)), 0}, \ 548c2ecf20Sopenharmony_ci /* wait till 0x04[17] = 1 power ready*/ \ 558c2ecf20Sopenharmony_ci {0x0006, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \ 568c2ecf20Sopenharmony_ci PWR_BASEADDR_MAC , PWR_CMD_POLLING, BIT(1), BIT(1)}, \ 578c2ecf20Sopenharmony_ci /* release WLON reset 0x04[16]=1*/ \ 588c2ecf20Sopenharmony_ci {0x0006, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \ 598c2ecf20Sopenharmony_ci PWR_BASEADDR_MAC , PWR_CMD_WRITE, BIT(0), BIT(0)}, \ 608c2ecf20Sopenharmony_ci /* polling until return 0*/ \ 618c2ecf20Sopenharmony_ci {0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \ 628c2ecf20Sopenharmony_ci PWR_BASEADDR_MAC , PWR_CMD_WRITE, BIT(0), BIT(0)}, \ 638c2ecf20Sopenharmony_ci /**/ \ 648c2ecf20Sopenharmony_ci {0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \ 658c2ecf20Sopenharmony_ci PWR_BASEADDR_MAC , PWR_CMD_POLLING, BIT(0), 0}, 668c2ecf20Sopenharmony_ci 678c2ecf20Sopenharmony_ci#define RTL8192E_TRANS_ACT_TO_CARDEMU \ 688c2ecf20Sopenharmony_ci /* format */ \ 698c2ecf20Sopenharmony_ci /* comments here */ \ 708c2ecf20Sopenharmony_ci /* { offset, cut_msk, fab_msk|interface_msk, base|cmd, msk, value },*/\ 718c2ecf20Sopenharmony_ci /*0x1F[7:0] = 0 turn off RF*/ \ 728c2ecf20Sopenharmony_ci {0x001F, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \ 738c2ecf20Sopenharmony_ci PWR_BASEADDR_MAC , PWR_CMD_WRITE, 0xFF, 0}, \ 748c2ecf20Sopenharmony_ci /*0x4C[23]=0x4E[7]=0, switch DPDT_SEL_P output from register 0x65[2] */\ 758c2ecf20Sopenharmony_ci {0x004E, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \ 768c2ecf20Sopenharmony_ci PWR_BASEADDR_MAC , PWR_CMD_WRITE, BIT(7), 0}, \ 778c2ecf20Sopenharmony_ci /*0x04[9] = 1 turn off MAC by HW state machine*/ \ 788c2ecf20Sopenharmony_ci {0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \ 798c2ecf20Sopenharmony_ci PWR_BASEADDR_MAC , PWR_CMD_WRITE, BIT(1), BIT(1)}, \ 808c2ecf20Sopenharmony_ci /*wait till 0x04[9] = 0 polling until return 0 to disable*/ \ 818c2ecf20Sopenharmony_ci {0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \ 828c2ecf20Sopenharmony_ci PWR_BASEADDR_MAC , PWR_CMD_POLLING, BIT(1), 0}, 838c2ecf20Sopenharmony_ci 848c2ecf20Sopenharmony_ci#define RTL8192E_TRANS_CARDEMU_TO_SUS \ 858c2ecf20Sopenharmony_ci /* format */ \ 868c2ecf20Sopenharmony_ci /* comments here */ \ 878c2ecf20Sopenharmony_ci /* { offset, cut_msk, fab_msk|interface_msk, base|cmd, msk, value },*/\ 888c2ecf20Sopenharmony_ci /*0x04[12:11] = 2b'11 enable WL suspend for PCIe*/ \ 898c2ecf20Sopenharmony_ci {0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_PCI_MSK, \ 908c2ecf20Sopenharmony_ci PWR_BASEADDR_MAC , PWR_CMD_WRITE, BIT(4) | BIT(3), (BIT(4) | BIT(3))},\ 918c2ecf20Sopenharmony_ci /*0x04[12:11] = 2b'01 enable WL suspend*/ \ 928c2ecf20Sopenharmony_ci {0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, \ 938c2ecf20Sopenharmony_ci PWR_INTF_USB_MSK | PWR_INTF_SDIO_MSK, PWR_BASEADDR_MAC, \ 948c2ecf20Sopenharmony_ci PWR_CMD_WRITE, BIT(3)|BIT(4), BIT(3)}, \ 958c2ecf20Sopenharmony_ci /*0x04[12:11] = 2b'11 enable WL suspend for PCIe*/ \ 968c2ecf20Sopenharmony_ci {0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_PCI_MSK, \ 978c2ecf20Sopenharmony_ci PWR_BASEADDR_MAC , PWR_CMD_WRITE, BIT(3) | BIT(4), BIT(3) | BIT(4)},\ 988c2ecf20Sopenharmony_ci /*Set SDIO suspend local register*/ \ 998c2ecf20Sopenharmony_ci {0x0086, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK, \ 1008c2ecf20Sopenharmony_ci PWR_BASEADDR_SDIO , PWR_CMD_WRITE, BIT(0), BIT(0)}, \ 1018c2ecf20Sopenharmony_ci /*wait power state to suspend*/ \ 1028c2ecf20Sopenharmony_ci {0x0086, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK, \ 1038c2ecf20Sopenharmony_ci PWR_BASEADDR_SDIO , PWR_CMD_POLLING, BIT(1), 0}, 1048c2ecf20Sopenharmony_ci 1058c2ecf20Sopenharmony_ci#define RTL8192E_TRANS_SUS_TO_CARDEMU \ 1068c2ecf20Sopenharmony_ci /* format */ \ 1078c2ecf20Sopenharmony_ci /* comments here */ \ 1088c2ecf20Sopenharmony_ci /* { offset, cut_msk, fab_msk|interface_msk, base|cmd, msk, value },*/\ 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_WRITE, BIT(0), 0}, \ 1128c2ecf20Sopenharmony_ci /*wait power state to suspend*/ \ 1138c2ecf20Sopenharmony_ci {0x0086, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK, \ 1148c2ecf20Sopenharmony_ci PWR_BASEADDR_SDIO , PWR_CMD_POLLING, BIT(1), BIT(1)}, \ 1158c2ecf20Sopenharmony_ci /*0x04[12:11] = 2b'00 disable WL suspend*/ \ 1168c2ecf20Sopenharmony_ci {0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \ 1178c2ecf20Sopenharmony_ci PWR_BASEADDR_MAC , PWR_CMD_WRITE, BIT(3) | BIT(4), 0}, 1188c2ecf20Sopenharmony_ci 1198c2ecf20Sopenharmony_ci#define RTL8192E_TRANS_CARDEMU_TO_CARDDIS \ 1208c2ecf20Sopenharmony_ci /* format */ \ 1218c2ecf20Sopenharmony_ci /* comments here */ \ 1228c2ecf20Sopenharmony_ci /* { offset, cut_msk, fab_msk|interface_msk, base|cmd, msk, value },*/\ 1238c2ecf20Sopenharmony_ci /*0x07=0x20 , SOP option to disable BG/MB*/ \ 1248c2ecf20Sopenharmony_ci {0x0007, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK, \ 1258c2ecf20Sopenharmony_ci PWR_BASEADDR_MAC , PWR_CMD_WRITE, 0xFF, 0x20}, \ 1268c2ecf20Sopenharmony_ci /*Unlock small LDO Register*/ \ 1278c2ecf20Sopenharmony_ci {0x00CC, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK, \ 1288c2ecf20Sopenharmony_ci PWR_BASEADDR_MAC , PWR_CMD_WRITE, BIT(2), BIT(2)}, \ 1298c2ecf20Sopenharmony_ci /*Disable small LDO*/ \ 1308c2ecf20Sopenharmony_ci {0x0011, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK, \ 1318c2ecf20Sopenharmony_ci PWR_BASEADDR_MAC , PWR_CMD_WRITE, BIT(0), 0}, \ 1328c2ecf20Sopenharmony_ci /*0x04[12:11] = 2b'01 enable WL suspend*/ \ 1338c2ecf20Sopenharmony_ci {0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, \ 1348c2ecf20Sopenharmony_ci PWR_INTF_USB_MSK|PWR_INTF_SDIO_MSK, PWR_BASEADDR_MAC, \ 1358c2ecf20Sopenharmony_ci PWR_CMD_WRITE, BIT(3)|BIT(4), BIT(3)}, \ 1368c2ecf20Sopenharmony_ci /*0x04[10] = 1, enable SW LPS*/ \ 1378c2ecf20Sopenharmony_ci {0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_PCI_MSK, \ 1388c2ecf20Sopenharmony_ci PWR_BASEADDR_MAC , PWR_CMD_WRITE, BIT(2), BIT(2)}, \ 1398c2ecf20Sopenharmony_ci /*Set SDIO suspend local register*/ \ 1408c2ecf20Sopenharmony_ci {0x0086, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK, \ 1418c2ecf20Sopenharmony_ci PWR_BASEADDR_SDIO , PWR_CMD_WRITE, BIT(0), BIT(0)}, \ 1428c2ecf20Sopenharmony_ci /*wait power state to suspend*/ \ 1438c2ecf20Sopenharmony_ci {0x0086, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK, \ 1448c2ecf20Sopenharmony_ci PWR_BASEADDR_SDIO , PWR_CMD_POLLING, BIT(1), 0}, 1458c2ecf20Sopenharmony_ci 1468c2ecf20Sopenharmony_ci#define RTL8192E_TRANS_CARDDIS_TO_CARDEMU \ 1478c2ecf20Sopenharmony_ci /* format */ \ 1488c2ecf20Sopenharmony_ci /* comments here */ \ 1498c2ecf20Sopenharmony_ci /* { offset, cut_msk, fab_msk|interface_msk, base|cmd, msk, value },*/\ 1508c2ecf20Sopenharmony_ci /*Set SDIO suspend local register*/ \ 1518c2ecf20Sopenharmony_ci {0x0086, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK, \ 1528c2ecf20Sopenharmony_ci PWR_BASEADDR_SDIO , PWR_CMD_WRITE, BIT(0), 0}, \ 1538c2ecf20Sopenharmony_ci /*wait power state to suspend*/ \ 1548c2ecf20Sopenharmony_ci {0x0086, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK, \ 1558c2ecf20Sopenharmony_ci PWR_BASEADDR_SDIO , PWR_CMD_POLLING, BIT(1), BIT(1)}, \ 1568c2ecf20Sopenharmony_ci /*Enable small LDO*/ \ 1578c2ecf20Sopenharmony_ci {0x0011, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK, \ 1588c2ecf20Sopenharmony_ci PWR_BASEADDR_MAC , PWR_CMD_WRITE, BIT(0), BIT(0)}, \ 1598c2ecf20Sopenharmony_ci /*Lock small LDO Register*/ \ 1608c2ecf20Sopenharmony_ci {0x00CC, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK, \ 1618c2ecf20Sopenharmony_ci PWR_BASEADDR_MAC , PWR_CMD_WRITE, BIT(2), 0}, \ 1628c2ecf20Sopenharmony_ci /*0x04[12:11] = 2b'00 disable WL suspend*/ \ 1638c2ecf20Sopenharmony_ci {0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \ 1648c2ecf20Sopenharmony_ci PWR_BASEADDR_MAC , PWR_CMD_WRITE, BIT(3) | BIT(4), 0}, 1658c2ecf20Sopenharmony_ci 1668c2ecf20Sopenharmony_ci#define RTL8192E_TRANS_CARDEMU_TO_PDN \ 1678c2ecf20Sopenharmony_ci /* format */ \ 1688c2ecf20Sopenharmony_ci /* comments here */ \ 1698c2ecf20Sopenharmony_ci /* { offset, cut_msk, fab_msk|interface_msk, base|cmd, msk, value },*/\ 1708c2ecf20Sopenharmony_ci /* 0x04[16] = 0*/ \ 1718c2ecf20Sopenharmony_ci {0x0006, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \ 1728c2ecf20Sopenharmony_ci PWR_BASEADDR_MAC , PWR_CMD_WRITE, BIT(0), 0}, \ 1738c2ecf20Sopenharmony_ci /* 0x04[15] = 1*/ \ 1748c2ecf20Sopenharmony_ci {0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \ 1758c2ecf20Sopenharmony_ci PWR_BASEADDR_MAC , PWR_CMD_WRITE, BIT(7), BIT(7)}, 1768c2ecf20Sopenharmony_ci 1778c2ecf20Sopenharmony_ci#define RTL8192E_TRANS_PDN_TO_CARDEMU \ 1788c2ecf20Sopenharmony_ci /* format */ \ 1798c2ecf20Sopenharmony_ci /* comments here */ \ 1808c2ecf20Sopenharmony_ci /* { offset, cut_msk, fab_msk|interface_msk, base|cmd, msk, value },*/\ 1818c2ecf20Sopenharmony_ci /* 0x04[15] = 0*/ \ 1828c2ecf20Sopenharmony_ci {0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \ 1838c2ecf20Sopenharmony_ci PWR_BASEADDR_MAC , PWR_CMD_WRITE, BIT(7), 0}, 1848c2ecf20Sopenharmony_ci 1858c2ecf20Sopenharmony_ci#define RTL8192E_TRANS_ACT_TO_LPS \ 1868c2ecf20Sopenharmony_ci /* format */ \ 1878c2ecf20Sopenharmony_ci /* comments here */ \ 1888c2ecf20Sopenharmony_ci /* { offset, cut_msk, fab_msk|interface_msk, base|cmd, msk, value },*/\ 1898c2ecf20Sopenharmony_ci /*PCIe DMA stop*/ \ 1908c2ecf20Sopenharmony_ci {0x0301, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_PCI_MSK, \ 1918c2ecf20Sopenharmony_ci PWR_BASEADDR_MAC , PWR_CMD_WRITE, 0xFF, 0xFF}, \ 1928c2ecf20Sopenharmony_ci /*Tx Pause*/ \ 1938c2ecf20Sopenharmony_ci {0x0522, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \ 1948c2ecf20Sopenharmony_ci PWR_BASEADDR_MAC , PWR_CMD_WRITE, 0xFF, 0xFF}, \ 1958c2ecf20Sopenharmony_ci /*Should be zero if no packet is transmitting*/ \ 1968c2ecf20Sopenharmony_ci {0x05F8, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \ 1978c2ecf20Sopenharmony_ci PWR_BASEADDR_MAC , PWR_CMD_POLLING, 0xFF, 0}, \ 1988c2ecf20Sopenharmony_ci /*Should be zero if no packet is transmitting*/ \ 1998c2ecf20Sopenharmony_ci {0x05F9, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \ 2008c2ecf20Sopenharmony_ci PWR_BASEADDR_MAC , PWR_CMD_POLLING, 0xFF, 0}, \ 2018c2ecf20Sopenharmony_ci /*Should be zero if no packet is transmitting*/ \ 2028c2ecf20Sopenharmony_ci {0x05FA, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \ 2038c2ecf20Sopenharmony_ci PWR_BASEADDR_MAC , PWR_CMD_POLLING, 0xFF, 0}, \ 2048c2ecf20Sopenharmony_ci /*Should be zero if no packet is transmitting*/ \ 2058c2ecf20Sopenharmony_ci {0x05FB, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \ 2068c2ecf20Sopenharmony_ci PWR_BASEADDR_MAC , PWR_CMD_POLLING, 0xFF, 0}, \ 2078c2ecf20Sopenharmony_ci /*CCK and OFDM are disabled,and clock are gated*/ \ 2088c2ecf20Sopenharmony_ci {0x0002, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \ 2098c2ecf20Sopenharmony_ci PWR_BASEADDR_MAC , PWR_CMD_WRITE, BIT(0), 0}, \ 2108c2ecf20Sopenharmony_ci /*Delay 1us*/ \ 2118c2ecf20Sopenharmony_ci {0x0002, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \ 2128c2ecf20Sopenharmony_ci PWR_BASEADDR_MAC , PWR_CMD_DELAY, 0, PWRSEQ_DELAY_US}, \ 2138c2ecf20Sopenharmony_ci /*Whole BB is reset*/ \ 2148c2ecf20Sopenharmony_ci {0x0002, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \ 2158c2ecf20Sopenharmony_ci PWR_BASEADDR_MAC , PWR_CMD_WRITE, BIT(1), 0}, \ 2168c2ecf20Sopenharmony_ci /*Reset MAC TRX*/ \ 2178c2ecf20Sopenharmony_ci {0x0100, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \ 2188c2ecf20Sopenharmony_ci PWR_BASEADDR_MAC , PWR_CMD_WRITE, 0xFF, 0x03}, \ 2198c2ecf20Sopenharmony_ci /*check if removed later*/ \ 2208c2ecf20Sopenharmony_ci {0x0101, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \ 2218c2ecf20Sopenharmony_ci PWR_BASEADDR_MAC , PWR_CMD_WRITE, BIT(1), 0}, \ 2228c2ecf20Sopenharmony_ci /*When driver enter Sus/ Disable, enable LOP for BT*/ \ 2238c2ecf20Sopenharmony_ci {0x0093, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK, \ 2248c2ecf20Sopenharmony_ci PWR_BASEADDR_MAC , PWR_CMD_WRITE, 0xFF, 0x00}, \ 2258c2ecf20Sopenharmony_ci /*Respond TxOK to scheduler*/ \ 2268c2ecf20Sopenharmony_ci {0x0553, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \ 2278c2ecf20Sopenharmony_ci PWR_BASEADDR_MAC , PWR_CMD_WRITE, BIT(5), BIT(5)}, 2288c2ecf20Sopenharmony_ci 2298c2ecf20Sopenharmony_ci#define RTL8192E_TRANS_LPS_TO_ACT \ 2308c2ecf20Sopenharmony_ci /* format */ \ 2318c2ecf20Sopenharmony_ci /* comments here */ \ 2328c2ecf20Sopenharmony_ci /* { offset, cut_msk, fab_msk|interface_msk, base|cmd, msk, value },*/\ 2338c2ecf20Sopenharmony_ci /*SDIO RPWM, For Repeatly In and out, Taggle bit should be changed*/\ 2348c2ecf20Sopenharmony_ci {0x0080, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK, \ 2358c2ecf20Sopenharmony_ci PWR_BASEADDR_SDIO , PWR_CMD_WRITE, 0xFF, 0x84}, \ 2368c2ecf20Sopenharmony_ci /*USB RPWM*/ \ 2378c2ecf20Sopenharmony_ci {0xFE58, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_USB_MSK, \ 2388c2ecf20Sopenharmony_ci PWR_BASEADDR_MAC , PWR_CMD_WRITE, 0xFF, 0x84}, \ 2398c2ecf20Sopenharmony_ci /*PCIe RPWM*/ \ 2408c2ecf20Sopenharmony_ci {0x0361, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_PCI_MSK, \ 2418c2ecf20Sopenharmony_ci PWR_BASEADDR_MAC , PWR_CMD_WRITE, 0xFF, 0x84}, \ 2428c2ecf20Sopenharmony_ci /*Delay*/ \ 2438c2ecf20Sopenharmony_ci {0x0002, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \ 2448c2ecf20Sopenharmony_ci PWR_BASEADDR_MAC , PWR_CMD_DELAY, 0, PWRSEQ_DELAY_MS}, \ 2458c2ecf20Sopenharmony_ci /*0x08[4] = 0 switch TSF to 40M*/ \ 2468c2ecf20Sopenharmony_ci {0x0008, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \ 2478c2ecf20Sopenharmony_ci PWR_BASEADDR_MAC , PWR_CMD_WRITE, BIT(4), 0}, \ 2488c2ecf20Sopenharmony_ci /*Polling 0x109[7]=0 TSF in 40M*/ \ 2498c2ecf20Sopenharmony_ci {0x0109, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \ 2508c2ecf20Sopenharmony_ci PWR_BASEADDR_MAC , PWR_CMD_POLLING, BIT(7), 0}, \ 2518c2ecf20Sopenharmony_ci /*0x101[1] = 1*/ \ 2528c2ecf20Sopenharmony_ci {0x0101, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \ 2538c2ecf20Sopenharmony_ci PWR_BASEADDR_MAC , PWR_CMD_WRITE, BIT(1), BIT(1)}, \ 2548c2ecf20Sopenharmony_ci /*0x100[7:0] = 0xFF enable WMAC TRX*/ \ 2558c2ecf20Sopenharmony_ci {0x0100, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \ 2568c2ecf20Sopenharmony_ci PWR_BASEADDR_MAC , PWR_CMD_WRITE, 0xFF, 0xFF}, \ 2578c2ecf20Sopenharmony_ci /* 0x02[1:0] = 2b'11 enable BB macro*/ \ 2588c2ecf20Sopenharmony_ci {0x0002, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \ 2598c2ecf20Sopenharmony_ci PWR_BASEADDR_MAC , PWR_CMD_WRITE, BIT(1) | BIT(0), BIT(1) | BIT(0)},\ 2608c2ecf20Sopenharmony_ci /*0x522 = 0*/ \ 2618c2ecf20Sopenharmony_ci {0x0522, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \ 2628c2ecf20Sopenharmony_ci PWR_BASEADDR_MAC , PWR_CMD_WRITE, 0xFF, 0}, \ 2638c2ecf20Sopenharmony_ci /*Clear ISR*/ \ 2648c2ecf20Sopenharmony_ci {0x013D, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \ 2658c2ecf20Sopenharmony_ci PWR_BASEADDR_MAC , PWR_CMD_WRITE, 0xFF, 0xFF}, 2668c2ecf20Sopenharmony_ci 2678c2ecf20Sopenharmony_ci#define RTL8192E_TRANS_END \ 2688c2ecf20Sopenharmony_ci /* format */ \ 2698c2ecf20Sopenharmony_ci /* comments here */ \ 2708c2ecf20Sopenharmony_ci /* { offset, cut_msk, fab_msk|interface_msk, base|cmd, msk, value },*/\ 2718c2ecf20Sopenharmony_ci {0xFFFF, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \ 2728c2ecf20Sopenharmony_ci 0, PWR_CMD_END, 0, 0}, 2738c2ecf20Sopenharmony_ci 2748c2ecf20Sopenharmony_ciextern struct wlan_pwr_cfg rtl8192E_power_on_flow 2758c2ecf20Sopenharmony_ci [RTL8192E_TRANS_CARDEMU_TO_ACT_STEPS + 2768c2ecf20Sopenharmony_ci RTL8192E_TRANS_END_STEPS]; 2778c2ecf20Sopenharmony_ciextern struct wlan_pwr_cfg rtl8192E_radio_off_flow 2788c2ecf20Sopenharmony_ci [RTL8192E_TRANS_ACT_TO_CARDEMU_STEPS + 2798c2ecf20Sopenharmony_ci RTL8192E_TRANS_END_STEPS]; 2808c2ecf20Sopenharmony_ciextern struct wlan_pwr_cfg rtl8192E_card_disable_flow 2818c2ecf20Sopenharmony_ci [RTL8192E_TRANS_ACT_TO_CARDEMU_STEPS + 2828c2ecf20Sopenharmony_ci RTL8192E_TRANS_CARDEMU_TO_PDN_STEPS + 2838c2ecf20Sopenharmony_ci RTL8192E_TRANS_END_STEPS]; 2848c2ecf20Sopenharmony_ciextern struct wlan_pwr_cfg rtl8192E_card_enable_flow 2858c2ecf20Sopenharmony_ci [RTL8192E_TRANS_ACT_TO_CARDEMU_STEPS + 2868c2ecf20Sopenharmony_ci RTL8192E_TRANS_CARDEMU_TO_PDN_STEPS + 2878c2ecf20Sopenharmony_ci RTL8192E_TRANS_END_STEPS]; 2888c2ecf20Sopenharmony_ciextern struct wlan_pwr_cfg rtl8192E_suspend_flow 2898c2ecf20Sopenharmony_ci [RTL8192E_TRANS_ACT_TO_CARDEMU_STEPS + 2908c2ecf20Sopenharmony_ci RTL8192E_TRANS_CARDEMU_TO_SUS_STEPS + 2918c2ecf20Sopenharmony_ci RTL8192E_TRANS_END_STEPS]; 2928c2ecf20Sopenharmony_ciextern struct wlan_pwr_cfg rtl8192E_resume_flow 2938c2ecf20Sopenharmony_ci [RTL8192E_TRANS_ACT_TO_CARDEMU_STEPS + 2948c2ecf20Sopenharmony_ci RTL8192E_TRANS_CARDEMU_TO_SUS_STEPS + 2958c2ecf20Sopenharmony_ci RTL8192E_TRANS_END_STEPS]; 2968c2ecf20Sopenharmony_ciextern struct wlan_pwr_cfg rtl8192E_hwpdn_flow 2978c2ecf20Sopenharmony_ci [RTL8192E_TRANS_ACT_TO_CARDEMU_STEPS + 2988c2ecf20Sopenharmony_ci RTL8192E_TRANS_CARDEMU_TO_PDN_STEPS + 2998c2ecf20Sopenharmony_ci RTL8192E_TRANS_END_STEPS]; 3008c2ecf20Sopenharmony_ciextern struct wlan_pwr_cfg rtl8192E_enter_lps_flow 3018c2ecf20Sopenharmony_ci [RTL8192E_TRANS_ACT_TO_LPS_STEPS + 3028c2ecf20Sopenharmony_ci RTL8192E_TRANS_END_STEPS]; 3038c2ecf20Sopenharmony_ciextern struct wlan_pwr_cfg rtl8192E_leave_lps_flow 3048c2ecf20Sopenharmony_ci [RTL8192E_TRANS_LPS_TO_ACT_STEPS + 3058c2ecf20Sopenharmony_ci RTL8192E_TRANS_END_STEPS]; 3068c2ecf20Sopenharmony_ci 3078c2ecf20Sopenharmony_ci/* RTL8192EE Power Configuration CMDs for PCIe interface */ 3088c2ecf20Sopenharmony_ci#define RTL8192E_NIC_PWR_ON_FLOW rtl8192E_power_on_flow 3098c2ecf20Sopenharmony_ci#define RTL8192E_NIC_RF_OFF_FLOW rtl8192E_radio_off_flow 3108c2ecf20Sopenharmony_ci#define RTL8192E_NIC_DISABLE_FLOW rtl8192E_card_disable_flow 3118c2ecf20Sopenharmony_ci#define RTL8192E_NIC_ENABLE_FLOW rtl8192E_card_enable_flow 3128c2ecf20Sopenharmony_ci#define RTL8192E_NIC_SUSPEND_FLOW rtl8192E_suspend_flow 3138c2ecf20Sopenharmony_ci#define RTL8192E_NIC_RESUME_FLOW rtl8192E_resume_flow 3148c2ecf20Sopenharmony_ci#define RTL8192E_NIC_PDN_FLOW rtl8192E_hwpdn_flow 3158c2ecf20Sopenharmony_ci#define RTL8192E_NIC_LPS_ENTER_FLOW rtl8192E_enter_lps_flow 3168c2ecf20Sopenharmony_ci#define RTL8192E_NIC_LPS_LEAVE_FLOW rtl8192E_leave_lps_flow 3178c2ecf20Sopenharmony_ci 3188c2ecf20Sopenharmony_ci#endif 319