1 /* SPDX-License-Identifier: GPL-2.0 */
2 /******************************************************************************
4 * Copyright(c) 2007 - 2016 Realtek Corporation.
7 * wlanfae <wlanfae@realtek.com>
8 * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park,
11 * Larry Finger <Larry.Finger@lwfinger.net>
13 *****************************************************************************/
15 #ifndef __HAL_PHY_RF_H__
16 #define __HAL_PHY_RF_H__
18 #include "phydm_kfree.h"
20 #include "rtl8822b/phydm_iqk_8822b.h"
22 #include "phydm_powertracking_ce.h"
24 enum spur_cal_method { PLL_RESET, AFE_PHASE_SEL };
26 enum pwrtrack_method {
35 typedef void (*func_set_pwr)(void *, enum pwrtrack_method, u8, u8);
36 typedef void (*func_iqk)(void *, u8, u8, u8);
37 typedef void (*func_lck)(void *);
38 typedef void (*func_swing)(void *, u8 **, u8 **, u8 **, u8 **);
39 typedef void (*func_swing8814only)(void *, u8 **, u8 **, u8 **, u8 **);
40 typedef void (*func_swing_xtal)(void *, s8 **, s8 **);
41 typedef void (*func_set_xtal)(void *);
43 struct txpwrtrack_cfg {
44 u8 swing_table_size_cck;
45 u8 swing_table_size_ofdm;
48 u8 average_thermal_num;
51 func_set_pwr odm_tx_pwr_track_set_pwr;
53 func_lck phy_lc_calibrate;
54 func_swing get_delta_swing_table;
55 func_swing8814only get_delta_swing_table8814only;
56 func_swing_xtal get_delta_swing_xtal_table;
57 func_set_xtal odm_txxtaltrack_set_xtal;
60 void configure_txpower_track(void *dm_void, struct txpwrtrack_cfg *config);
62 void odm_clear_txpowertracking_state(void *dm_void);
64 void odm_txpowertracking_callback_thermal_meter(void *dm);
66 #define ODM_TARGET_CHNL_NUM_2G_5G 59
68 void odm_reset_iqk_result(void *dm_void);
69 u8 odm_get_right_chnl_place_for_iqk(u8 chnl);
71 void phydm_rf_init(void *dm_void);
72 void phydm_rf_watchdog(void *dm_void);
74 #endif /* #ifndef __HAL_PHY_RF_H__ */