xref: /freebsd/sys/dev/rtwn/rtl8812a/r12a_priv.h (revision f126890ac5386406dadf7c4cfa9566cbb56537c5)
1 /*-
2  * Copyright (c) 2016 Andriy Voskoboinyk <avos@FreeBSD.org>
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  * 1. Redistributions of source code must retain the above copyright
9  *    notice, this list of conditions and the following disclaimer.
10  * 2. Redistributions in binary form must reproduce the above copyright
11  *    notice, this list of conditions and the following disclaimer in the
12  *    documentation and/or other materials provided with the distribution.
13  *
14  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24  * SUCH DAMAGE.
25  */
26 
27 #ifndef R12A_PRIV_H
28 #define R12A_PRIV_H
29 
30 /*
31  * MAC initialization values.
32  */
33 #define RTL8812AU_MAC_PROG_START \
34 	{ 0x010, 0x0c },
35 
36 #define RTL8812AU_MAC_PROG_END \
37 	{ 0x025, 0x0f }, { 0x072, 0x00 }, { 0x420, 0x80 }, { 0x428, 0x0a }, \
38 	{ 0x429, 0x10 }, { 0x430, 0x00 }, { 0x431, 0x00 }, { 0x432, 0x00 }, \
39 	{ 0x433, 0x01 }, { 0x434, 0x04 }, { 0x435, 0x05 }, { 0x436, 0x07 }, \
40 	{ 0x437, 0x08 }, { 0x43c, 0x04 }, { 0x43d, 0x05 }, { 0x43e, 0x07 }, \
41 	{ 0x43f, 0x08 }, { 0x440, 0x5d }, { 0x441, 0x01 }, { 0x442, 0x00 }, \
42 	{ 0x444, 0x10 }, { 0x445, 0x00 }, { 0x446, 0x00 }, { 0x447, 0x00 }, \
43 	{ 0x448, 0x00 }, { 0x449, 0xf0 }, { 0x44a, 0x0f }, { 0x44b, 0x3e }, \
44 	{ 0x44c, 0x10 }, { 0x44d, 0x00 }, { 0x44e, 0x00 }, { 0x44f, 0x00 }, \
45 	{ 0x450, 0x00 }, { 0x451, 0xf0 }, { 0x452, 0x0f }, { 0x453, 0x00 }, \
46 	{ 0x45b, 0x80 }, { 0x460, 0x66 }, { 0x461, 0x66 }, { 0x4c8, 0xff }, \
47 	{ 0x4c9, 0x08 }, { 0x4cc, 0xff }, { 0x4cd, 0xff }, { 0x4ce, 0x01 }, \
48 	{ 0x500, 0x26 }, { 0x501, 0xa2 }, { 0x502, 0x2f }, { 0x503, 0x00 }, \
49 	{ 0x504, 0x28 }, { 0x505, 0xa3 }, { 0x506, 0x5e }, { 0x507, 0x00 }, \
50 	{ 0x508, 0x2b }, { 0x509, 0xa4 }, { 0x50a, 0x5e }, { 0x50b, 0x00 }, \
51 	{ 0x50c, 0x4f }, { 0x50d, 0xa4 }, { 0x50e, 0x00 }, { 0x50f, 0x00 }, \
52 	{ 0x512, 0x1c }, { 0x514, 0x0a }, { 0x516, 0x0a }, { 0x525, 0x4f }, \
53 	{ 0x550, 0x10 }, { 0x551, 0x10 }, { 0x559, 0x02 }, { 0x55c, 0x50 }, \
54 	{ 0x55d, 0xff }, { 0x604, 0x09 }, { 0x605, 0x30 }, { 0x607, 0x03 }, \
55 	{ 0x608, 0x0e }, { 0x609, 0x2a }, { 0x620, 0xff }, { 0x621, 0xff }, \
56 	{ 0x622, 0xff }, { 0x623, 0xff }, { 0x624, 0xff }, { 0x625, 0xff }, \
57 	{ 0x626, 0xff }, { 0x627, 0xff }, { 0x638, 0x50 }, { 0x63c, 0x0a }, \
58 	{ 0x63d, 0x0a }, { 0x63e, 0x0e }, { 0x63f, 0x0e }, { 0x640, 0x80 }, \
59 	{ 0x642, 0x40 }, { 0x643, 0x00 }, { 0x652, 0xc8 }, { 0x66e, 0x05 }, \
60 	{ 0x700, 0x21 }, { 0x701, 0x43 }, { 0x702, 0x65 }, { 0x703, 0x87 }, \
61 	{ 0x708, 0x21 }, { 0x709, 0x43 }, { 0x70a, 0x65 }, { 0x70b, 0x87 }, \
62 	{ 0x718, 0x40 }
63 
64 static const struct rtwn_mac_prog rtl8812au_mac_no_ext_pa_lna[] = {
65 	RTL8812AU_MAC_PROG_START
66 	{ 0x11, 0x66 },
67 	RTL8812AU_MAC_PROG_END
68 }, rtl8812au_mac[] = {
69 	RTL8812AU_MAC_PROG_START
70 	{ 0x11, 0x5a },
71 	RTL8812AU_MAC_PROG_END
72 };
73 
74 /*
75  * Baseband initialization values.
76  */
77 #define R12A_COND_GPA		0x01
78 #define R12A_COND_APA		0x02
79 #define R12A_COND_GLNA		0x04
80 #define R12A_COND_ALNA		0x08
81 #define R12A_COND_TYPE(t)	((t) << 4)
82 
83 static const uint16_t rtl8812au_bb_regs0[] = {
84 	0x800, 0x804, 0x808, 0x80c, 0x810, 0x814, 0x818, 0x820, 0x824,
85 	0x828, 0x82c, 0x830, 0x834, 0x838, 0x83c, 0x840, 0x844, 0x848,
86 	0x84c, 0x850, 0x854, 0x858, 0x85c, 0x860, 0x864, 0x868, 0x86c,
87 	0x870, 0x874, 0x878, 0x87c, 0x8a0, 0x8a4, 0x8a8, 0x8ac, 0x8b0,
88 	0x8b4, 0x8b8, 0x8bc, 0x8c0, 0x8c4, 0x8c8, 0x8cc, 0x8d0, 0x8dc,
89 	0x8d4, 0x8d8, 0x8f8, 0x8fc, 0x900, 0x90c, 0x910, 0x914, 0x918,
90 	0x91c, 0x920, 0x924, 0x928, 0x92c, 0x930, 0x934, 0x960, 0x964,
91 	0x968, 0x96c, 0x970, 0x978, 0x97c, 0x980, 0x984, 0x988, 0x990,
92 	0x994, 0x998, 0x99c, 0x9a0, 0x9a4, 0x9a8, 0x9ac, 0x9b0, 0x9b4,
93 	0x9b8, 0x9bc, 0x9d0, 0x9d4, 0x9d8, 0x9dc, 0x9e4, 0x9e8, 0xa00,
94 	0xa04, 0xa08, 0xa0c, 0xa10, 0xa14, 0xa18, 0xa1c, 0xa20, 0xa24,
95 	0xa28, 0xa2c, 0xa70, 0xa74, 0xa78, 0xa7c, 0xa80, 0xa84, 0xb00,
96 	0xb04, 0xb08, 0xb0c, 0xb10, 0xb14, 0xb18, 0xb1c, 0xb20, 0xb24,
97 	0xb28, 0xb2c, 0xb30, 0xb34, 0xb38, 0xb3c, 0xb40, 0xb44, 0xb48,
98 	0xb4c, 0xb50, 0xb54, 0xb58, 0xb5c, 0xc00, 0xc04, 0xc08, 0xc0c,
99 	0xc10, 0xc14, 0xc1c, 0xc20, 0xc24, 0xc28, 0xc2c, 0xc30, 0xc34,
100 	0xc38, 0xc3c, 0xc40, 0xc44, 0xc48, 0xc4c, 0xc50, 0xc54, 0xc58,
101 	0xc5c, 0xc60, 0xc64
102 }, rtl8812au_bb_regs1[] = {
103 	0xc68
104 }, rtl8812au_bb_regs2[] = {
105 	0xc6c, 0xc70, 0xc74, 0xc78, 0xc7c, 0xc80, 0xc84, 0xc94, 0xc98,
106 	0xc9c, 0xca0, 0xca4, 0xca8, 0xcb0, 0xcb4, 0xcb8, 0xe00, 0xe04,
107 	0xe08, 0xe0c, 0xe10, 0xe14, 0xe1c, 0xe20, 0xe24, 0xe28, 0xe2c,
108 	0xe30, 0xe34, 0xe38, 0xe3c, 0xe40, 0xe44, 0xe48, 0xe4c, 0xe50,
109 	0xe54, 0xe58, 0xe5c, 0xe60, 0xe64, 0xe68, 0xe6c, 0xe70, 0xe74,
110 	0xe78, 0xe7c, 0xe80, 0xe84, 0xe94, 0xe98, 0xe9c, 0xea0, 0xea4,
111 	0xea8, 0xeb0, 0xeb4, 0xeb8
112 };
113 
114 static const uint32_t rtl8812au_bb_vals0[] = {
115 	0x8020d010, 0x080112e0, 0x0e028233, 0x12131113, 0x20101263,
116 	0x020c3d10, 0x03a00385, 0x00000000, 0x00030fe0, 0x00000000,
117 	0x002083dd, 0x2eaaeeb8, 0x0037a706, 0x06c89b44, 0x0000095b,
118 	0xc0000001, 0x40003cde, 0x6210ff8b, 0x6cfdffb8, 0x28874706,
119 	0x0001520c, 0x8060e000, 0x74210168, 0x6929c321, 0x79727432,
120 	0x8ca7a314, 0x338c2878, 0x03333333, 0x31602c2e, 0x00003152,
121 	0x000fc000, 0x00000013, 0x7f7f7f7f, 0xa202033e, 0x0ff0fa0a,
122 	0x00000600, 0x000fc080, 0x6c0057ff, 0x4ca520a3, 0x27f00020,
123 	0x00000000, 0x00012d69, 0x08248492, 0x0000b800, 0x00000000,
124 	0x940008a0, 0x290b5612, 0x400002c0, 0x00000000, 0x00000701,
125 	0x00000000, 0x0000fc00, 0x00000404, 0x1c1028c0, 0x64b11a1c,
126 	0xe0767233, 0x055aa500, 0x00000004, 0xfffe0000, 0xfffffffe,
127 	0x001fffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
128 	0x801fffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
129 	0x00000000, 0x27100000, 0xffff0100, 0xffffff5c, 0xffffffff,
130 	0x000000ff, 0x00080080, 0x00000000, 0x00000000, 0x81081008,
131 	0x00000000, 0x01081008, 0x01081008, 0x00000000, 0x00000000,
132 	0x00000000, 0x00000000, 0x00000003, 0x000002d5, 0x00d047c8,
133 	0x01ff000c, 0x8c838300, 0x2e7f000f, 0x9500bb78, 0x11144028,
134 	0x00881117, 0x89140f00, 0x1a1b0000, 0x090e1217, 0x00000305,
135 	0x00900000, 0x101fff00, 0x00000008, 0x00000900, 0x225b0606,
136 	0x218075b2, 0x001f8c80, 0x03100000, 0x0000b000, 0xae0201eb,
137 	0x01003207, 0x00009807, 0x01000000, 0x00000002, 0x00000002,
138 	0x0000001f, 0x03020100, 0x07060504, 0x0b0a0908, 0x0f0e0d0c,
139 	0x13121110, 0x17161514, 0x0000003a, 0x00000000, 0x00000000,
140 	0x13000032, 0x48080000, 0x00000000, 0x00000000, 0x00000000,
141 	0x00000000, 0x00000007, 0x00042020, 0x80410231, 0x00000000,
142 	0x00000100, 0x01000000, 0x40000003, 0x12121212, 0x12121212,
143 	0x12121212, 0x12121212, 0x12121212, 0x12121212, 0x12121212,
144 	0x12121212, 0x12121212, 0x12121212, 0x12121212, 0x12121212,
145 	0x00000020, 0x0008121c, 0x30000c1c, 0x00000058, 0x34344443,
146 	0x07003333
147 }, rtl8812au_bb_vals1_ext_pa_lna[] = {
148 	0x59791979
149 }, rtl8812au_bb_vals1[] = {
150 	0x59799979
151 }, rtl8812au_bb_vals2[] = {
152 	0x59795979, 0x19795979, 0x19795979, 0x19791979, 0x19791979,
153 	0x19791979, 0x19791979, 0x0100005c, 0x00000000, 0x00000000,
154 	0x00000029, 0x08040201, 0x80402010, 0x77547777, 0x00000077,
155 	0x00508242, 0x00000007, 0x00042020, 0x80410231, 0x00000000,
156 	0x00000100, 0x01000000, 0x40000003, 0x12121212, 0x12121212,
157 	0x12121212, 0x12121212, 0x12121212, 0x12121212, 0x12121212,
158 	0x12121212, 0x12121212, 0x12121212, 0x12121212, 0x12121212,
159 	0x00000020, 0x0008121c, 0x30000c1c, 0x00000058, 0x34344443,
160 	0x07003333, 0x59791979, 0x59795979, 0x19795979, 0x19795979,
161 	0x19791979, 0x19791979, 0x19791979, 0x19791979, 0x0100005c,
162 	0x00000000, 0x00000000, 0x00000029, 0x08040201, 0x80402010,
163 	0x77547777, 0x00000077, 0x00508242
164 };
165 
166 static const struct rtwn_bb_prog rtl8812au_bb[] = {
167 	{
168 		nitems(rtl8812au_bb_regs0),
169 		rtl8812au_bb_regs0,
170 		rtl8812au_bb_vals0,
171 		{ 0 },
172 		NULL
173 	},
174 	/*
175 	 * Devices with:
176 	 * * External 2GHz PA, type 0;
177 	 * * External 5GHz PA, type 0 or 5;
178 	 * * External 2GHz LNA, type 0 or 5;
179 	 * * External 5GHz LNA, type 0;
180 	 */
181 	{
182 		nitems(rtl8812au_bb_regs1),
183 		rtl8812au_bb_regs1,
184 		rtl8812au_bb_vals1_ext_pa_lna,
185 		{
186 			R12A_COND_GPA | R12A_COND_GLNA |
187 			R12A_COND_APA | R12A_COND_ALNA |
188 			R12A_COND_TYPE(0x0),
189 			R12A_COND_APA | R12A_COND_GLNA |
190 			R12A_COND_TYPE(0x5), 0
191 		},
192 		/*
193 		 * Others.
194 		 */
195 		&(const struct rtwn_bb_prog){
196 			nitems(rtl8812au_bb_regs1),
197 			rtl8812au_bb_regs1,
198 			rtl8812au_bb_vals1,
199 			{ 0 },
200 			NULL
201 		}
202 	},
203 	{
204 		nitems(rtl8812au_bb_regs2),
205 		rtl8812au_bb_regs2,
206 		rtl8812au_bb_vals2,
207 		{ 0 },
208 		NULL
209 	}
210 };
211 
212 static const uint32_t rtl8812au_agc_vals0_lna_g0[] = {
213 	0xfc000001, 0xfb020001, 0xfa040001, 0xf9060001, 0xf8080001,
214 	0xf70a0001, 0xf60c0001, 0xf50e0001, 0xf4100001, 0xf3120001,
215 	0xf2140001, 0xf1160001, 0xf0180001, 0xef1a0001, 0xee1c0001,
216 	0xed1e0001, 0xec200001, 0xeb220001, 0xea240001, 0xcd260001,
217 	0xcc280001, 0xcb2a0001, 0xca2c0001, 0xc92e0001, 0xc8300001,
218 	0xa6320001, 0xa5340001, 0xa4360001, 0xa3380001, 0xa23a0001,
219 	0x883c0001, 0x873e0001, 0x86400001, 0x85420001, 0x84440001,
220 	0x83460001, 0x82480001, 0x814a0001, 0x484c0001, 0x474e0001,
221 	0x46500001, 0x45520001, 0x44540001, 0x43560001, 0x42580001,
222 	0x415a0001, 0x255c0001, 0x245e0001, 0x23600001, 0x22620001,
223 	0x21640001, 0x21660001, 0x21680001, 0x216a0001, 0x216c0001,
224 	0x216e0001, 0x21700001, 0x21720001, 0x21740001, 0x21760001,
225 	0x21780001, 0x217a0001, 0x217c0001, 0x217e0001
226 }, rtl8812au_agc_vals0_lna_g5[] = {
227 	0xf9000001, 0xf8020001, 0xf7040001, 0xf6060001, 0xf5080001,
228 	0xf40a0001, 0xf30c0001, 0xf20e0001, 0xf1100001, 0xf0120001,
229 	0xef140001, 0xee160001, 0xed180001, 0xec1a0001, 0xeb1c0001,
230 	0xea1e0001, 0xcd200001, 0xcc220001, 0xcb240001, 0xca260001,
231 	0xc9280001, 0xc82a0001, 0xc72c0001, 0xc62e0001, 0xa5300001,
232 	0xa4320001, 0xa3340001, 0xa2360001, 0x88380001, 0x873a0001,
233 	0x863c0001, 0x853e0001, 0x84400001, 0x83420001, 0x82440001,
234 	0x81460001, 0x48480001, 0x474a0001, 0x464c0001, 0x454e0001,
235 	0x44500001, 0x43520001, 0x42540001, 0x41560001, 0x25580001,
236 	0x245a0001, 0x235c0001, 0x225e0001, 0x21600001, 0x21620001,
237 	0x21640001, 0x21660001, 0x21680001, 0x216a0001, 0x236c0001,
238 	0x226e0001, 0x21700001, 0x21720001, 0x21740001, 0x21760001,
239 	0x21780001, 0x217a0001, 0x217c0001, 0x217e0001
240 }, rtl8812au_agc_vals0[] = {
241 	0xff000001, 0xff020001, 0xff040001, 0xff060001, 0xff080001,
242 	0xfe0a0001, 0xfd0c0001, 0xfc0e0001, 0xfb100001, 0xfa120001,
243 	0xf9140001, 0xf8160001, 0xf7180001, 0xf61a0001, 0xf51c0001,
244 	0xf41e0001, 0xf3200001, 0xf2220001, 0xf1240001, 0xf0260001,
245 	0xef280001, 0xee2a0001, 0xed2c0001, 0xec2e0001, 0xeb300001,
246 	0xea320001, 0xe9340001, 0xe8360001, 0xe7380001, 0xe63a0001,
247 	0xe53c0001, 0xc73e0001, 0xc6400001, 0xc5420001, 0xc4440001,
248 	0xc3460001, 0xc2480001, 0xc14a0001, 0xa74c0001, 0xa64e0001,
249 	0xa5500001, 0xa4520001, 0xa3540001, 0xa2560001, 0xa1580001,
250 	0x675a0001, 0x665c0001, 0x655e0001, 0x64600001, 0x63620001,
251 	0x48640001, 0x47660001, 0x46680001, 0x456a0001, 0x446c0001,
252 	0x436e0001, 0x42700001, 0x41720001, 0x41740001, 0x41760001,
253 	0x41780001, 0x417a0001, 0x417c0001, 0x417e0001
254 }, rtl8812au_agc_vals1_lna_a0[] = {
255 	0xfc800001, 0xfb820001, 0xfa840001, 0xf9860001, 0xf8880001,
256 	0xf78a0001, 0xf68c0001, 0xf58e0001, 0xf4900001, 0xf3920001,
257 	0xf2940001, 0xf1960001, 0xf0980001, 0xef9a0001, 0xee9c0001,
258 	0xed9e0001, 0xeca00001, 0xeba20001, 0xeaa40001, 0xe9a60001,
259 	0xe8a80001, 0xe7aa0001, 0xe6ac0001, 0xe5ae0001, 0xe4b00001,
260 	0xe3b20001, 0xa8b40001, 0xa7b60001, 0xa6b80001, 0xa5ba0001,
261 	0xa4bc0001, 0xa3be0001, 0xa2c00001, 0xa1c20001, 0x68c40001,
262 	0x67c60001, 0x66c80001, 0x65ca0001, 0x64cc0001, 0x47ce0001,
263 	0x46d00001, 0x45d20001, 0x44d40001, 0x43d60001, 0x42d80001,
264 	0x08da0001, 0x07dc0001, 0x06de0001, 0x05e00001, 0x04e20001,
265 	0x03e40001, 0x02e60001, 0x01e80001, 0x01ea0001, 0x01ec0001,
266 	0x01ee0001, 0x01f00001, 0x01f20001, 0x01f40001, 0x01f60001,
267 	0x01f80001, 0x01fa0001, 0x01fc0001, 0x01fe0001
268 }, rtl8812au_agc_vals1[] = {
269 	0xff800001, 0xff820001, 0xff840001, 0xfe860001, 0xfd880001,
270 	0xfc8a0001, 0xfb8c0001, 0xfa8e0001, 0xf9900001, 0xf8920001,
271 	0xf7940001, 0xf6960001, 0xf5980001, 0xf49a0001, 0xf39c0001,
272 	0xf29e0001, 0xf1a00001, 0xf0a20001, 0xefa40001, 0xeea60001,
273 	0xeda80001, 0xecaa0001, 0xebac0001, 0xeaae0001, 0xe9b00001,
274 	0xe8b20001, 0xe7b40001, 0xe6b60001, 0xe5b80001, 0xe4ba0001,
275 	0xe3bc0001, 0xa8be0001, 0xa7c00001, 0xa6c20001, 0xa5c40001,
276 	0xa4c60001, 0xa3c80001, 0xa2ca0001, 0xa1cc0001, 0x68ce0001,
277 	0x67d00001, 0x66d20001, 0x65d40001, 0x64d60001, 0x47d80001,
278 	0x46da0001, 0x45dc0001, 0x44de0001, 0x43e00001, 0x42e20001,
279 	0x08e40001, 0x07e60001, 0x06e80001, 0x05ea0001, 0x04ec0001,
280 	0x03ee0001, 0x02f00001, 0x01f20001, 0x01f40001, 0x01f60001,
281 	0x01f80001, 0x01fa0001, 0x01fc0001, 0x01fe0001
282 };
283 
284 static const struct rtwn_agc_prog rtl8812au_agc[] = {
285 	/*
286 	 * External 2GHz LNA (type 0).
287 	 */
288 	{
289 		nitems(rtl8812au_agc_vals0_lna_g0),
290 		rtl8812au_agc_vals0_lna_g0,
291 		{ R12A_COND_GLNA | R12A_COND_TYPE(0x0), 0 },
292 		/*
293 		 * External 2GHz LNA (type 5).
294 		 */
295 		&(const struct rtwn_agc_prog){
296 			nitems(rtl8812au_agc_vals0_lna_g5),
297 			rtl8812au_agc_vals0_lna_g5,
298 			{ R12A_COND_GLNA | R12A_COND_TYPE(0x5), 0 },
299 			/*
300 			 * Others.
301 			 */
302 			&(const struct rtwn_agc_prog){
303 				nitems(rtl8812au_agc_vals0),
304 				rtl8812au_agc_vals0,
305 				{ 0 },
306 				NULL
307 			}
308 		}
309 	},
310 	/*
311 	 * External 5GHz LNA (type 0).
312 	 */
313 	{
314 		nitems(rtl8812au_agc_vals1_lna_a0),
315 		rtl8812au_agc_vals1_lna_a0,
316 		{ R12A_COND_ALNA | R12A_COND_TYPE(0x0), 0 },
317 		/*
318 		 * Others.
319 		 */
320 		&(const struct rtwn_agc_prog){
321 			nitems(rtl8812au_agc_vals1),
322 			rtl8812au_agc_vals1,
323 			{ 0 },
324 			NULL
325 		}
326 	}
327 };
328 
329 /*
330  * RF initialization values.
331  */
332 static const uint8_t rtl8812au_rf0_regs0[] = {
333 	0x00, 0x18, 0x56, 0x66, 0x1e, 0x89
334 }, rtl8812au_rf0_regs1[] = {
335 	0x86
336 }, rtl8812au_rf0_regs2[] = {
337 	0x8b
338 }, rtl8812au_rf0_regs3[] = {
339 	0xb1, 0xb3, 0xb4, 0xba,	0x18, 0xef
340 }, rtl8812au_rf0_regs4[] = {
341 	0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b
342 }, rtl8812au_rf0_regs5[] = {
343 	0xef, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34,
344 	0x34
345 }, rtl8812au_rf0_regs6[] = {
346 	0xef, 0xef, 0xdf, 0x35, 0x35, 0x35, 0x36, 0x36, 0x36, 0x36, 0xef,
347 	0x51, 0x52, 0x53, 0x54, 0xef, 0x08, 0x18, 0xef, 0x3a, 0x3b, 0x3c,
348 	0x3a, 0x3b, 0x3c, 0x3a, 0x3b, 0x3c, 0x3a, 0x3b, 0x3c, 0x3a, 0x3b,
349 	0x3c, 0x3a, 0x3b, 0x3c, 0x3a, 0x3b, 0x3c, 0x3a, 0x3b, 0x3c, 0x3a,
350 	0x3b, 0x3c, 0x3a, 0x3b, 0x3c, 0x3a, 0x3b, 0x3c, 0x3a, 0x3b, 0x3c,
351 	0x3a, 0x3b, 0x3c, 0x3a, 0x3b, 0x3c, 0x3a, 0x3b, 0x3c, 0x3a, 0x3b,
352 	0x3c, 0x3a, 0x3b, 0x3c, 0x3a, 0x3b, 0x3c, 0x3a, 0x3b, 0x3c, 0x3a,
353 	0x3b, 0x3c, 0x3a, 0x3b, 0x3c, 0x3a, 0x3b, 0x3c, 0x3a, 0x3b, 0x3c,
354 	0x3a, 0x3b, 0x3c, 0xef
355 }, rtl8812au_rf0_regs7[] = {
356 	0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34,
357 	0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34,
358 	0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34
359 }, rtl8812au_rf0_regs8[] = {
360 	0xef, 0x18, 0xef, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35,
361 	0x35, 0xef, 0x18, 0xef, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
362 	0x36, 0x36, 0x36, 0x36, 0x36, 0xef, 0xef, 0x3c, 0x3c, 0x3c,
363 }, rtl8812au_rf0_regs9[] = {
364 	0xef, 0x18, 0xef, 0xdf, 0x1f
365 }, rtl8812au_rf0_regs10[] = {
366 	0x61, 0x62, 0x63, 0x64, 0x65
367 }, rtl8812au_rf0_regs11[] = {
368 	0x08, 0x1c, 0xb4, 0x18, 0xfe, 0xfe, 0xfe, 0xfe, 0xb4, 0x18
369 }, rtl8812au_rf1_regs0[] = {
370 	0x56, 0x66, 0x89
371 }, rtl8812au_rf1_regs3[] = {
372 	0xb1, 0xb3, 0xb4, 0xba, 0x18, 0xef
373 };
374 
375 static const uint32_t rtl8812au_rf0_vals0[] = {
376 	0x10000, 0x1712a, 0x51cf2, 0x40000, 0x80000, 0x00080
377 }, rtl8812au_rf0_vals1_lna_g0_g5[] = {
378 	0x14b3a
379 }, rtl8812au_rf0_vals1[] = {
380 	0x14b38
381 }, rtl8812au_rf0_vals2_lna_a0[] = {
382 	0x80180
383 }, rtl8812au_rf0_vals2[] = {
384 	0x87180
385 }, rtl8812au_rf0_vals3[] = {
386 	0x1fc1a, 0xf0810, 0x1a78d, 0x86180, 0x00006, 0x02000
387 }, rtl8812au_rf0_vals4_lna_g0_g5[] = {
388 	0x3f218, 0x30a58, 0x2fa58, 0x22590, 0x1fa50, 0x10248, 0x08240
389 }, rtl8812au_rf0_vals4[] = {
390 	0x38a58, 0x37a58, 0x2a590, 0x27a50, 0x18248, 0x10240, 0x08240
391 }, rtl8812au_rf0_vals5_pa_g0[] = {
392 	0x00100, 0x0a4ee, 0x09076, 0x08073, 0x07070, 0x0606d, 0x0506a,
393 	0x04049, 0x03046, 0x02028, 0x01025, 0x00022
394 }, rtl8812au_rf0_vals5[] = {
395 	0x00100, 0x0adf4, 0x09df1, 0x08dee, 0x07deb, 0x06de8, 0x05de5,
396 	0x04de2, 0x03ce6, 0x024e7, 0x014e4, 0x004e1
397 }, rtl8812au_rf0_vals6[] = {
398 	0x00000, 0x020a2, 0x00080, 0x00192, 0x08192, 0x10192, 0x00024,
399 	0x08024, 0x10024, 0x18024, 0x00000, 0x00c21, 0x006d9, 0xfc649,
400 	0x0017e, 0x00002, 0x08400, 0x1712a, 0x01000, 0x00080, 0x3a02c,
401 	0x04000, 0x00400, 0x3202c, 0x10000, 0x000a0, 0x2b064, 0x04000,
402 	0x000d8, 0x23070, 0x04000, 0x00468, 0x1b870, 0x10000, 0x00098,
403 	0x12085, 0xe4000, 0x00418, 0x0a080, 0xf0000, 0x00418, 0x02080,
404 	0x10000, 0x00080, 0x7a02c, 0x04000, 0x00400, 0x7202c, 0x10000,
405 	0x000a0, 0x6b064, 0x04000, 0x000d8, 0x63070, 0x04000, 0x00468,
406 	0x5b870, 0x10000, 0x00098, 0x52085, 0xe4000, 0x00418, 0x4a080,
407 	0xf0000, 0x00418, 0x42080, 0x10000, 0x00080, 0xba02c, 0x04000,
408 	0x00400, 0xb202c, 0x10000, 0x000a0, 0xab064, 0x04000, 0x000d8,
409 	0xa3070, 0x04000, 0x00468, 0x9b870, 0x10000, 0x00098, 0x92085,
410 	0xe4000, 0x00418, 0x8a080, 0xf0000, 0x00418, 0x82080, 0x10000,
411 	0x01100
412 }, rtl8812au_rf0_vals7_pa_a0[] = {
413 	0x4a0b2, 0x490af, 0x48070, 0x4706d, 0x46050, 0x4504d, 0x4404a,
414 	0x43047, 0x4200a, 0x41007, 0x40004, 0x2a0b2, 0x290af, 0x28070,
415 	0x2706d, 0x26050, 0x2504d, 0x2404a, 0x23047, 0x2200a, 0x21007,
416 	0x20004, 0x0a0b2, 0x090af, 0x08070, 0x0706d, 0x06050, 0x0504d,
417 	0x0404a, 0x03047, 0x0200a, 0x01007, 0x00004
418 }, rtl8812au_rf0_vals7_pa_a5[] = {
419 	0x4a0b2, 0x490af, 0x48070, 0x4706d, 0x4604d, 0x4504a, 0x44047,
420 	0x43044, 0x42007, 0x41004, 0x40001, 0x2a0b4, 0x290b1, 0x28072,
421 	0x2706f, 0x2604f, 0x2504c, 0x24049, 0x23046, 0x22009, 0x21006,
422 	0x20003, 0x0a0b2, 0x090af, 0x08070, 0x0706d, 0x0604d, 0x0504a,
423 	0x04047, 0x03044, 0x02007, 0x01004, 0x00001
424 }, rtl8812au_rf0_vals7[] = {
425 	0x4adf5, 0x49df2, 0x48def, 0x47dec, 0x46de9, 0x45de6, 0x44de3,
426 	0x438c8, 0x428c5, 0x418c2, 0x408c0, 0x2adf5, 0x29df2, 0x28def,
427 	0x27dec, 0x26de9, 0x25de6, 0x24de3, 0x238c8, 0x228c5, 0x218c2,
428 	0x208c0, 0x0aff7, 0x09df7, 0x08df4, 0x07df1, 0x06dee, 0x05deb,
429 	0x04de8, 0x038cc, 0x028c9, 0x018c6, 0x008c3
430 }, rtl8812au_rf0_vals8_pa_a0_a5[] = {
431 	0x00000, 0x1712a, 0x00040, 0x001d4, 0x081d4, 0x101d4, 0x201b4,
432 	0x281b4, 0x301b4, 0x401b4, 0x481b4, 0x501b4, 0x00000, 0x1712a,
433 	0x00010, 0x04bfb, 0x0cbfb, 0x14bfb, 0x1cbfb, 0x24f4b, 0x2cf4b,
434 	0x34f4b, 0x3cf4b, 0x44f4b, 0x4cf4b, 0x54f4b, 0x5cf4b, 0x00000,
435 	0x00008, 0x002cc, 0x00522, 0x00902
436 }, rtl8812au_rf0_vals8[] = {
437 	0x00000, 0x1712a, 0x00040, 0x00188, 0x08147, 0x10147, 0x201d7,
438 	0x281d7, 0x301d7, 0x401d8, 0x481d8, 0x501d8, 0x00000, 0x1712a,
439 	0x00010, 0x84eb4, 0x8cc35, 0x94c35, 0x9cc35, 0xa4c35, 0xacc35,
440 	0xb4c35, 0xbcc35, 0xc4c34, 0xccc35, 0xd4c35, 0xdcc35, 0x00000,
441 	0x00008, 0x002a8, 0x005a2, 0x00880
442 }, rtl8812au_rf0_vals9[] = {
443 	0x00000, 0x1712a, 0x00002, 0x00080, 0x00064
444 }, rtl8812au_rf0_vals10_pa_a0[] = {
445 	0xfdd43, 0x38f4b, 0x32117, 0x194ac, 0x931d1
446 }, rtl8812au_rf0_vals10_pa_a5[] = {
447 	0xfdd43, 0x38f4b, 0x32117, 0x194ac, 0x931d2
448 }, rtl8812au_rf0_vals10[] = {
449 	0xe5d53, 0x38fcd, 0x114eb, 0x196ac, 0x911d7
450 }, rtl8812au_rf0_vals11[] = {
451 	0x08400, 0x739d2, 0x1e78d, 0x1f12a, 0x0c350, 0x0c350, 0x0c350,
452 	0x0c350, 0x1a78d, 0x1712a
453 }, rtl8812au_rf1_vals0[] = {
454 	0x51cf2, 0x40000, 0x00080
455 }, rtl8812au_rf1_vals3[] = {
456 	0x1fc1a, 0xf0810, 0x1a78d, 0x86180, 0x00006, 0x02000
457 }, rtl8812au_rf1_vals6[] = {
458 	0x00000, 0x020a2, 0x00080, 0x00192, 0x08192, 0x10192, 0x00024,
459 	0x08024, 0x10024, 0x18024, 0x00000, 0x00c21, 0x006d9, 0xfc649,
460 	0x0017e, 0x00002, 0x08400, 0x1712a, 0x01000, 0x00080, 0x3a02c,
461 	0x04000, 0x00400, 0x3202c, 0x10000, 0x000a0, 0x2b064, 0x04000,
462 	0x000d8, 0x23070, 0x04000, 0x00468, 0x1b870, 0x10000, 0x00098,
463 	0x12085, 0xe4000, 0x00418, 0x0a080, 0xf0000, 0x00418, 0x02080,
464 	0x10000, 0x00080, 0x7a02c, 0x04000, 0x00400, 0x7202c, 0x10000,
465 	0x000a0, 0x6b064, 0x04000, 0x000d8, 0x63070, 0x04000, 0x00468,
466 	0x5b870, 0x10000, 0x00098, 0x52085, 0xe4000, 0x00418, 0x4a080,
467 	0xf0000, 0x00418, 0x42080, 0x10000, 0x00080, 0xba02c, 0x04000,
468 	0x00400, 0xb202c, 0x10000, 0x000a0, 0xab064, 0x04000, 0x000d8,
469 	0xa3070, 0x04000, 0x00468, 0x9b870, 0x10000, 0x00098, 0x92085,
470 	0xe4000, 0x00418, 0x8a080, 0xf0000, 0x00418, 0x82080, 0x10000,
471 	0x01100
472 }, rtl8812au_rf1_vals7_pa_a5[] = {
473 	0x4a0b1, 0x490ae, 0x4806f, 0x4706c, 0x4604c, 0x45049, 0x44046,
474 	0x43043, 0x42006, 0x41003, 0x40000, 0x2a0b3, 0x290b0, 0x28071,
475 	0x2706e, 0x2604e, 0x2504b, 0x24048, 0x23045, 0x22008, 0x21005,
476 	0x20002, 0x0a0b3, 0x090b0, 0x08070, 0x0706d, 0x0604d, 0x0504a,
477 	0x04047, 0x03044, 0x02007, 0x01004, 0x00001
478 }, rtl8812au_rf1_vals8_pa_a0_a5[] = {
479 	0x00000, 0x1712a, 0x00040, 0x001c5, 0x081c5, 0x101c5, 0x20174,
480 	0x28174, 0x30174, 0x40185, 0x48185, 0x50185, 0x00000, 0x1712a,
481 	0x00010, 0x05b8b, 0x0db8b, 0x15b8b, 0x1db8b, 0x262db, 0x2e2db,
482 	0x362db, 0x3e2db, 0x4553b, 0x4d53b, 0x5553b, 0x5d53b, 0x00000,
483 	0x00008, 0x002dc, 0x00524, 0x00902
484 }, rtl8812au_rf1_vals10_pa_g0_a0[] = {
485 	0xeac43, 0x38f47, 0x31157, 0x1c4ac, 0x931d1
486 }, rtl8812au_rf1_vals10_pa_a5[] = {
487 	0xeac43, 0x38f47, 0x31157, 0x1c4ac, 0x931d2
488 };
489 
490 static const struct rtwn_rf_prog rtl8812au_rf[] = {
491 	/* RF chain 0. */
492 	{
493 		nitems(rtl8812au_rf0_regs0),
494 		rtl8812au_rf0_regs0,
495 		rtl8812au_rf0_vals0,
496 		{ 0 },
497 		NULL
498 	},
499 	/* External 2GHz LNA, type 0 or 5. */
500 	{
501 		nitems(rtl8812au_rf0_regs1),
502 		rtl8812au_rf0_regs1,
503 		rtl8812au_rf0_vals1_lna_g0_g5,
504 		{
505 			R12A_COND_GLNA | R12A_COND_TYPE(0x0),
506 			R12A_COND_GLNA | R12A_COND_TYPE(0x5), 0
507 		},
508 		/* Others. */
509 		&(const struct rtwn_rf_prog){
510 			nitems(rtl8812au_rf0_regs1),
511 			rtl8812au_rf0_regs1,
512 			rtl8812au_rf0_vals1,
513 			{ 0 },
514 			NULL
515 		}
516 	},
517 	/* External 5GHz LNA, type 0. */
518 	{
519 		nitems(rtl8812au_rf0_regs2),
520 		rtl8812au_rf0_regs2,
521 		rtl8812au_rf0_vals2_lna_a0,
522 		{ R12A_COND_ALNA | R12A_COND_TYPE(0x0), 0 },
523 		/* Others. */
524 		&(const struct rtwn_rf_prog){
525 			nitems(rtl8812au_rf0_regs2),
526 			rtl8812au_rf0_regs2,
527 			rtl8812au_rf0_vals2,
528 			{ 0 },
529 			NULL
530 		}
531 	},
532 	{
533 		nitems(rtl8812au_rf0_regs3),
534 		rtl8812au_rf0_regs3,
535 		rtl8812au_rf0_vals3,
536 		{ 0 },
537 		NULL
538 	},
539 	/* External 2GHz LNA, type 0 or 5. */
540 	{
541 		nitems(rtl8812au_rf0_regs4),
542 		rtl8812au_rf0_regs4,
543 		rtl8812au_rf0_vals4_lna_g0_g5,
544 		{
545 			R12A_COND_GLNA | R12A_COND_TYPE(0x0),
546 			R12A_COND_GLNA | R12A_COND_TYPE(0x5), 0
547 		},
548 		/* Others */
549 		&(const struct rtwn_rf_prog){
550 			nitems(rtl8812au_rf0_regs4),
551 			rtl8812au_rf0_regs4,
552 			rtl8812au_rf0_vals4,
553 			{ 0 },
554 			NULL
555 		}
556 	},
557 	/* External 2GHz PA, type 0. */
558 	{
559 		nitems(rtl8812au_rf0_regs5),
560 		rtl8812au_rf0_regs5,
561 		rtl8812au_rf0_vals5_pa_g0,
562 		{ R12A_COND_GPA | R12A_COND_TYPE(0x0), 0 },
563 		/* Others. */
564 		&(const struct rtwn_rf_prog){
565 			nitems(rtl8812au_rf0_regs5),
566 			rtl8812au_rf0_regs5,
567 			rtl8812au_rf0_vals5,
568 			{ 0 },
569 			NULL
570 		}
571 	},
572 	{
573 		nitems(rtl8812au_rf0_regs6),
574 		rtl8812au_rf0_regs6,
575 		rtl8812au_rf0_vals6,
576 		{ 0 },
577 		NULL
578 	},
579 	/* External 5GHz PA, type 0. */
580 	{
581 		nitems(rtl8812au_rf0_regs7),
582 		rtl8812au_rf0_regs7,
583 		rtl8812au_rf0_vals7_pa_a0,
584 		{ R12A_COND_APA | R12A_COND_TYPE(0x0), 0 },
585 		/* External 5GHz PA, type 5. */
586 		&(const struct rtwn_rf_prog){
587 			nitems(rtl8812au_rf0_regs7),
588 			rtl8812au_rf0_regs7,
589 			rtl8812au_rf0_vals7_pa_a5,
590 			{ R12A_COND_APA | R12A_COND_TYPE(0x5), 0 },
591 			/* Others. */
592 			&(const struct rtwn_rf_prog){
593 				nitems(rtl8812au_rf0_regs7),
594 				rtl8812au_rf0_regs7,
595 				rtl8812au_rf0_vals7,
596 				{ 0 },
597 				NULL
598 			}
599 		}
600 	},
601 	/* External 5GHz PA, type 0 or 5. */
602 	{
603 		nitems(rtl8812au_rf0_regs8),
604 		rtl8812au_rf0_regs8,
605 		rtl8812au_rf0_vals8_pa_a0_a5,
606 		{
607 			R12A_COND_APA | R12A_COND_TYPE(0x0),
608 			R12A_COND_APA | R12A_COND_TYPE(0x5), 0
609 		},
610 		/* Others. */
611 		&(const struct rtwn_rf_prog){
612 			nitems(rtl8812au_rf0_regs8),
613 			rtl8812au_rf0_regs8,
614 			rtl8812au_rf0_vals8,
615 			{ 0 },
616 			NULL
617 		}
618 	},
619 	{
620 		nitems(rtl8812au_rf0_regs9),
621 		rtl8812au_rf0_regs9,
622 		rtl8812au_rf0_vals9,
623 		{ 0 },
624 		NULL
625 	},
626 	/* External 5GHz PA, type 0. */
627 	{
628 		nitems(rtl8812au_rf0_regs10),
629 		rtl8812au_rf0_regs10,
630 		rtl8812au_rf0_vals10_pa_a0,
631 		{ R12A_COND_APA | R12A_COND_TYPE(0x0), 0 },
632 		/* External 5GHz PA, type 5. */
633 		&(const struct rtwn_rf_prog){
634 			nitems(rtl8812au_rf0_regs10),
635 			rtl8812au_rf0_regs10,
636 			rtl8812au_rf0_vals10_pa_a5,
637 			{ R12A_COND_APA | R12A_COND_TYPE(0x5), 0 },
638 			/* Others. */
639 			&(const struct rtwn_rf_prog){
640 				nitems(rtl8812au_rf0_regs10),
641 				rtl8812au_rf0_regs10,
642 				rtl8812au_rf0_vals10,
643 				{ 0 },
644 				NULL
645 			}
646 		}
647 	},
648 	{
649 		nitems(rtl8812au_rf0_regs11),
650 		rtl8812au_rf0_regs11,
651 		rtl8812au_rf0_vals11,
652 		{ 0 },
653 		NULL
654 	},
655 	{ 0, NULL, NULL, { 0 },	NULL },
656 	/* RF chain 1. */
657 	{
658 		nitems(rtl8812au_rf1_regs0),
659 		rtl8812au_rf1_regs0,
660 		rtl8812au_rf1_vals0,
661 		{ 0 },
662 		NULL
663 	},
664 	/* rtl8812au_rf[1] */
665 	/* External 2GHz LNA, type 0 or 5. */
666 	{
667 		nitems(rtl8812au_rf0_regs1),
668 		rtl8812au_rf0_regs1,
669 		rtl8812au_rf0_vals1_lna_g0_g5,
670 		{
671 			R12A_COND_GLNA | R12A_COND_TYPE(0x0),
672 			R12A_COND_GLNA | R12A_COND_TYPE(0x5), 0
673 		},
674 		/* Others. */
675 		&(const struct rtwn_rf_prog){
676 			nitems(rtl8812au_rf0_regs1),
677 			rtl8812au_rf0_regs1,
678 			rtl8812au_rf0_vals1,
679 			{ 0 },
680 			NULL
681 		}
682 	},
683 	/* rtl8812au_rf[2] */
684 	/* External 5GHz LNA, type 0. */
685 	{
686 		nitems(rtl8812au_rf0_regs2),
687 		rtl8812au_rf0_regs2,
688 		rtl8812au_rf0_vals2_lna_a0,
689 		{ R12A_COND_ALNA | R12A_COND_TYPE(0x0), 0 },
690 		/* Others. */
691 		&(const struct rtwn_rf_prog){
692 			nitems(rtl8812au_rf0_regs2),
693 			rtl8812au_rf0_regs2,
694 			rtl8812au_rf0_vals2,
695 			{ 0 },
696 			NULL
697 		}
698 	},
699 	{
700 		nitems(rtl8812au_rf1_regs3),
701 		rtl8812au_rf1_regs3,
702 		rtl8812au_rf1_vals3,
703 		{ 0 },
704 		NULL
705 	},
706 	/* rtl8812au_rf[4] */
707 	/* External 2GHz LNA, type 0 or 5. */
708 	{
709 		nitems(rtl8812au_rf0_regs4),
710 		rtl8812au_rf0_regs4,
711 		rtl8812au_rf0_vals4_lna_g0_g5,
712 		{
713 			R12A_COND_GLNA | R12A_COND_TYPE(0x0),
714 			R12A_COND_GLNA | R12A_COND_TYPE(0x5), 0
715 		},
716 		/* Others */
717 		&(const struct rtwn_rf_prog){
718 			nitems(rtl8812au_rf0_regs4),
719 			rtl8812au_rf0_regs4,
720 			rtl8812au_rf0_vals4,
721 			{ 0 },
722 			NULL
723 		}
724 	},
725 	/* rtl8812au_rf[5] */
726 	/* External 2GHz PA, type 0. */
727 	{
728 		nitems(rtl8812au_rf0_regs5),
729 		rtl8812au_rf0_regs5,
730 		rtl8812au_rf0_vals5_pa_g0,
731 		{ R12A_COND_GPA | R12A_COND_TYPE(0x0), 0 },
732 		/* Others. */
733 		&(const struct rtwn_rf_prog){
734 			nitems(rtl8812au_rf0_regs5),
735 			rtl8812au_rf0_regs5,
736 			rtl8812au_rf0_vals5,
737 			{ 0 },
738 			NULL
739 		}
740 	},
741 	{
742 		nitems(rtl8812au_rf0_regs6),
743 		rtl8812au_rf0_regs6,
744 		rtl8812au_rf1_vals6,
745 		{ 0 },
746 		NULL
747 	},
748 	/* External 5GHz PA, type 0. */
749 	{
750 		nitems(rtl8812au_rf0_regs7),
751 		rtl8812au_rf0_regs7,
752 		rtl8812au_rf0_vals7_pa_a0,
753 		{ R12A_COND_APA | R12A_COND_TYPE(0x0), 0 },
754 		/* External 5GHz PA, type 5. */
755 		&(const struct rtwn_rf_prog){
756 			nitems(rtl8812au_rf0_regs7),
757 			rtl8812au_rf0_regs7,
758 			rtl8812au_rf1_vals7_pa_a5,
759 			{ R12A_COND_APA | R12A_COND_TYPE(0x5), 0 },
760 			/* Others. */
761 			&(const struct rtwn_rf_prog){
762 				nitems(rtl8812au_rf0_regs7),
763 				rtl8812au_rf0_regs7,
764 				rtl8812au_rf0_vals7,
765 				{ 0 },
766 				NULL
767 			}
768 		}
769 	},
770 	/* External 5GHz PA, type 0 or 5. */
771 	{
772 		nitems(rtl8812au_rf0_regs8),
773 		rtl8812au_rf0_regs8,
774 		rtl8812au_rf1_vals8_pa_a0_a5,
775 		{
776 			R12A_COND_APA | R12A_COND_TYPE(0x0),
777 			R12A_COND_APA | R12A_COND_TYPE(0x5), 0
778 		},
779 		/* Others. */
780 		&(const struct rtwn_rf_prog){
781 			nitems(rtl8812au_rf0_regs8),
782 			rtl8812au_rf0_regs8,
783 			rtl8812au_rf0_vals8,
784 			{ 0 },
785 			NULL
786 		}
787 	},
788 	{
789 		nitems(rtl8812au_rf0_regs9) - 1,
790 		rtl8812au_rf0_regs9,
791 		rtl8812au_rf0_vals9,
792 		{ 0 },
793 		NULL
794 	},
795 
796 	/* External 2GHz or 5GHz PA, type 0. */
797 	{
798 		nitems(rtl8812au_rf0_regs10),
799 		rtl8812au_rf0_regs10,
800 		rtl8812au_rf1_vals10_pa_g0_a0,
801 		{
802 			R12A_COND_GPA | R12A_COND_TYPE(0x0),
803 			R12A_COND_APA | R12A_COND_TYPE(0x0), 0
804 		},
805 		/* External 5GHz PA, type 5. */
806 		&(const struct rtwn_rf_prog){
807 			nitems(rtl8812au_rf0_regs10),
808 			rtl8812au_rf0_regs10,
809 			rtl8812au_rf1_vals10_pa_a5,
810 			{ R12A_COND_APA | R12A_COND_TYPE(0x5), 0 },
811 			/* Others. */
812 			&(const struct rtwn_rf_prog){
813 				nitems(rtl8812au_rf0_regs10),
814 				rtl8812au_rf0_regs10,
815 				rtl8812au_rf0_vals10,
816 				{ 0 },
817 				NULL
818 			}
819 		}
820 	},
821 	{
822 		1,
823 		rtl8812au_rf0_regs11,
824 		rtl8812au_rf0_vals11,
825 		{ 0 },
826 		NULL
827 	},
828 	{ 0, NULL, NULL, { 0 }, NULL }
829 };
830 
831 /*
832  * Registers to save before IQ calibration.
833  */
834 static const uint16_t r12a_iq_bb_regs[] = {
835 	0x520, 0x550, 0x808, 0xa04, 0x90c, 0xc00, 0xe00, 0x838, 0x82c
836 };
837 
838 static const uint16_t r12a_iq_afe_regs[] = {
839 	0xc5c, 0xc60, 0xc64, 0xc68, 0xcb0, 0xcb4, 0xe5c, 0xe60, 0xe64,
840 	0xe68, 0xeb0, 0xeb4
841 };
842 
843 static const uint8_t r12a_iq_rf_regs[] = {
844 	0x65, 0x8f, 0x0
845 };
846 
847 #endif	/* R12A_PRIV_H */
848