Merge tag 'nfs-for-3.14-3' of git://git.linux-nfs.org/projects/trondmy/linux-nfs
[platform/adaptation/renesas_rcar/renesas_kernel.git] / drivers / staging / rtl8821ae / rtl8821ae / pwrseq.c
1 /******************************************************************************
2  *
3  * Copyright(c) 2009-2010  Realtek Corporation.
4  *
5  * This program is free software; you can redistribute it and/or modify it
6  * under the terms of version 2 of the GNU General Public License as
7  * published by the Free Software Foundation.
8  *
9  * This program is distributed in the hope that it will be useful, but WITHOUT
10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
12  * more details.
13  *
14  * You should have received a copy of the GNU General Public License along with
15  * this program; if not, write to the Free Software Foundation, Inc.,
16  * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
17  *
18  * The full GNU General Public License is included in this distribution in the
19  * file called LICENSE.
20  *
21  * Contact Information:
22  * wlanfae <wlanfae@realtek.com>
23  * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park,
24  * Hsinchu 300, Taiwan.
25  *
26  * Larry Finger <Larry.Finger@lwfinger.net>
27  *
28  *****************************************************************************/
29
30 #include "pwrseqcmd.h"
31 #include "pwrseq.h"
32
33 /*
34     drivers should parse below arrays and do the corresponding actions
35 */
36 //3 Power on  Array
37 struct wlan_pwr_cfg rtl8812_power_on_flow[RTL8812_TRANS_CARDEMU_TO_ACT_STEPS+RTL8812_TRANS_END_STEPS]=
38 {
39         RTL8812_TRANS_CARDEMU_TO_ACT
40         RTL8812_TRANS_END
41 };
42
43 //3Radio off GPIO Array
44 struct wlan_pwr_cfg rtl8812_radio_off_flow[RTL8812_TRANS_ACT_TO_CARDEMU_STEPS+RTL8812_TRANS_END_STEPS]=
45 {
46         RTL8812_TRANS_ACT_TO_CARDEMU
47         RTL8812_TRANS_END
48 };
49
50 //3Card Disable Array
51 struct wlan_pwr_cfg rtl8812_card_disable_flow[ RTL8812_TRANS_ACT_TO_CARDEMU_STEPS
52         + RTL8812_TRANS_CARDEMU_TO_PDN_STEPS
53         + RTL8812_TRANS_END_STEPS ] =
54 {
55         RTL8812_TRANS_ACT_TO_CARDEMU
56         RTL8812_TRANS_CARDEMU_TO_CARDDIS
57         RTL8812_TRANS_END
58 };
59
60 //3 Card Enable Array
61 struct wlan_pwr_cfg rtl8812_card_enable_flow[ RTL8812_TRANS_ACT_TO_CARDEMU_STEPS
62         + RTL8812_TRANS_CARDEMU_TO_PDN_STEPS
63         + RTL8812_TRANS_END_STEPS ] =
64 {
65         RTL8812_TRANS_CARDDIS_TO_CARDEMU
66         RTL8812_TRANS_CARDEMU_TO_ACT
67         RTL8812_TRANS_END
68 };
69
70 //3Suspend Array
71 struct wlan_pwr_cfg rtl8812_suspend_flow[RTL8812_TRANS_ACT_TO_CARDEMU_STEPS+RTL8812_TRANS_CARDEMU_TO_SUS_STEPS+RTL8812_TRANS_END_STEPS]=
72 {
73         RTL8812_TRANS_ACT_TO_CARDEMU
74         RTL8812_TRANS_CARDEMU_TO_SUS
75         RTL8812_TRANS_END
76 };
77
78 //3 Resume Array
79 struct wlan_pwr_cfg rtl8812_resume_flow[RTL8812_TRANS_ACT_TO_CARDEMU_STEPS+RTL8812_TRANS_CARDEMU_TO_SUS_STEPS+RTL8812_TRANS_END_STEPS]=
80 {
81         RTL8812_TRANS_SUS_TO_CARDEMU
82         RTL8812_TRANS_CARDEMU_TO_ACT
83         RTL8812_TRANS_END
84 };
85
86
87
88 //3HWPDN Array
89 struct wlan_pwr_cfg rtl8812_hwpdn_flow[RTL8812_TRANS_ACT_TO_CARDEMU_STEPS+RTL8812_TRANS_CARDEMU_TO_PDN_STEPS+RTL8812_TRANS_END_STEPS]=
90 {
91         RTL8812_TRANS_ACT_TO_CARDEMU
92         RTL8812_TRANS_CARDEMU_TO_PDN
93         RTL8812_TRANS_END
94 };
95
96 //3 Enter LPS
97 struct wlan_pwr_cfg rtl8812_enter_lps_flow[RTL8812_TRANS_ACT_TO_LPS_STEPS+RTL8812_TRANS_END_STEPS]=
98 {
99         //FW behavior
100         RTL8812_TRANS_ACT_TO_LPS
101         RTL8812_TRANS_END
102 };
103
104 //3 Leave LPS
105 struct wlan_pwr_cfg rtl8812_leave_lps_flow[RTL8812_TRANS_LPS_TO_ACT_STEPS+RTL8812_TRANS_END_STEPS]=
106 {
107         //FW behavior
108         RTL8812_TRANS_LPS_TO_ACT
109         RTL8812_TRANS_END
110 };
111
112
113 /*
114     drivers should parse below arrays and do the corresponding actions
115 */
116 /*3 Power on  Array*/
117 struct wlan_pwr_cfg rtl8821A_power_on_flow[RTL8821A_TRANS_CARDEMU_TO_ACT_STEPS
118                                         + RTL8821A_TRANS_END_STEPS] =
119 {
120         RTL8821A_TRANS_CARDEMU_TO_ACT
121         RTL8821A_TRANS_END
122 };
123
124 /*3Radio off GPIO Array */
125 struct wlan_pwr_cfg rtl8821A_radio_off_flow[RTL8821A_TRANS_ACT_TO_CARDEMU_STEPS
126                                         + RTL8821A_TRANS_END_STEPS] =
127 {
128         RTL8821A_TRANS_ACT_TO_CARDEMU
129         RTL8821A_TRANS_END
130 };
131
132 /*3Card Disable Array*/
133 struct wlan_pwr_cfg rtl8821A_card_disable_flow[RTL8821A_TRANS_ACT_TO_CARDEMU_STEPS
134                                         + RTL8821A_TRANS_CARDEMU_TO_PDN_STEPS
135                                         + RTL8821A_TRANS_END_STEPS] =
136 {
137         RTL8821A_TRANS_ACT_TO_CARDEMU
138         RTL8821A_TRANS_CARDEMU_TO_CARDDIS
139         RTL8821A_TRANS_END
140 };
141
142 /*3 Card Enable Array*/
143 struct wlan_pwr_cfg rtl8821A_card_enable_flow[RTL8821A_TRANS_ACT_TO_CARDEMU_STEPS
144                                         + RTL8821A_TRANS_CARDEMU_TO_ACT_STEPS /*RTL8821A_TRANS_CARDEMU_TO_PDN_STEPS*/
145                                         + RTL8821A_TRANS_END_STEPS] =
146 {
147         RTL8821A_TRANS_CARDDIS_TO_CARDEMU
148         RTL8821A_TRANS_CARDEMU_TO_ACT
149         RTL8821A_TRANS_END
150 };
151
152 /*3Suspend Array*/
153 struct wlan_pwr_cfg rtl8821A_suspend_flow[RTL8821A_TRANS_ACT_TO_CARDEMU_STEPS
154                                         + RTL8821A_TRANS_CARDEMU_TO_SUS_STEPS
155                                         + RTL8821A_TRANS_END_STEPS] =
156 {
157         RTL8821A_TRANS_ACT_TO_CARDEMU
158         RTL8821A_TRANS_CARDEMU_TO_SUS
159         RTL8821A_TRANS_END
160 };
161
162 /*3 Resume Array*/
163 struct wlan_pwr_cfg rtl8821A_resume_flow[RTL8821A_TRANS_ACT_TO_CARDEMU_STEPS
164                                         + RTL8821A_TRANS_CARDEMU_TO_SUS_STEPS
165                                         + RTL8821A_TRANS_END_STEPS] =
166 {
167         RTL8821A_TRANS_SUS_TO_CARDEMU
168         RTL8821A_TRANS_CARDEMU_TO_ACT
169         RTL8821A_TRANS_END
170 };
171
172 /*3HWPDN Array*/
173 struct wlan_pwr_cfg rtl8821A_hwpdn_flow[RTL8821A_TRANS_ACT_TO_CARDEMU_STEPS
174                                 + RTL8821A_TRANS_CARDEMU_TO_PDN_STEPS
175                                 + RTL8821A_TRANS_END_STEPS] =
176 {
177         RTL8821A_TRANS_ACT_TO_CARDEMU
178         RTL8821A_TRANS_CARDEMU_TO_PDN
179         RTL8821A_TRANS_END
180 };
181
182 /*3 Enter LPS */
183 struct wlan_pwr_cfg rtl8821A_enter_lps_flow[RTL8821A_TRANS_ACT_TO_LPS_STEPS
184                                         + RTL8821A_TRANS_END_STEPS] =
185 {
186         /*FW behavior*/
187         RTL8821A_TRANS_ACT_TO_LPS
188         RTL8821A_TRANS_END
189 };
190
191 /*3 Leave LPS */
192 struct wlan_pwr_cfg rtl8821A_leave_lps_flow[RTL8821A_TRANS_LPS_TO_ACT_STEPS
193                                         + RTL8821A_TRANS_END_STEPS] =
194 {
195         /*FW behavior*/
196         RTL8821A_TRANS_LPS_TO_ACT
197         RTL8821A_TRANS_END
198 };
199