xref: /OK3568_Linux_fs/kernel/drivers/net/wireless/rockchip_wlan/rtl8723bs/hal/rtl8723b/Hal8723BPwrSeq.c (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /******************************************************************************
3  *
4  * Copyright(c) Semiconductor - 2017 Realtek Corporation.
5  *
6  * This program is free software; you can redistribute it and/or modify it
7  * under the terms of version 2 of the GNU General Public License as
8  * published by the Free Software Foundation.
9  *
10  * This program is distributed in the hope that it will be useful, but WITHOUT
11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13  * more details.
14  *
15  *****************************************************************************/
16 
17 
18 #include "Hal8723BPwrSeq.h"
19 
20 
21 /*
22     drivers should parse below arrays and do the corresponding actions
23 */
24 /* 3 Power on  Array */
25 WLAN_PWR_CFG rtl8723B_power_on_flow[RTL8723B_TRANS_CARDEMU_TO_ACT_STEPS + RTL8723B_TRANS_END_STEPS] = {
26 	RTL8723B_TRANS_CARDEMU_TO_ACT
27 	RTL8723B_TRANS_END
28 };
29 
30 /* 3Radio off GPIO Array */
31 WLAN_PWR_CFG rtl8723B_radio_off_flow[RTL8723B_TRANS_ACT_TO_CARDEMU_STEPS + RTL8723B_TRANS_END_STEPS] = {
32 	RTL8723B_TRANS_ACT_TO_CARDEMU
33 	RTL8723B_TRANS_END
34 };
35 
36 /* 3Card Disable Array */
37 WLAN_PWR_CFG rtl8723B_card_disable_flow[RTL8723B_TRANS_ACT_TO_CARDEMU_STEPS + RTL8723B_TRANS_CARDEMU_TO_PDN_STEPS + RTL8723B_TRANS_END_STEPS] = {
38 	RTL8723B_TRANS_ACT_TO_CARDEMU
39 	RTL8723B_TRANS_CARDEMU_TO_CARDDIS
40 	RTL8723B_TRANS_END
41 };
42 
43 /* 3 Card Enable Array */
44 WLAN_PWR_CFG rtl8723B_card_enable_flow[RTL8723B_TRANS_ACT_TO_CARDEMU_STEPS + RTL8723B_TRANS_CARDEMU_TO_PDN_STEPS + RTL8723B_TRANS_END_STEPS] = {
45 	RTL8723B_TRANS_CARDDIS_TO_CARDEMU
46 	RTL8723B_TRANS_CARDEMU_TO_ACT
47 	RTL8723B_TRANS_END
48 };
49 
50 /* 3Suspend Array */
51 WLAN_PWR_CFG rtl8723B_suspend_flow[RTL8723B_TRANS_ACT_TO_CARDEMU_STEPS + RTL8723B_TRANS_CARDEMU_TO_SUS_STEPS + RTL8723B_TRANS_END_STEPS] = {
52 	RTL8723B_TRANS_ACT_TO_CARDEMU
53 	RTL8723B_TRANS_CARDEMU_TO_SUS
54 	RTL8723B_TRANS_END
55 };
56 
57 /* 3 Resume Array */
58 WLAN_PWR_CFG rtl8723B_resume_flow[RTL8723B_TRANS_ACT_TO_CARDEMU_STEPS + RTL8723B_TRANS_CARDEMU_TO_SUS_STEPS + RTL8723B_TRANS_END_STEPS] = {
59 	RTL8723B_TRANS_SUS_TO_CARDEMU
60 	RTL8723B_TRANS_CARDEMU_TO_ACT
61 	RTL8723B_TRANS_END
62 };
63 
64 /* 3HWPDN Array */
65 WLAN_PWR_CFG rtl8723B_hwpdn_flow[RTL8723B_TRANS_ACT_TO_CARDEMU_STEPS + RTL8723B_TRANS_CARDEMU_TO_PDN_STEPS + RTL8723B_TRANS_END_STEPS] = {
66 	RTL8723B_TRANS_ACT_TO_CARDEMU
67 	RTL8723B_TRANS_CARDEMU_TO_PDN
68 	RTL8723B_TRANS_END
69 };
70 
71 /* 3 Enter LPS */
72 WLAN_PWR_CFG rtl8723B_enter_lps_flow[RTL8723B_TRANS_ACT_TO_LPS_STEPS + RTL8723B_TRANS_END_STEPS] = {
73 	/* FW behavior */
74 	RTL8723B_TRANS_ACT_TO_LPS
75 	RTL8723B_TRANS_END
76 };
77 
78 /* 3 Leave LPS */
79 WLAN_PWR_CFG rtl8723B_leave_lps_flow[RTL8723B_TRANS_LPS_TO_ACT_STEPS + RTL8723B_TRANS_END_STEPS] = {
80 	/* FW behavior */
81 	RTL8723B_TRANS_LPS_TO_ACT
82 	RTL8723B_TRANS_END
83 };
84 
85 /* 3 Enter SW LPS */
86 WLAN_PWR_CFG rtl8723B_enter_swlps_flow[RTL8723B_TRANS_ACT_TO_SWLPS_STEPS + RTL8723B_TRANS_END_STEPS] = {
87 	/* SW behavior */
88 	RTL8723B_TRANS_ACT_TO_SWLPS
89 	RTL8723B_TRANS_END
90 };
91 
92 /* 3 Leave SW LPS */
93 WLAN_PWR_CFG rtl8723B_leave_swlps_flow[RTL8723B_TRANS_SWLPS_TO_ACT_STEPS + RTL8723B_TRANS_END_STEPS] = {
94 	/* SW behavior */
95 	RTL8723B_TRANS_SWLPS_TO_ACT
96 	RTL8723B_TRANS_END
97 };
98