1 /******************************************************************************
3 * Copyright(c) 2007 - 2016 Realtek Corporation.
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.
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
14 * The full GNU General Public License is included in this distribution in the
15 * file called LICENSE.
17 * Contact Information:
18 * wlanfae <wlanfae@realtek.com>
19 * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park,
20 * Hsinchu 300, Taiwan.
22 * Larry Finger <Larry.Finger@lwfinger.net>
24 *****************************************************************************/
26 #ifndef __HAL_PHY_RF_H__
27 #define __HAL_PHY_RF_H__
29 #include "phydm_kfree.h"
31 #include "rtl8822b/phydm_iqk_8822b.h"
33 #include "phydm_powertracking_ce.h"
35 enum spur_cal_method { PLL_RESET, AFE_PHASE_SEL };
37 enum pwrtrack_method {
46 typedef void (*func_set_pwr)(void *, enum pwrtrack_method, u8, u8);
47 typedef void (*func_iqk)(void *, u8, u8, u8);
48 typedef void (*func_lck)(void *);
49 typedef void (*func_swing)(void *, u8 **, u8 **, u8 **, u8 **);
50 typedef void (*func_swing8814only)(void *, u8 **, u8 **, u8 **, u8 **);
51 typedef void (*func_swing_xtal)(void *, s8 **, s8 **);
52 typedef void (*func_set_xtal)(void *);
54 struct txpwrtrack_cfg {
55 u8 swing_table_size_cck;
56 u8 swing_table_size_ofdm;
59 u8 average_thermal_num;
62 func_set_pwr odm_tx_pwr_track_set_pwr;
64 func_lck phy_lc_calibrate;
65 func_swing get_delta_swing_table;
66 func_swing8814only get_delta_swing_table8814only;
67 func_swing_xtal get_delta_swing_xtal_table;
68 func_set_xtal odm_txxtaltrack_set_xtal;
71 void configure_txpower_track(void *dm_void, struct txpwrtrack_cfg *config);
73 void odm_clear_txpowertracking_state(void *dm_void);
75 void odm_txpowertracking_callback_thermal_meter(void *dm);
77 #define ODM_TARGET_CHNL_NUM_2G_5G 59
79 void odm_reset_iqk_result(void *dm_void);
80 u8 odm_get_right_chnl_place_for_iqk(u8 chnl);
82 void phydm_rf_init(void *dm_void);
83 void phydm_rf_watchdog(void *dm_void);
85 #endif /* #ifndef __HAL_PHY_RF_H__ */