xref: /OK3568_Linux_fs/external/rkwifibt/drivers/rtl8723ds/hal/phydm/halrf/rtl8723d/halrf_8723d.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1 /******************************************************************************
2  *
3  * Copyright(c) 2007 - 2017 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  *****************************************************************************/
15 
16 #ifndef __HALRF_8723D_H__
17 #define __HALRF_8723D_H__
18 
19 /*--------------------------Define Parameters-------------------------------*/
20 #define IQK_DELAY_TIME_8723D 10 /* ms */
21 #define index_mapping_NUM_8723D 15
22 #define AVG_THERMAL_NUM_8723D 4
23 #define RF_T_METER_8723D 0x42
24 
25 void configure_txpower_track_8723d(struct txpwrtrack_cfg *config);
26 
27 void get_delta_swing_table_8723d(void *dm_void, u8 **temperature_up_a,
28 				 u8 **temperature_down_a, u8 **temperature_up_b,
29 				 u8 **temperature_down_b);
30 
31 void set_cck_filter_coefficient_8723d(struct dm_struct *dm, u8 cck_swing_index);
32 
33 void do_iqk_8723d(void *dm_void, u8 delta_thermal_index, u8 thermal_value,
34 		  u8 threshold);
35 
36 void odm_tx_pwr_track_set_pwr_8723d(void *dm_void, enum pwrtrack_method method,
37 				    u8 rf_path, u8 channel_mapped_index);
38 
39 void odm_txxtaltrack_set_xtal_8723d(void *dm_void);
40 
41 /* 1 7.	IQK */
42 
43 void phy_iq_calibrate_8723d(void *dm_void, boolean is_recovery);
44 
45 /*
46  * LC calibrate
47  */
48 void phy_lc_calibrate_8723d(void *dm_void);
49 
50 
51 #if ((DM_ODM_SUPPORT_TYPE & ODM_AP) || (DM_ODM_SUPPORT_TYPE == ODM_CE))
52 void phy_set_rf_path_switch_8723d(struct dm_struct *dm,
53 #else
54 void phy_set_rf_path_switch_8723d(void *adapter,
55 #endif
56 				  boolean is_main);
57 
58 #if 0
59 /*
60  * AP calibrate
61  */
62 void
63 phy_ap_calibrate_8723d(
64 #if (DM_ODM_SUPPORT_TYPE & ODM_AP)
65 	struct dm_struct		*dm,
66 #else
67 	void	*adapter,
68 #endif
69 	s8		delta);
70 void
71 phy_digital_predistortion_8723d(void	*adapter);
72 #endif
73 
74 void _phy_save_adda_registers_8723d(struct dm_struct *dm, u32 *adda_reg,
75 				    u32 *adda_backup, u32 register_num);
76 
77 void _phy_path_adda_on_8723d(struct dm_struct *dm, u32 *adda_reg,
78 			     boolean is_path_a_on, boolean is2T);
79 
80 void _phy_mac_setting_calibration_8723d(struct dm_struct *dm, u32 *mac_reg,
81 					u32 *mac_backup);
82 
83 #endif /*#ifndef __HALRF_8723D_H__*/
84