1*e3ec7017SPing-Ke Shih /* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
2*e3ec7017SPing-Ke Shih /* Copyright(c) 2019-2020  Realtek Corporation
3*e3ec7017SPing-Ke Shih  */
4*e3ec7017SPing-Ke Shih 
5*e3ec7017SPing-Ke Shih #ifndef __RTW89_8852A_RFK_TABLE_H__
6*e3ec7017SPing-Ke Shih #define __RTW89_8852A_RFK_TABLE_H__
7*e3ec7017SPing-Ke Shih 
8*e3ec7017SPing-Ke Shih #include "core.h"
9*e3ec7017SPing-Ke Shih 
10*e3ec7017SPing-Ke Shih enum rtw89_rfk_flag {
11*e3ec7017SPing-Ke Shih 	RTW89_RFK_F_WRF = 0,
12*e3ec7017SPing-Ke Shih 	RTW89_RFK_F_WM = 1,
13*e3ec7017SPing-Ke Shih 	RTW89_RFK_F_WS = 2,
14*e3ec7017SPing-Ke Shih 	RTW89_RFK_F_WC = 3,
15*e3ec7017SPing-Ke Shih 	RTW89_RFK_F_DELAY = 4,
16*e3ec7017SPing-Ke Shih 	RTW89_RFK_F_NUM,
17*e3ec7017SPing-Ke Shih };
18*e3ec7017SPing-Ke Shih 
19*e3ec7017SPing-Ke Shih struct rtw89_rfk_tbl {
20*e3ec7017SPing-Ke Shih 	const struct rtw89_reg5_def *defs;
21*e3ec7017SPing-Ke Shih 	u32 size;
22*e3ec7017SPing-Ke Shih };
23*e3ec7017SPing-Ke Shih 
24*e3ec7017SPing-Ke Shih #define DECLARE_RFK_TBL(_name)			\
25*e3ec7017SPing-Ke Shih const struct rtw89_rfk_tbl _name ## _tbl = {	\
26*e3ec7017SPing-Ke Shih 	.defs = _name,				\
27*e3ec7017SPing-Ke Shih 	.size = ARRAY_SIZE(_name),		\
28*e3ec7017SPing-Ke Shih }
29*e3ec7017SPing-Ke Shih 
30*e3ec7017SPing-Ke Shih #define DECL_RFK_WRF(_path, _addr, _mask, _data)	\
31*e3ec7017SPing-Ke Shih 	{.flag = RTW89_RFK_F_WRF,			\
32*e3ec7017SPing-Ke Shih 	 .path = _path,					\
33*e3ec7017SPing-Ke Shih 	 .addr = _addr,					\
34*e3ec7017SPing-Ke Shih 	 .mask = _mask,					\
35*e3ec7017SPing-Ke Shih 	 .data = _data,}
36*e3ec7017SPing-Ke Shih 
37*e3ec7017SPing-Ke Shih #define DECL_RFK_WM(_addr, _mask, _data)	\
38*e3ec7017SPing-Ke Shih 	{.flag = RTW89_RFK_F_WM,		\
39*e3ec7017SPing-Ke Shih 	 .addr = _addr,				\
40*e3ec7017SPing-Ke Shih 	 .mask = _mask,				\
41*e3ec7017SPing-Ke Shih 	 .data = _data,}
42*e3ec7017SPing-Ke Shih 
43*e3ec7017SPing-Ke Shih #define DECL_RFK_WS(_addr, _mask)	\
44*e3ec7017SPing-Ke Shih 	{.flag = RTW89_RFK_F_WS,	\
45*e3ec7017SPing-Ke Shih 	 .addr = _addr,			\
46*e3ec7017SPing-Ke Shih 	 .mask = _mask,}
47*e3ec7017SPing-Ke Shih 
48*e3ec7017SPing-Ke Shih #define DECL_RFK_WC(_addr, _mask)	\
49*e3ec7017SPing-Ke Shih 	{.flag = RTW89_RFK_F_WC,	\
50*e3ec7017SPing-Ke Shih 	 .addr = _addr,			\
51*e3ec7017SPing-Ke Shih 	 .mask = _mask,}
52*e3ec7017SPing-Ke Shih 
53*e3ec7017SPing-Ke Shih #define DECL_RFK_DELAY(_data)		\
54*e3ec7017SPing-Ke Shih 	{.flag = RTW89_RFK_F_DELAY,	\
55*e3ec7017SPing-Ke Shih 	 .data = _data,}
56*e3ec7017SPing-Ke Shih 
57*e3ec7017SPing-Ke Shih extern const struct rtw89_rfk_tbl rtw8852a_tssi_sys_defs_tbl;
58*e3ec7017SPing-Ke Shih extern const struct rtw89_rfk_tbl rtw8852a_tssi_sys_defs_2g_tbl;
59*e3ec7017SPing-Ke Shih extern const struct rtw89_rfk_tbl rtw8852a_tssi_sys_defs_5g_tbl;
60*e3ec7017SPing-Ke Shih extern const struct rtw89_rfk_tbl rtw8852a_tssi_txpwr_ctrl_bb_defs_a_tbl;
61*e3ec7017SPing-Ke Shih extern const struct rtw89_rfk_tbl rtw8852a_tssi_txpwr_ctrl_bb_defs_b_tbl;
62*e3ec7017SPing-Ke Shih extern const struct rtw89_rfk_tbl rtw8852a_tssi_txpwr_ctrl_bb_defs_2g_tbl;
63*e3ec7017SPing-Ke Shih extern const struct rtw89_rfk_tbl rtw8852a_tssi_txpwr_ctrl_bb_defs_5g_tbl;
64*e3ec7017SPing-Ke Shih extern const struct rtw89_rfk_tbl rtw8852a_tssi_txpwr_ctrl_bb_he_tb_defs_a_tbl;
65*e3ec7017SPing-Ke Shih extern const struct rtw89_rfk_tbl rtw8852a_tssi_txpwr_ctrl_bb_he_tb_defs_b_tbl;
66*e3ec7017SPing-Ke Shih extern const struct rtw89_rfk_tbl rtw8852a_tssi_dck_defs_a_tbl;
67*e3ec7017SPing-Ke Shih extern const struct rtw89_rfk_tbl rtw8852a_tssi_dck_defs_b_tbl;
68*e3ec7017SPing-Ke Shih extern const struct rtw89_rfk_tbl rtw8852a_tssi_dac_gain_tbl_defs_a_tbl;
69*e3ec7017SPing-Ke Shih extern const struct rtw89_rfk_tbl rtw8852a_tssi_dac_gain_tbl_defs_b_tbl;
70*e3ec7017SPing-Ke Shih extern const struct rtw89_rfk_tbl rtw8852a_tssi_slope_cal_org_defs_a_tbl;
71*e3ec7017SPing-Ke Shih extern const struct rtw89_rfk_tbl rtw8852a_tssi_slope_cal_org_defs_b_tbl;
72*e3ec7017SPing-Ke Shih extern const struct rtw89_rfk_tbl rtw8852a_tssi_rf_gap_tbl_defs_a_tbl;
73*e3ec7017SPing-Ke Shih extern const struct rtw89_rfk_tbl rtw8852a_tssi_rf_gap_tbl_defs_b_tbl;
74*e3ec7017SPing-Ke Shih extern const struct rtw89_rfk_tbl rtw8852a_tssi_slope_defs_a_tbl;
75*e3ec7017SPing-Ke Shih extern const struct rtw89_rfk_tbl rtw8852a_tssi_slope_defs_b_tbl;
76*e3ec7017SPing-Ke Shih extern const struct rtw89_rfk_tbl rtw8852a_tssi_track_defs_a_tbl;
77*e3ec7017SPing-Ke Shih extern const struct rtw89_rfk_tbl rtw8852a_tssi_track_defs_b_tbl;
78*e3ec7017SPing-Ke Shih extern const struct rtw89_rfk_tbl rtw8852a_tssi_txagc_ofst_mv_avg_defs_a_tbl;
79*e3ec7017SPing-Ke Shih extern const struct rtw89_rfk_tbl rtw8852a_tssi_txagc_ofst_mv_avg_defs_b_tbl;
80*e3ec7017SPing-Ke Shih extern const struct rtw89_rfk_tbl rtw8852a_tssi_pak_defs_a_2g_tbl;
81*e3ec7017SPing-Ke Shih extern const struct rtw89_rfk_tbl rtw8852a_tssi_pak_defs_a_5g_1_tbl;
82*e3ec7017SPing-Ke Shih extern const struct rtw89_rfk_tbl rtw8852a_tssi_pak_defs_a_5g_3_tbl;
83*e3ec7017SPing-Ke Shih extern const struct rtw89_rfk_tbl rtw8852a_tssi_pak_defs_a_5g_4_tbl;
84*e3ec7017SPing-Ke Shih extern const struct rtw89_rfk_tbl rtw8852a_tssi_pak_defs_b_2g_tbl;
85*e3ec7017SPing-Ke Shih extern const struct rtw89_rfk_tbl rtw8852a_tssi_pak_defs_b_5g_1_tbl;
86*e3ec7017SPing-Ke Shih extern const struct rtw89_rfk_tbl rtw8852a_tssi_pak_defs_b_5g_3_tbl;
87*e3ec7017SPing-Ke Shih extern const struct rtw89_rfk_tbl rtw8852a_tssi_pak_defs_b_5g_4_tbl;
88*e3ec7017SPing-Ke Shih extern const struct rtw89_rfk_tbl rtw8852a_tssi_enable_defs_a_tbl;
89*e3ec7017SPing-Ke Shih extern const struct rtw89_rfk_tbl rtw8852a_tssi_enable_defs_b_tbl;
90*e3ec7017SPing-Ke Shih extern const struct rtw89_rfk_tbl rtw8852a_tssi_enable_defs_ab_tbl;
91*e3ec7017SPing-Ke Shih extern const struct rtw89_rfk_tbl rtw8852a_tssi_disable_defs_tbl;
92*e3ec7017SPing-Ke Shih extern const struct rtw89_rfk_tbl rtw8852a_tssi_tracking_defs_tbl;
93*e3ec7017SPing-Ke Shih 
94*e3ec7017SPing-Ke Shih extern const struct rtw89_rfk_tbl rtw8852a_rfk_afe_init_defs_tbl;
95*e3ec7017SPing-Ke Shih extern const struct rtw89_rfk_tbl rtw8852a_rfk_dack_reload_defs_a_tbl;
96*e3ec7017SPing-Ke Shih extern const struct rtw89_rfk_tbl rtw8852a_rfk_dack_reload_defs_b_tbl;
97*e3ec7017SPing-Ke Shih extern const struct rtw89_rfk_tbl rtw8852a_rfk_check_addc_defs_a_tbl;
98*e3ec7017SPing-Ke Shih extern const struct rtw89_rfk_tbl rtw8852a_rfk_check_addc_defs_b_tbl;
99*e3ec7017SPing-Ke Shih extern const struct rtw89_rfk_tbl rtw8852a_rfk_addck_reset_defs_a_tbl;
100*e3ec7017SPing-Ke Shih extern const struct rtw89_rfk_tbl rtw8852a_rfk_addck_trigger_defs_a_tbl;
101*e3ec7017SPing-Ke Shih extern const struct rtw89_rfk_tbl rtw8852a_rfk_addck_restore_defs_a_tbl;
102*e3ec7017SPing-Ke Shih extern const struct rtw89_rfk_tbl rtw8852a_rfk_addck_reset_defs_b_tbl;
103*e3ec7017SPing-Ke Shih extern const struct rtw89_rfk_tbl rtw8852a_rfk_addck_trigger_defs_b_tbl;
104*e3ec7017SPing-Ke Shih extern const struct rtw89_rfk_tbl rtw8852a_rfk_addck_restore_defs_b_tbl;
105*e3ec7017SPing-Ke Shih extern const struct rtw89_rfk_tbl rtw8852a_rfk_check_dadc_defs_f_a_tbl;
106*e3ec7017SPing-Ke Shih extern const struct rtw89_rfk_tbl rtw8852a_rfk_check_dadc_defs_f_b_tbl;
107*e3ec7017SPing-Ke Shih extern const struct rtw89_rfk_tbl rtw8852a_rfk_check_dadc_defs_r_a_tbl;
108*e3ec7017SPing-Ke Shih extern const struct rtw89_rfk_tbl rtw8852a_rfk_check_dadc_defs_r_b_tbl;
109*e3ec7017SPing-Ke Shih extern const struct rtw89_rfk_tbl rtw8852a_rfk_dack_defs_f_a_tbl;
110*e3ec7017SPing-Ke Shih extern const struct rtw89_rfk_tbl rtw8852a_rfk_dack_defs_m_a_tbl;
111*e3ec7017SPing-Ke Shih extern const struct rtw89_rfk_tbl rtw8852a_rfk_dack_defs_r_a_tbl;
112*e3ec7017SPing-Ke Shih extern const struct rtw89_rfk_tbl rtw8852a_rfk_dack_defs_f_b_tbl;
113*e3ec7017SPing-Ke Shih extern const struct rtw89_rfk_tbl rtw8852a_rfk_dack_defs_m_b_tbl;
114*e3ec7017SPing-Ke Shih extern const struct rtw89_rfk_tbl rtw8852a_rfk_dack_defs_r_b_tbl;
115*e3ec7017SPing-Ke Shih extern const struct rtw89_rfk_tbl rtw8852a_rfk_dpk_bb_afe_sf_defs_a_tbl;
116*e3ec7017SPing-Ke Shih extern const struct rtw89_rfk_tbl rtw8852a_rfk_dpk_bb_afe_sr_defs_a_tbl;
117*e3ec7017SPing-Ke Shih extern const struct rtw89_rfk_tbl rtw8852a_rfk_dpk_bb_afe_sf_defs_b_tbl;
118*e3ec7017SPing-Ke Shih extern const struct rtw89_rfk_tbl rtw8852a_rfk_dpk_bb_afe_sr_defs_b_tbl;
119*e3ec7017SPing-Ke Shih extern const struct rtw89_rfk_tbl rtw8852a_rfk_dpk_bb_afe_s_defs_ab_tbl;
120*e3ec7017SPing-Ke Shih extern const struct rtw89_rfk_tbl rtw8852a_rfk_dpk_bb_afe_r_defs_a_tbl;
121*e3ec7017SPing-Ke Shih extern const struct rtw89_rfk_tbl rtw8852a_rfk_dpk_bb_afe_r_defs_b_tbl;
122*e3ec7017SPing-Ke Shih extern const struct rtw89_rfk_tbl rtw8852a_rfk_dpk_bb_afe_r_defs_ab_tbl;
123*e3ec7017SPing-Ke Shih extern const struct rtw89_rfk_tbl rtw8852a_rfk_dpk_lbk_rxiqk_defs_f_tbl;
124*e3ec7017SPing-Ke Shih extern const struct rtw89_rfk_tbl rtw8852a_rfk_dpk_lbk_rxiqk_defs_r_tbl;
125*e3ec7017SPing-Ke Shih extern const struct rtw89_rfk_tbl rtw8852a_rfk_dpk_pas_read_defs_tbl;
126*e3ec7017SPing-Ke Shih extern const struct rtw89_rfk_tbl rtw8852a_rfk_iqk_set_defs_nondbcc_path01_tbl;
127*e3ec7017SPing-Ke Shih extern const struct rtw89_rfk_tbl rtw8852a_rfk_iqk_set_defs_dbcc_path0_tbl;
128*e3ec7017SPing-Ke Shih extern const struct rtw89_rfk_tbl rtw8852a_rfk_iqk_set_defs_dbcc_path1_tbl;
129*e3ec7017SPing-Ke Shih extern const struct rtw89_rfk_tbl rtw8852a_rfk_iqk_restore_defs_nondbcc_path01_tbl;
130*e3ec7017SPing-Ke Shih extern const struct rtw89_rfk_tbl rtw8852a_rfk_iqk_restore_defs_dbcc_path0_tbl;
131*e3ec7017SPing-Ke Shih extern const struct rtw89_rfk_tbl rtw8852a_rfk_iqk_restore_defs_dbcc_path1_tbl;
132*e3ec7017SPing-Ke Shih 
133*e3ec7017SPing-Ke Shih #endif
134