1 /* SPDX-License-Identifier: GPL-2.0 */
2 /******************************************************************************
3  *
4  * Copyright(c) 2007 - 2017 Realtek Corporation.
5  *
6  * This program is free software; you can redistribute it and/or modify it
7  * under the terms of version 2 of the GNU General Public License as
8  * published by the Free Software Foundation.
9  *
10  * This program is distributed in the hope that it will be useful, but WITHOUT
11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13  * more details.
14  *
15  *****************************************************************************/
16 
17 #ifndef __HALRF_8188E_H__
18 #define __HALRF_8188E_H__
19 
20 /*--------------------------Define Parameters-------------------------------*/
21 #define	IQK_DELAY_TIME_88E		15		/* ms */
22 #define	IQK_DELAY_TIME_8723B		10		/* ms */
23 
24 #define	index_mapping_NUM_88E	15
25 #define AVG_THERMAL_NUM_88E	4
26 
27 #include "halrf/halphyrf_win.h"
28 
29 void configure_txpower_track_8188e(
30 	struct txpwrtrack_cfg	*config
31 );
32 
33 void
34 get_delta_swing_table_8188e(
35 	void		*dm_void,
36 	u8 **temperature_up_a,
37 	u8 **temperature_down_a,
38 	u8 **temperature_up_b,
39 	u8 **temperature_down_b
40 );
41 
42 void do_iqk_8188e(
43 	void		*dm_void,
44 	u8		delta_thermal_index,
45 	u8		thermal_value,
46 	u8		threshold
47 );
48 
49 void
50 odm_tx_pwr_track_set_pwr88_e(
51 	void				*dm_void,
52 	enum pwrtrack_method	method,
53 	u8				rf_path,
54 	u8				channel_mapped_index
55 );
56 
57 /* 1 7.	IQK */
58 
59 void
60 phy_iq_calibrate_8188e(
61 	void		*dm_void,
62 	boolean	is_recovery);
63 
64 
65 /*
66  * LC calibrate
67  *   */
68 void
69 phy_lc_calibrate_8188e(
70 	void				*dm_void
71 );
72 
73 /*
74  * AP calibrate
75  *   */
76 #if 0
77 void
78 phy_ap_calibrate_8188e(
79 #if (DM_ODM_SUPPORT_TYPE & ODM_AP)
80 	struct dm_struct		*dm,
81 #else
82 	void	*adapter,
83 #endif
84 	s8		delta);
85 void
86 phy_digital_predistortion_8188e(void	*adapter);
87 
88 #endif
89 
90 #define phy_dp_calibrate_8821a	phy_dp_calibrate_8812a
91 
92 void
93 _phy_save_adda_registers(
94 	struct dm_struct		*dm,
95 	u32		*adda_reg,
96 	u32		*adda_backup,
97 	u32		register_num
98 );
99 
100 void
101 _phy_path_adda_on(
102 	struct dm_struct		*dm,
103 	u32		*adda_reg,
104 	boolean		is_path_a_on,
105 	boolean		is2T
106 );
107 
108 void
109 _phy_mac_setting_calibration(
110 	struct dm_struct		*dm,
111 	u32		*mac_reg,
112 	u32		*mac_backup
113 );
114 
115 
116 void
117 _phy_path_a_stand_by(
118 	struct dm_struct		*dm
119 );
120 
121 
122 void phy_set_rf_path_switch_8188e(
123 #if (DM_ODM_SUPPORT_TYPE & ODM_AP)
124 	struct dm_struct		*dm,
125 #else
126 	void	*adapter,
127 #endif
128 	boolean		is_main
129 );
130 
131 void
132 halrf_rf_lna_setting_8188e(
133 	struct dm_struct	*dm,
134 	enum halrf_lna_set type
135 );
136 
137 #endif	/*#ifndef __HALRF_8188E_H__*/
138