net: wireless: rockchip_wlan: add rtl8723cs support
[firefly-linux-kernel-4.4.55.git] / drivers / net / wireless / rockchip_wlan / rtl8723cs / hal / phydm / rtl8703b / halphyrf_8703b.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_8703B_H__
22 #define __HAL_PHY_RF_8703B_H__
23
24 /*--------------------------Define Parameters-------------------------------*/
25 #define index_mapping_NUM_8703B         15
26 #define AVG_THERMAL_NUM_8703B           4
27 #define RF_T_METER_8703B                0x42
28
29 #if (DM_ODM_SUPPORT_TYPE & (ODM_WIN))
30         #include "../halphyrf_win.h"
31 #elif (DM_ODM_SUPPORT_TYPE & (ODM_CE))
32         #include "../halphyrf_ce.h"
33 #endif
34
35 void configure_txpower_track_8703b(
36         struct _TXPWRTRACK_CFG  *p_config
37 );
38
39 void do_iqk_8703b(
40         void            *p_dm_void,
41         u8              delta_thermal_index,
42         u8              thermal_value,
43         u8              threshold
44 );
45
46 void
47 odm_tx_pwr_track_set_pwr_8703b(
48         void            *p_dm_void,
49         enum pwrtrack_method    method,
50         u8                              rf_path,
51         u8                              channel_mapped_index
52 );
53
54 void
55 odm_txxtaltrack_set_xtal_8703b(
56         void            *p_dm_void
57 );
58
59
60 /* 1 7. IQK */
61
62 void
63 phy_iq_calibrate_8703b(
64 #if (DM_ODM_SUPPORT_TYPE & ODM_AP)
65         struct PHY_DM_STRUCT            *p_dm_odm,
66 #else
67         struct _ADAPTER *adapter,
68 #endif
69         boolean is_recovery);
70
71 boolean
72 odm_set_iqc_by_rfpath_8703b(
73         struct PHY_DM_STRUCT            *p_dm_odm
74 );
75
76 /*
77  * LC calibrate
78  *   */
79 void
80 phy_lc_calibrate_8703b(
81         void            *p_dm_void
82 );
83
84 /*
85  * AP calibrate
86  *   */
87 void
88 phy_ap_calibrate_8703b(
89 #if (DM_ODM_SUPPORT_TYPE & ODM_AP)
90         struct PHY_DM_STRUCT            *p_dm_odm,
91 #else
92         struct _ADAPTER *p_adapter,
93 #endif
94         s8              delta);
95 void
96 phy_digital_predistortion_8703b(struct _ADAPTER *p_adapter);
97
98
99 void
100 _phy_save_adda_registers_8703b(
101 #if (DM_ODM_SUPPORT_TYPE & ODM_AP)
102         struct PHY_DM_STRUCT            *p_dm_odm,
103 #else
104         struct _ADAPTER *p_adapter,
105 #endif
106         u32             *adda_reg,
107         u32             *adda_backup,
108         u32             register_num
109 );
110
111 void
112 _phy_path_adda_on_8703b(
113 #if (DM_ODM_SUPPORT_TYPE & ODM_AP)
114         struct PHY_DM_STRUCT            *p_dm_odm,
115 #else
116         struct _ADAPTER *p_adapter,
117 #endif
118         u32             *adda_reg,
119         boolean         is_path_a_on,
120         boolean         is2T
121 );
122
123 void
124 _phy_mac_setting_calibration_8703b(
125 #if (DM_ODM_SUPPORT_TYPE & ODM_AP)
126         struct PHY_DM_STRUCT            *p_dm_odm,
127 #else
128         struct _ADAPTER *p_adapter,
129 #endif
130         u32             *mac_reg,
131         u32             *mac_backup
132 );
133
134 #endif  /*  #ifndef __HAL_PHY_RF_8188E_H__ */