1 // SPDX-License-Identifier: GPL-2.0
2 /* Copyright(c) 2009-2010  Realtek Corporation.*/
3 
4 #include "../pwrseqcmd.h"
5 #include "pwrseq.h"
6 
7 /* drivers should parse below arrays and do the corresponding actions */
8 /* 3 Power on  Array */
9 struct wlan_pwr_cfg rtl8812_power_on_flow[RTL8812_TRANS_CARDEMU_TO_ACT_STEPS +
10 					RTL8812_TRANS_END_STEPS] = {
11 	RTL8812_TRANS_CARDEMU_TO_ACT
12 	RTL8812_TRANS_END
13 };
14 
15 /* 3Radio off GPIO Array */
16 struct wlan_pwr_cfg rtl8812_radio_off_flow[RTL8812_TRANS_ACT_TO_CARDEMU_STEPS +
17 						RTL8812_TRANS_END_STEPS] = {
18 	RTL8812_TRANS_ACT_TO_CARDEMU
19 	RTL8812_TRANS_END
20 };
21 
22 /* 3Card Disable Array */
23 struct wlan_pwr_cfg rtl8812_card_disable_flow[RTL8812_TRANS_ACT_TO_CARDEMU_STEPS
24 	+ RTL8812_TRANS_CARDEMU_TO_PDN_STEPS
25 	+ RTL8812_TRANS_END_STEPS] = {
26 	RTL8812_TRANS_ACT_TO_CARDEMU
27 	RTL8812_TRANS_CARDEMU_TO_CARDDIS
28 	RTL8812_TRANS_END
29 };
30 
31 /* 3 Card Enable Array */
32 struct wlan_pwr_cfg rtl8812_card_enable_flow[RTL8812_TRANS_ACT_TO_CARDEMU_STEPS
33 	+ RTL8812_TRANS_CARDEMU_TO_PDN_STEPS
34 	+ RTL8812_TRANS_END_STEPS] = {
35 	RTL8812_TRANS_CARDDIS_TO_CARDEMU
36 	RTL8812_TRANS_CARDEMU_TO_ACT
37 	RTL8812_TRANS_END
38 };
39 
40 /* 3Suspend Array */
41 struct wlan_pwr_cfg rtl8812_suspend_flow[RTL8812_TRANS_ACT_TO_CARDEMU_STEPS +
42 					RTL8812_TRANS_CARDEMU_TO_SUS_STEPS +
43 					RTL8812_TRANS_END_STEPS] = {
44 	RTL8812_TRANS_ACT_TO_CARDEMU
45 	RTL8812_TRANS_CARDEMU_TO_SUS
46 	RTL8812_TRANS_END
47 };
48 
49 /* 3 Resume Array */
50 struct wlan_pwr_cfg rtl8812_resume_flow[RTL8812_TRANS_ACT_TO_CARDEMU_STEPS +
51 					RTL8812_TRANS_CARDEMU_TO_SUS_STEPS +
52 					RTL8812_TRANS_END_STEPS] = {
53 	RTL8812_TRANS_SUS_TO_CARDEMU
54 	RTL8812_TRANS_CARDEMU_TO_ACT
55 	RTL8812_TRANS_END
56 };
57 
58 /* 3HWPDN Array */
59 struct wlan_pwr_cfg rtl8812_hwpdn_flow[RTL8812_TRANS_ACT_TO_CARDEMU_STEPS +
60 					RTL8812_TRANS_CARDEMU_TO_PDN_STEPS +
61 					RTL8812_TRANS_END_STEPS] = {
62 	RTL8812_TRANS_ACT_TO_CARDEMU
63 	RTL8812_TRANS_CARDEMU_TO_PDN
64 	RTL8812_TRANS_END
65 };
66 
67 /* 3 Enter LPS */
68 struct wlan_pwr_cfg rtl8812_enter_lps_flow[RTL8812_TRANS_ACT_TO_LPS_STEPS +
69 						RTL8812_TRANS_END_STEPS] = {
70 	/* FW behavior */
71 	RTL8812_TRANS_ACT_TO_LPS
72 	RTL8812_TRANS_END
73 };
74 
75 /* 3 Leave LPS */
76 struct wlan_pwr_cfg rtl8812_leave_lps_flow[RTL8812_TRANS_LPS_TO_ACT_STEPS +
77 						RTL8812_TRANS_END_STEPS] = {
78 	/* FW behavior */
79 	RTL8812_TRANS_LPS_TO_ACT
80 	RTL8812_TRANS_END
81 };
82 
83 /* drivers should parse below arrays and do the corresponding actions */
84 /*3 Power on  Array*/
85 struct wlan_pwr_cfg rtl8821A_power_on_flow[RTL8821A_TRANS_CARDEMU_TO_ACT_STEPS
86 					+ RTL8821A_TRANS_END_STEPS] = {
87 	RTL8821A_TRANS_CARDEMU_TO_ACT
88 	RTL8821A_TRANS_END
89 };
90 
91 /*3Radio off GPIO Array */
92 struct wlan_pwr_cfg rtl8821A_radio_off_flow[RTL8821A_TRANS_ACT_TO_CARDEMU_STEPS
93 					+ RTL8821A_TRANS_END_STEPS] = {
94 	RTL8821A_TRANS_ACT_TO_CARDEMU
95 	RTL8821A_TRANS_END
96 };
97 
98 /*3Card Disable Array*/
99 struct wlan_pwr_cfg rtl8821A_card_disable_flow
100 					[RTL8821A_TRANS_ACT_TO_CARDEMU_STEPS
101 					+ RTL8821A_TRANS_CARDEMU_TO_PDN_STEPS
102 					+ RTL8821A_TRANS_END_STEPS] = {
103 	RTL8821A_TRANS_ACT_TO_CARDEMU
104 	RTL8821A_TRANS_CARDEMU_TO_CARDDIS
105 	RTL8821A_TRANS_END
106 };
107 
108 /*3 Card Enable Array*/
109 /*RTL8821A_TRANS_CARDEMU_TO_PDN_STEPS*/
110 struct wlan_pwr_cfg rtl8821A_card_enable_flow
111 					[RTL8821A_TRANS_ACT_TO_CARDEMU_STEPS
112 					+ RTL8821A_TRANS_CARDEMU_TO_ACT_STEPS
113 					+ RTL8821A_TRANS_END_STEPS] = {
114 	RTL8821A_TRANS_CARDDIS_TO_CARDEMU
115 	RTL8821A_TRANS_CARDEMU_TO_ACT
116 	RTL8821A_TRANS_END
117 };
118 
119 /*3Suspend Array*/
120 struct wlan_pwr_cfg rtl8821A_suspend_flow[RTL8821A_TRANS_ACT_TO_CARDEMU_STEPS
121 					+ RTL8821A_TRANS_CARDEMU_TO_SUS_STEPS
122 					+ RTL8821A_TRANS_END_STEPS] = {
123 	RTL8821A_TRANS_ACT_TO_CARDEMU
124 	RTL8821A_TRANS_CARDEMU_TO_SUS
125 	RTL8821A_TRANS_END
126 };
127 
128 /*3 Resume Array*/
129 struct wlan_pwr_cfg rtl8821A_resume_flow[RTL8821A_TRANS_ACT_TO_CARDEMU_STEPS
130 					+ RTL8821A_TRANS_CARDEMU_TO_SUS_STEPS
131 					+ RTL8821A_TRANS_END_STEPS] = {
132 	RTL8821A_TRANS_SUS_TO_CARDEMU
133 	RTL8821A_TRANS_CARDEMU_TO_ACT
134 	RTL8821A_TRANS_END
135 };
136 
137 /*3HWPDN Array*/
138 struct wlan_pwr_cfg rtl8821A_hwpdn_flow[RTL8821A_TRANS_ACT_TO_CARDEMU_STEPS
139 				+ RTL8821A_TRANS_CARDEMU_TO_PDN_STEPS
140 				+ RTL8821A_TRANS_END_STEPS] = {
141 	RTL8821A_TRANS_ACT_TO_CARDEMU
142 	RTL8821A_TRANS_CARDEMU_TO_PDN
143 	RTL8821A_TRANS_END
144 };
145 
146 /*3 Enter LPS */
147 struct wlan_pwr_cfg rtl8821A_enter_lps_flow[RTL8821A_TRANS_ACT_TO_LPS_STEPS
148 					+ RTL8821A_TRANS_END_STEPS] = {
149 	/*FW behavior*/
150 	RTL8821A_TRANS_ACT_TO_LPS
151 	RTL8821A_TRANS_END
152 };
153 
154 /*3 Leave LPS */
155 struct wlan_pwr_cfg rtl8821A_leave_lps_flow[RTL8821A_TRANS_LPS_TO_ACT_STEPS
156 					+ RTL8821A_TRANS_END_STEPS] = {
157 	/*FW behavior*/
158 	RTL8821A_TRANS_LPS_TO_ACT
159 	RTL8821A_TRANS_END
160 };
161