net: wireless: rockchip_wlan: add rtl8723cs support
[firefly-linux-kernel-4.4.55.git] / drivers / net / wireless / rockchip_wlan / rtl8723cs / hal / phydm / halphyrf_ce.h
1 /******************************************************************************
2  *
3  * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
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  *
19  ******************************************************************************/
20
21 #ifndef __HAL_PHY_RF_H__
22 #define __HAL_PHY_RF_H__
23
24 #include "phydm_kfree.h"
25 #if (RTL8814A_SUPPORT == 1)
26         #include "rtl8814a/phydm_iqk_8814a.h"
27 #endif
28
29 #if (RTL8822B_SUPPORT == 1)
30         #include "rtl8822b/phydm_iqk_8822b.h"
31 #endif
32
33 #if (RTL8821C_SUPPORT == 1)
34         #include "rtl8821c/phydm_iqk_8821c.h"
35 #endif
36
37 #include "phydm_powertracking_ce.h"
38
39
40 enum spur_cal_method {
41         PLL_RESET,
42         AFE_PHASE_SEL
43 };
44
45 enum pwrtrack_method {
46         BBSWING,
47         TXAGC,
48         MIX_MODE,
49         TSSI_MODE,
50         MIX_2G_TSSI_5G_MODE,
51         MIX_5G_TSSI_2G_MODE
52 };
53
54 typedef void    (*func_set_pwr)(void *, enum pwrtrack_method, u8, u8);
55 typedef void(*func_iqk)(void *, u8, u8, u8);
56 typedef void    (*func_lck)(void *);
57 typedef void    (*func_swing)(void *, u8 **, u8 **, u8 **, u8 **);
58 typedef void    (*func_swing8814only)(void *, u8 **, u8 **, u8 **, u8 **);
59 typedef void(*func_swing_xtal)(void *, s8 **, s8 **);
60 typedef void(*func_set_xtal)(void *);
61
62 struct _TXPWRTRACK_CFG {
63         u8              swing_table_size_cck;
64         u8              swing_table_size_ofdm;
65         u8              threshold_iqk;
66         u8              threshold_dpk;
67         u8              average_thermal_num;
68         u8              rf_path_count;
69         u32             thermal_reg_addr;
70         func_set_pwr    odm_tx_pwr_track_set_pwr;
71         func_iqk        do_iqk;
72         func_lck                phy_lc_calibrate;
73         func_swing      get_delta_swing_table;
74         func_swing8814only      get_delta_swing_table8814only;
75         func_swing_xtal                 get_delta_swing_xtal_table;
76         func_set_xtal                   odm_txxtaltrack_set_xtal;
77 };
78
79 void
80 configure_txpower_track(
81         void                                    *p_dm_void,
82         struct _TXPWRTRACK_CFG  *p_config
83 );
84
85
86 void
87 odm_clear_txpowertracking_state(
88         void                                    *p_dm_void
89 );
90
91 void
92 odm_txpowertracking_callback_thermal_meter(
93 #if (DM_ODM_SUPPORT_TYPE & ODM_AP)
94         void                                    *p_dm_void
95 #else
96         struct _ADAPTER *adapter
97 #endif
98 );
99
100
101
102 #define ODM_TARGET_CHNL_NUM_2G_5G       59
103
104
105 void
106 odm_reset_iqk_result(
107         void                                    *p_dm_void
108 );
109 u8
110 odm_get_right_chnl_place_for_iqk(
111         u8 chnl
112 );
113
114 void phydm_rf_init(void                                 *p_dm_void);
115 void phydm_rf_watchdog(void                                     *p_dm_void);
116
117 #endif  /*  #ifndef __HAL_PHY_RF_H__ */