Lines Matching refs:hw

37 static void _rtl8723e_phy_fw_rf_serial_write(struct ieee80211_hw *hw,
40 static bool _rtl8723e_phy_bb8192c_config_parafile(struct ieee80211_hw *hw);
41 static bool _rtl8723e_phy_config_mac_with_headerfile(struct ieee80211_hw *hw);
42 static bool _rtl8723e_phy_config_bb_with_headerfile(struct ieee80211_hw *hw,
44 static bool _rtl8723e_phy_config_bb_with_pgheaderfile(struct ieee80211_hw *hw,
46 static bool _rtl8723e_phy_sw_chnl_step_by_step(struct ieee80211_hw *hw,
49 static u8 _rtl8723e_phy_dbm_to_txpwr_idx(struct ieee80211_hw *hw,
52 static void rtl8723e_phy_set_rf_on(struct ieee80211_hw *hw);
53 static void rtl8723e_phy_set_io(struct ieee80211_hw *hw);
55 u32 rtl8723e_phy_query_rf_reg(struct ieee80211_hw *hw, in rtl8723e_phy_query_rf_reg() argument
59 struct rtl_priv *rtlpriv = rtl_priv(hw); in rtl8723e_phy_query_rf_reg()
71 original_value = rtl8723_phy_rf_serial_read(hw, in rtl8723e_phy_query_rf_reg()
87 void rtl8723e_phy_set_rf_reg(struct ieee80211_hw *hw, in rtl8723e_phy_set_rf_reg() argument
91 struct rtl_priv *rtlpriv = rtl_priv(hw); in rtl8723e_phy_set_rf_reg()
104 original_value = rtl8723_phy_rf_serial_read(hw, in rtl8723e_phy_set_rf_reg()
113 rtl8723_phy_rf_serial_write(hw, rfpath, regaddr, data); in rtl8723e_phy_set_rf_reg()
121 _rtl8723e_phy_fw_rf_serial_write(hw, rfpath, regaddr, data); in rtl8723e_phy_set_rf_reg()
132 static void _rtl8723e_phy_fw_rf_serial_write(struct ieee80211_hw *hw, in _rtl8723e_phy_fw_rf_serial_write() argument
139 static void _rtl8723e_phy_bb_config_1t(struct ieee80211_hw *hw) in _rtl8723e_phy_bb_config_1t() argument
141 rtl_set_bbreg(hw, RFPGA0_TXINFO, 0x3, 0x2); in _rtl8723e_phy_bb_config_1t()
142 rtl_set_bbreg(hw, RFPGA1_TXINFO, 0x300033, 0x200022); in _rtl8723e_phy_bb_config_1t()
143 rtl_set_bbreg(hw, RCCK0_AFESETTING, MASKBYTE3, 0x45); in _rtl8723e_phy_bb_config_1t()
144 rtl_set_bbreg(hw, ROFDM0_TRXPATHENABLE, MASKBYTE0, 0x23); in _rtl8723e_phy_bb_config_1t()
145 rtl_set_bbreg(hw, ROFDM0_AGCPARAMETER1, 0x30, 0x1); in _rtl8723e_phy_bb_config_1t()
146 rtl_set_bbreg(hw, 0xe74, 0x0c000000, 0x2); in _rtl8723e_phy_bb_config_1t()
147 rtl_set_bbreg(hw, 0xe78, 0x0c000000, 0x2); in _rtl8723e_phy_bb_config_1t()
148 rtl_set_bbreg(hw, 0xe7c, 0x0c000000, 0x2); in _rtl8723e_phy_bb_config_1t()
149 rtl_set_bbreg(hw, 0xe80, 0x0c000000, 0x2); in _rtl8723e_phy_bb_config_1t()
150 rtl_set_bbreg(hw, 0xe88, 0x0c000000, 0x2); in _rtl8723e_phy_bb_config_1t()
153 bool rtl8723e_phy_mac_config(struct ieee80211_hw *hw) in rtl8723e_phy_mac_config() argument
155 struct rtl_priv *rtlpriv = rtl_priv(hw); in rtl8723e_phy_mac_config()
156 bool rtstatus = _rtl8723e_phy_config_mac_with_headerfile(hw); in rtl8723e_phy_mac_config()
161 bool rtl8723e_phy_bb_config(struct ieee80211_hw *hw) in rtl8723e_phy_bb_config() argument
164 struct rtl_priv *rtlpriv = rtl_priv(hw); in rtl8723e_phy_bb_config()
168 rtl8723_phy_init_bb_rf_reg_def(hw); in rtl8723e_phy_bb_config()
196 rtstatus = _rtl8723e_phy_bb8192c_config_parafile(hw); in rtl8723e_phy_bb_config()
200 bool rtl8723e_phy_rf_config(struct ieee80211_hw *hw) in rtl8723e_phy_rf_config() argument
202 return rtl8723e_phy_rf6052_config(hw); in rtl8723e_phy_rf_config()
205 static bool _rtl8723e_phy_bb8192c_config_parafile(struct ieee80211_hw *hw) in _rtl8723e_phy_bb8192c_config_parafile() argument
207 struct rtl_priv *rtlpriv = rtl_priv(hw); in _rtl8723e_phy_bb8192c_config_parafile()
209 struct rtl_efuse *rtlefuse = rtl_efuse(rtl_priv(hw)); in _rtl8723e_phy_bb8192c_config_parafile()
213 rtstatus = _rtl8723e_phy_config_bb_with_headerfile(hw, in _rtl8723e_phy_bb8192c_config_parafile()
221 _rtl8723e_phy_bb_config_1t(hw); in _rtl8723e_phy_bb8192c_config_parafile()
226 rtstatus = _rtl8723e_phy_config_bb_with_pgheaderfile(hw, in _rtl8723e_phy_bb8192c_config_parafile()
234 _rtl8723e_phy_config_bb_with_headerfile(hw, BASEBAND_CONFIG_AGC_TAB); in _rtl8723e_phy_bb8192c_config_parafile()
239 rtlphy->cck_high_power = (bool) (rtl_get_bbreg(hw, in _rtl8723e_phy_bb8192c_config_parafile()
246 static bool _rtl8723e_phy_config_mac_with_headerfile(struct ieee80211_hw *hw) in _rtl8723e_phy_config_mac_with_headerfile() argument
248 struct rtl_priv *rtlpriv = rtl_priv(hw); in _rtl8723e_phy_config_mac_with_headerfile()
264 static bool _rtl8723e_phy_config_bb_with_headerfile(struct ieee80211_hw *hw, in _rtl8723e_phy_config_bb_with_headerfile() argument
271 struct rtl_priv *rtlpriv = rtl_priv(hw); in _rtl8723e_phy_config_bb_with_headerfile()
291 rtl_set_bbreg(hw, phy_regarray_table[i], MASKDWORD, in _rtl8723e_phy_config_bb_with_headerfile()
301 rtl_set_bbreg(hw, agctab_array_table[i], MASKDWORD, in _rtl8723e_phy_config_bb_with_headerfile()
313 static void store_pwrindex_diffrate_offset(struct ieee80211_hw *hw, in store_pwrindex_diffrate_offset() argument
317 struct rtl_priv *rtlpriv = rtl_priv(hw); in store_pwrindex_diffrate_offset()
468 static bool _rtl8723e_phy_config_bb_with_pgheaderfile(struct ieee80211_hw *hw, in _rtl8723e_phy_config_bb_with_pgheaderfile() argument
471 struct rtl_priv *rtlpriv = rtl_priv(hw); in _rtl8723e_phy_config_bb_with_pgheaderfile()
494 store_pwrindex_diffrate_offset(hw, in _rtl8723e_phy_config_bb_with_pgheaderfile()
506 bool rtl8723e_phy_config_rf_with_headerfile(struct ieee80211_hw *hw, in rtl8723e_phy_config_rf_with_headerfile() argument
538 rtl_set_rfreg(hw, rfpath, radioa_array_table[i], in rtl8723e_phy_config_rf_with_headerfile()
553 void rtl8723e_phy_get_hw_reg_originalvalue(struct ieee80211_hw *hw) in rtl8723e_phy_get_hw_reg_originalvalue() argument
555 struct rtl_priv *rtlpriv = rtl_priv(hw); in rtl8723e_phy_get_hw_reg_originalvalue()
559 (u8) rtl_get_bbreg(hw, ROFDM0_XAAGCCORE1, MASKBYTE0); in rtl8723e_phy_get_hw_reg_originalvalue()
561 (u8) rtl_get_bbreg(hw, ROFDM0_XBAGCCORE1, MASKBYTE0); in rtl8723e_phy_get_hw_reg_originalvalue()
563 (u8) rtl_get_bbreg(hw, ROFDM0_XCAGCCORE1, MASKBYTE0); in rtl8723e_phy_get_hw_reg_originalvalue()
565 (u8) rtl_get_bbreg(hw, ROFDM0_XDAGCCORE1, MASKBYTE0); in rtl8723e_phy_get_hw_reg_originalvalue()
574 rtlphy->framesync = (u8) rtl_get_bbreg(hw, in rtl8723e_phy_get_hw_reg_originalvalue()
576 rtlphy->framesync_c34 = rtl_get_bbreg(hw, in rtl8723e_phy_get_hw_reg_originalvalue()
584 void rtl8723e_phy_get_txpower_level(struct ieee80211_hw *hw, long *powerlevel) in rtl8723e_phy_get_txpower_level() argument
586 struct rtl_priv *rtlpriv = rtl_priv(hw); in rtl8723e_phy_get_txpower_level()
588 struct rtl_efuse *rtlefuse = rtl_efuse(rtl_priv(hw)); in rtl8723e_phy_get_txpower_level()
593 txpwr_dbm = rtl8723_phy_txpwr_idx_to_dbm(hw, in rtl8723e_phy_get_txpower_level()
597 if (rtl8723_phy_txpwr_idx_to_dbm(hw, in rtl8723e_phy_get_txpower_level()
601 rtl8723_phy_txpwr_idx_to_dbm(hw, WIRELESS_MODE_G, in rtl8723e_phy_get_txpower_level()
604 if (rtl8723_phy_txpwr_idx_to_dbm(hw, in rtl8723e_phy_get_txpower_level()
608 rtl8723_phy_txpwr_idx_to_dbm(hw, WIRELESS_MODE_N_24G, in rtl8723e_phy_get_txpower_level()
613 static void _rtl8723e_get_txpower_index(struct ieee80211_hw *hw, u8 channel, in _rtl8723e_get_txpower_index() argument
616 struct rtl_priv *rtlpriv = rtl_priv(hw); in _rtl8723e_get_txpower_index()
618 struct rtl_efuse *rtlefuse = rtl_efuse(rtl_priv(hw)); in _rtl8723e_get_txpower_index()
638 static void _rtl8723e_ccxpower_index_check(struct ieee80211_hw *hw, in _rtl8723e_ccxpower_index_check() argument
642 struct rtl_priv *rtlpriv = rtl_priv(hw); in _rtl8723e_ccxpower_index_check()
650 void rtl8723e_phy_set_txpower_level(struct ieee80211_hw *hw, u8 channel) in rtl8723e_phy_set_txpower_level() argument
652 struct rtl_efuse *rtlefuse = rtl_efuse(rtl_priv(hw)); in rtl8723e_phy_set_txpower_level()
657 _rtl8723e_get_txpower_index(hw, channel, in rtl8723e_phy_set_txpower_level()
659 _rtl8723e_ccxpower_index_check(hw, in rtl8723e_phy_set_txpower_level()
662 rtl8723e_phy_rf6052_set_cck_txpower(hw, &cckpowerlevel[0]); in rtl8723e_phy_set_txpower_level()
663 rtl8723e_phy_rf6052_set_ofdm_txpower(hw, &ofdmpowerlevel[0], channel); in rtl8723e_phy_set_txpower_level()
666 bool rtl8723e_phy_update_txpower_dbm(struct ieee80211_hw *hw, long power_indbm) in rtl8723e_phy_update_txpower_dbm() argument
668 struct rtl_priv *rtlpriv = rtl_priv(hw); in rtl8723e_phy_update_txpower_dbm()
670 struct rtl_efuse *rtlefuse = rtl_efuse(rtl_priv(hw)); in rtl8723e_phy_update_txpower_dbm()
673 u8 ccktxpwridx = _rtl8723e_phy_dbm_to_txpwr_idx(hw, in rtl8723e_phy_update_txpower_dbm()
676 u8 ofdmtxpwridx = _rtl8723e_phy_dbm_to_txpwr_idx(hw, in rtl8723e_phy_update_txpower_dbm()
695 rtl8723e_phy_set_txpower_level(hw, rtlphy->current_channel); in rtl8723e_phy_update_txpower_dbm()
699 static u8 _rtl8723e_phy_dbm_to_txpwr_idx(struct ieee80211_hw *hw, in _rtl8723e_phy_dbm_to_txpwr_idx() argument
730 void rtl8723e_phy_scan_operation_backup(struct ieee80211_hw *hw, u8 operation) in rtl8723e_phy_scan_operation_backup() argument
732 struct rtl_priv *rtlpriv = rtl_priv(hw); in rtl8723e_phy_scan_operation_backup()
733 struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw)); in rtl8723e_phy_scan_operation_backup()
740 rtlpriv->cfg->ops->set_hw_reg(hw, in rtl8723e_phy_scan_operation_backup()
747 rtlpriv->cfg->ops->set_hw_reg(hw, in rtl8723e_phy_scan_operation_backup()
759 void rtl8723e_phy_set_bw_mode_callback(struct ieee80211_hw *hw) in rtl8723e_phy_set_bw_mode_callback() argument
761 struct rtl_priv *rtlpriv = rtl_priv(hw); in rtl8723e_phy_set_bw_mode_callback()
762 struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw)); in rtl8723e_phy_set_bw_mode_callback()
764 struct rtl_mac *mac = rtl_mac(rtl_priv(hw)); in rtl8723e_phy_set_bw_mode_callback()
801 rtl_set_bbreg(hw, RFPGA0_RFMOD, BRFMOD, 0x0); in rtl8723e_phy_set_bw_mode_callback()
802 rtl_set_bbreg(hw, RFPGA1_RFMOD, BRFMOD, 0x0); in rtl8723e_phy_set_bw_mode_callback()
803 rtl_set_bbreg(hw, RFPGA0_ANALOGPARAMETER2, BIT(10), 1); in rtl8723e_phy_set_bw_mode_callback()
806 rtl_set_bbreg(hw, RFPGA0_RFMOD, BRFMOD, 0x1); in rtl8723e_phy_set_bw_mode_callback()
807 rtl_set_bbreg(hw, RFPGA1_RFMOD, BRFMOD, 0x1); in rtl8723e_phy_set_bw_mode_callback()
809 rtl_set_bbreg(hw, RCCK0_SYSTEM, BCCK_SIDEBAND, in rtl8723e_phy_set_bw_mode_callback()
811 rtl_set_bbreg(hw, ROFDM1_LSTF, 0xC00, mac->cur_40_prime_sc); in rtl8723e_phy_set_bw_mode_callback()
812 rtl_set_bbreg(hw, RFPGA0_ANALOGPARAMETER2, BIT(10), 0); in rtl8723e_phy_set_bw_mode_callback()
814 rtl_set_bbreg(hw, 0x818, (BIT(26) | BIT(27)), in rtl8723e_phy_set_bw_mode_callback()
823 rtl8723e_phy_rf6052_set_bandwidth(hw, rtlphy->current_chan_bw); in rtl8723e_phy_set_bw_mode_callback()
828 void rtl8723e_phy_set_bw_mode(struct ieee80211_hw *hw, in rtl8723e_phy_set_bw_mode() argument
831 struct rtl_priv *rtlpriv = rtl_priv(hw); in rtl8723e_phy_set_bw_mode()
833 struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw)); in rtl8723e_phy_set_bw_mode()
839 if ((!is_hal_stop(rtlhal)) && !(RT_CANNOT_IO(hw))) { in rtl8723e_phy_set_bw_mode()
840 rtl8723e_phy_set_bw_mode_callback(hw); in rtl8723e_phy_set_bw_mode()
849 void rtl8723e_phy_sw_chnl_callback(struct ieee80211_hw *hw) in rtl8723e_phy_sw_chnl_callback() argument
851 struct rtl_priv *rtlpriv = rtl_priv(hw); in rtl8723e_phy_sw_chnl_callback()
852 struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw)); in rtl8723e_phy_sw_chnl_callback()
864 (hw, rtlphy->current_channel, &rtlphy->sw_chnl_stage, in rtl8723e_phy_sw_chnl_callback()
878 u8 rtl8723e_phy_sw_chnl(struct ieee80211_hw *hw) in rtl8723e_phy_sw_chnl() argument
880 struct rtl_priv *rtlpriv = rtl_priv(hw); in rtl8723e_phy_sw_chnl()
882 struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw)); in rtl8723e_phy_sw_chnl()
893 if (!(is_hal_stop(rtlhal)) && !(RT_CANNOT_IO(hw))) { in rtl8723e_phy_sw_chnl()
894 rtl8723e_phy_sw_chnl_callback(hw); in rtl8723e_phy_sw_chnl()
906 static void _rtl8723e_phy_sw_rf_seting(struct ieee80211_hw *hw, u8 channel) in _rtl8723e_phy_sw_rf_seting() argument
908 struct rtl_priv *rtlpriv = rtl_priv(hw); in _rtl8723e_phy_sw_rf_seting()
910 struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw)); in _rtl8723e_phy_sw_rf_seting()
915 rtl_set_rfreg(hw, RF90_PATH_A, RF_RX_G1, in _rtl8723e_phy_sw_rf_seting()
918 u32 backuprf0x1a = (u32)rtl_get_rfreg(hw, in _rtl8723e_phy_sw_rf_seting()
921 rtl_set_rfreg(hw, RF90_PATH_A, RF_RX_G1, in _rtl8723e_phy_sw_rf_seting()
927 static bool _rtl8723e_phy_sw_chnl_step_by_step(struct ieee80211_hw *hw, in _rtl8723e_phy_sw_chnl_step_by_step() argument
931 struct rtl_priv *rtlpriv = rtl_priv(hw); in _rtl8723e_phy_sw_chnl_step_by_step()
997 rtl8723e_phy_set_txpower_level(hw, channel); in _rtl8723e_phy_sw_chnl_step_by_step()
1017 rtl_set_rfreg(hw, (enum radio_path)rfpath, in _rtl8723e_phy_sw_chnl_step_by_step()
1022 _rtl8723e_phy_sw_rf_seting(hw, channel); in _rtl8723e_phy_sw_chnl_step_by_step()
1038 static u8 _rtl8723e_phy_path_a_iqk(struct ieee80211_hw *hw, bool config_pathb) in _rtl8723e_phy_path_a_iqk() argument
1043 rtl_set_bbreg(hw, 0xe30, MASKDWORD, 0x10008c1f); in _rtl8723e_phy_path_a_iqk()
1044 rtl_set_bbreg(hw, 0xe34, MASKDWORD, 0x10008c1f); in _rtl8723e_phy_path_a_iqk()
1045 rtl_set_bbreg(hw, 0xe38, MASKDWORD, 0x82140102); in _rtl8723e_phy_path_a_iqk()
1046 rtl_set_bbreg(hw, 0xe3c, MASKDWORD, in _rtl8723e_phy_path_a_iqk()
1050 rtl_set_bbreg(hw, 0xe50, MASKDWORD, 0x10008c22); in _rtl8723e_phy_path_a_iqk()
1051 rtl_set_bbreg(hw, 0xe54, MASKDWORD, 0x10008c22); in _rtl8723e_phy_path_a_iqk()
1052 rtl_set_bbreg(hw, 0xe58, MASKDWORD, 0x82140102); in _rtl8723e_phy_path_a_iqk()
1053 rtl_set_bbreg(hw, 0xe5c, MASKDWORD, 0x28160202); in _rtl8723e_phy_path_a_iqk()
1056 rtl_set_bbreg(hw, 0xe4c, MASKDWORD, 0x001028d1); in _rtl8723e_phy_path_a_iqk()
1057 rtl_set_bbreg(hw, 0xe48, MASKDWORD, 0xf9000000); in _rtl8723e_phy_path_a_iqk()
1058 rtl_set_bbreg(hw, 0xe48, MASKDWORD, 0xf8000000); in _rtl8723e_phy_path_a_iqk()
1062 reg_eac = rtl_get_bbreg(hw, 0xeac, MASKDWORD); in _rtl8723e_phy_path_a_iqk()
1063 reg_e94 = rtl_get_bbreg(hw, 0xe94, MASKDWORD); in _rtl8723e_phy_path_a_iqk()
1064 reg_e9c = rtl_get_bbreg(hw, 0xe9c, MASKDWORD); in _rtl8723e_phy_path_a_iqk()
1065 reg_ea4 = rtl_get_bbreg(hw, 0xea4, MASKDWORD); in _rtl8723e_phy_path_a_iqk()
1081 static u8 _rtl8723e_phy_path_b_iqk(struct ieee80211_hw *hw) in _rtl8723e_phy_path_b_iqk() argument
1086 rtl_set_bbreg(hw, 0xe60, MASKDWORD, 0x00000002); in _rtl8723e_phy_path_b_iqk()
1087 rtl_set_bbreg(hw, 0xe60, MASKDWORD, 0x00000000); in _rtl8723e_phy_path_b_iqk()
1089 reg_eac = rtl_get_bbreg(hw, 0xeac, MASKDWORD); in _rtl8723e_phy_path_b_iqk()
1090 reg_eb4 = rtl_get_bbreg(hw, 0xeb4, MASKDWORD); in _rtl8723e_phy_path_b_iqk()
1091 reg_ebc = rtl_get_bbreg(hw, 0xebc, MASKDWORD); in _rtl8723e_phy_path_b_iqk()
1092 reg_ec4 = rtl_get_bbreg(hw, 0xec4, MASKDWORD); in _rtl8723e_phy_path_b_iqk()
1093 reg_ecc = rtl_get_bbreg(hw, 0xecc, MASKDWORD); in _rtl8723e_phy_path_b_iqk()
1108 static bool _rtl8723e_phy_simularity_compare(struct ieee80211_hw *hw, in _rtl8723e_phy_simularity_compare() argument
1160 static void _rtl8723e_phy_iq_calibrate(struct ieee80211_hw *hw, in _rtl8723e_phy_iq_calibrate() argument
1163 struct rtl_priv *rtlpriv = rtl_priv(hw); in _rtl8723e_phy_iq_calibrate()
1183 bbvalue = rtl_get_bbreg(hw, 0x800, MASKDWORD); in _rtl8723e_phy_iq_calibrate()
1185 rtl8723_save_adda_registers(hw, adda_reg, in _rtl8723e_phy_iq_calibrate()
1187 rtl8723_phy_save_mac_registers(hw, iqk_mac_reg, in _rtl8723e_phy_iq_calibrate()
1190 rtl8723_phy_path_adda_on(hw, adda_reg, true, is2t); in _rtl8723e_phy_iq_calibrate()
1192 rtlphy->rfpi_enable = (u8) rtl_get_bbreg(hw, in _rtl8723e_phy_iq_calibrate()
1198 rtl8723_phy_pi_mode_switch(hw, true); in _rtl8723e_phy_iq_calibrate()
1200 rtlphy->reg_c04 = rtl_get_bbreg(hw, 0xc04, MASKDWORD); in _rtl8723e_phy_iq_calibrate()
1201 rtlphy->reg_c08 = rtl_get_bbreg(hw, 0xc08, MASKDWORD); in _rtl8723e_phy_iq_calibrate()
1202 rtlphy->reg_874 = rtl_get_bbreg(hw, 0x874, MASKDWORD); in _rtl8723e_phy_iq_calibrate()
1204 rtl_set_bbreg(hw, 0xc04, MASKDWORD, 0x03a05600); in _rtl8723e_phy_iq_calibrate()
1205 rtl_set_bbreg(hw, 0xc08, MASKDWORD, 0x000800e4); in _rtl8723e_phy_iq_calibrate()
1206 rtl_set_bbreg(hw, 0x874, MASKDWORD, 0x22204000); in _rtl8723e_phy_iq_calibrate()
1208 rtl_set_bbreg(hw, 0x840, MASKDWORD, 0x00010000); in _rtl8723e_phy_iq_calibrate()
1209 rtl_set_bbreg(hw, 0x844, MASKDWORD, 0x00010000); in _rtl8723e_phy_iq_calibrate()
1211 rtl8723_phy_mac_setting_calibration(hw, iqk_mac_reg, in _rtl8723e_phy_iq_calibrate()
1213 rtl_set_bbreg(hw, 0xb68, MASKDWORD, 0x00080000); in _rtl8723e_phy_iq_calibrate()
1215 rtl_set_bbreg(hw, 0xb6c, MASKDWORD, 0x00080000); in _rtl8723e_phy_iq_calibrate()
1216 rtl_set_bbreg(hw, 0xe28, MASKDWORD, 0x80800000); in _rtl8723e_phy_iq_calibrate()
1217 rtl_set_bbreg(hw, 0xe40, MASKDWORD, 0x01007c00); in _rtl8723e_phy_iq_calibrate()
1218 rtl_set_bbreg(hw, 0xe44, MASKDWORD, 0x01004800); in _rtl8723e_phy_iq_calibrate()
1220 patha_ok = _rtl8723e_phy_path_a_iqk(hw, is2t); in _rtl8723e_phy_iq_calibrate()
1222 result[t][0] = (rtl_get_bbreg(hw, 0xe94, MASKDWORD) & in _rtl8723e_phy_iq_calibrate()
1224 result[t][1] = (rtl_get_bbreg(hw, 0xe9c, MASKDWORD) & in _rtl8723e_phy_iq_calibrate()
1226 result[t][2] = (rtl_get_bbreg(hw, 0xea4, MASKDWORD) & in _rtl8723e_phy_iq_calibrate()
1228 result[t][3] = (rtl_get_bbreg(hw, 0xeac, MASKDWORD) & in _rtl8723e_phy_iq_calibrate()
1233 result[t][0] = (rtl_get_bbreg(hw, 0xe94, in _rtl8723e_phy_iq_calibrate()
1237 (rtl_get_bbreg(hw, 0xe9c, MASKDWORD) & 0x3FF0000) >> 16; in _rtl8723e_phy_iq_calibrate()
1242 rtl8723_phy_path_a_standby(hw); in _rtl8723e_phy_iq_calibrate()
1243 rtl8723_phy_path_adda_on(hw, adda_reg, false, is2t); in _rtl8723e_phy_iq_calibrate()
1245 pathb_ok = _rtl8723e_phy_path_b_iqk(hw); in _rtl8723e_phy_iq_calibrate()
1247 result[t][4] = (rtl_get_bbreg(hw, in _rtl8723e_phy_iq_calibrate()
1252 (rtl_get_bbreg(hw, 0xebc, MASKDWORD) & in _rtl8723e_phy_iq_calibrate()
1255 (rtl_get_bbreg(hw, 0xec4, MASKDWORD) & in _rtl8723e_phy_iq_calibrate()
1258 (rtl_get_bbreg(hw, 0xecc, MASKDWORD) & in _rtl8723e_phy_iq_calibrate()
1262 result[t][4] = (rtl_get_bbreg(hw, in _rtl8723e_phy_iq_calibrate()
1267 result[t][5] = (rtl_get_bbreg(hw, 0xebc, MASKDWORD) & in _rtl8723e_phy_iq_calibrate()
1271 rtl_set_bbreg(hw, 0xc04, MASKDWORD, rtlphy->reg_c04); in _rtl8723e_phy_iq_calibrate()
1272 rtl_set_bbreg(hw, 0x874, MASKDWORD, rtlphy->reg_874); in _rtl8723e_phy_iq_calibrate()
1273 rtl_set_bbreg(hw, 0xc08, MASKDWORD, rtlphy->reg_c08); in _rtl8723e_phy_iq_calibrate()
1274 rtl_set_bbreg(hw, 0xe28, MASKDWORD, 0); in _rtl8723e_phy_iq_calibrate()
1275 rtl_set_bbreg(hw, 0x840, MASKDWORD, 0x00032ed3); in _rtl8723e_phy_iq_calibrate()
1277 rtl_set_bbreg(hw, 0x844, MASKDWORD, 0x00032ed3); in _rtl8723e_phy_iq_calibrate()
1280 rtl8723_phy_pi_mode_switch(hw, false); in _rtl8723e_phy_iq_calibrate()
1281 rtl8723_phy_reload_adda_registers(hw, adda_reg, in _rtl8723e_phy_iq_calibrate()
1283 rtl8723_phy_reload_mac_registers(hw, iqk_mac_reg, in _rtl8723e_phy_iq_calibrate()
1288 static void _rtl8723e_phy_lc_calibrate(struct ieee80211_hw *hw, bool is2t) in _rtl8723e_phy_lc_calibrate() argument
1292 struct rtl_priv *rtlpriv = rtl_priv(hw); in _rtl8723e_phy_lc_calibrate()
1302 rf_a_mode = rtl_get_rfreg(hw, RF90_PATH_A, 0x00, MASK12BITS); in _rtl8723e_phy_lc_calibrate()
1305 rf_b_mode = rtl_get_rfreg(hw, RF90_PATH_B, 0x00, in _rtl8723e_phy_lc_calibrate()
1308 rtl_set_rfreg(hw, RF90_PATH_A, 0x00, MASK12BITS, in _rtl8723e_phy_lc_calibrate()
1312 rtl_set_rfreg(hw, RF90_PATH_B, 0x00, MASK12BITS, in _rtl8723e_phy_lc_calibrate()
1315 lc_cal = rtl_get_rfreg(hw, RF90_PATH_A, 0x18, MASK12BITS); in _rtl8723e_phy_lc_calibrate()
1317 rtl_set_rfreg(hw, RF90_PATH_A, 0x18, MASK12BITS, lc_cal | 0x08000); in _rtl8723e_phy_lc_calibrate()
1323 rtl_set_rfreg(hw, RF90_PATH_A, 0x00, MASK12BITS, rf_a_mode); in _rtl8723e_phy_lc_calibrate()
1326 rtl_set_rfreg(hw, RF90_PATH_B, 0x00, MASK12BITS, in _rtl8723e_phy_lc_calibrate()
1333 static void _rtl8723e_phy_set_rfpath_switch(struct ieee80211_hw *hw, in _rtl8723e_phy_set_rfpath_switch() argument
1336 struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw)); in _rtl8723e_phy_set_rfpath_switch()
1339 rtl_set_bbreg(hw, REG_LEDCFG0, BIT(23), 0x01); in _rtl8723e_phy_set_rfpath_switch()
1340 rtl_set_bbreg(hw, RFPGA0_XAB_RFPARAMETER, BIT(13), 0x01); in _rtl8723e_phy_set_rfpath_switch()
1344 rtl_set_bbreg(hw, RFPGA0_XB_RFINTERFACEOE, in _rtl8723e_phy_set_rfpath_switch()
1347 rtl_set_bbreg(hw, RFPGA0_XB_RFINTERFACEOE, in _rtl8723e_phy_set_rfpath_switch()
1351 rtl_set_bbreg(hw, RFPGA0_XA_RFINTERFACEOE, 0x300, 0x2); in _rtl8723e_phy_set_rfpath_switch()
1353 rtl_set_bbreg(hw, RFPGA0_XA_RFINTERFACEOE, 0x300, 0x1); in _rtl8723e_phy_set_rfpath_switch()
1362 void rtl8723e_phy_iq_calibrate(struct ieee80211_hw *hw, bool b_recovery) in rtl8723e_phy_iq_calibrate() argument
1364 struct rtl_priv *rtlpriv = rtl_priv(hw); in rtl8723e_phy_iq_calibrate()
1387 rtl8723_phy_reload_adda_registers(hw, in rtl8723e_phy_iq_calibrate()
1405 _rtl8723e_phy_iq_calibrate(hw, result, i, false); in rtl8723e_phy_iq_calibrate()
1408 _rtl8723e_phy_simularity_compare(hw, result, 0, 1); in rtl8723e_phy_iq_calibrate()
1416 _rtl8723e_phy_simularity_compare(hw, result, 0, 2); in rtl8723e_phy_iq_calibrate()
1422 _rtl8723e_phy_simularity_compare(hw, result, 1, 2); in rtl8723e_phy_iq_calibrate()
1462 rtl8723_phy_path_a_fill_iqk_matrix(hw, b_patha_ok, result, in rtl8723e_phy_iq_calibrate()
1465 rtl8723_save_adda_registers(hw, iqk_bb_reg, in rtl8723e_phy_iq_calibrate()
1469 void rtl8723e_phy_lc_calibrate(struct ieee80211_hw *hw) in rtl8723e_phy_lc_calibrate() argument
1471 _rtl8723e_phy_lc_calibrate(hw, false); in rtl8723e_phy_lc_calibrate()
1474 void rtl8723e_phy_set_rfpath_switch(struct ieee80211_hw *hw, bool bmain) in rtl8723e_phy_set_rfpath_switch() argument
1476 _rtl8723e_phy_set_rfpath_switch(hw, bmain, false); in rtl8723e_phy_set_rfpath_switch()
1479 bool rtl8723e_phy_set_io_cmd(struct ieee80211_hw *hw, enum io_type iotype) in rtl8723e_phy_set_io_cmd() argument
1481 struct rtl_priv *rtlpriv = rtl_priv(hw); in rtl8723e_phy_set_io_cmd()
1512 rtl8723e_phy_set_io(hw); in rtl8723e_phy_set_io_cmd()
1517 static void rtl8723e_phy_set_io(struct ieee80211_hw *hw) in rtl8723e_phy_set_io() argument
1519 struct rtl_priv *rtlpriv = rtl_priv(hw); in rtl8723e_phy_set_io()
1529 rtl8723e_dm_write_dig(hw); in rtl8723e_phy_set_io()
1530 rtl8723e_phy_set_txpower_level(hw, rtlphy->current_channel); in rtl8723e_phy_set_io()
1535 rtl8723e_dm_write_dig(hw); in rtl8723e_phy_set_io()
1547 static void rtl8723e_phy_set_rf_on(struct ieee80211_hw *hw) in rtl8723e_phy_set_rf_on() argument
1549 struct rtl_priv *rtlpriv = rtl_priv(hw); in rtl8723e_phy_set_rf_on()
1559 static void _rtl8723e_phy_set_rf_sleep(struct ieee80211_hw *hw) in _rtl8723e_phy_set_rf_sleep() argument
1563 struct rtl_priv *rtlpriv = rtl_priv(hw); in _rtl8723e_phy_set_rf_sleep()
1566 rtl_set_rfreg(hw, RF90_PATH_A, 0x00, RFREG_OFFSET_MASK, 0x00); in _rtl8723e_phy_set_rf_sleep()
1568 u4b_tmp = rtl_get_rfreg(hw, RF90_PATH_A, 0, RFREG_OFFSET_MASK); in _rtl8723e_phy_set_rf_sleep()
1571 rtl_set_rfreg(hw, RF90_PATH_A, 0x00, RFREG_OFFSET_MASK, 0x00); in _rtl8723e_phy_set_rf_sleep()
1573 u4b_tmp = rtl_get_rfreg(hw, RF90_PATH_A, 0, RFREG_OFFSET_MASK); in _rtl8723e_phy_set_rf_sleep()
1589 static bool _rtl8723e_phy_set_rf_power_state(struct ieee80211_hw *hw, in _rtl8723e_phy_set_rf_power_state() argument
1592 struct rtl_priv *rtlpriv = rtl_priv(hw); in _rtl8723e_phy_set_rf_power_state()
1593 struct rtl_pci_priv *pcipriv = rtl_pcipriv(hw); in _rtl8723e_phy_set_rf_power_state()
1594 struct rtl_mac *mac = rtl_mac(rtl_priv(hw)); in _rtl8723e_phy_set_rf_power_state()
1595 struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw)); in _rtl8723e_phy_set_rf_power_state()
1611 rtstatus = rtl_ps_enable_nic(hw); in _rtl8723e_phy_set_rf_power_state()
1622 rtl8723e_phy_set_rf_on(hw); in _rtl8723e_phy_set_rf_power_state()
1625 rtlpriv->cfg->ops->led_control(hw, in _rtl8723e_phy_set_rf_power_state()
1628 rtlpriv->cfg->ops->led_control(hw, in _rtl8723e_phy_set_rf_power_state()
1636 rtl_ps_disable_nic(hw); in _rtl8723e_phy_set_rf_power_state()
1640 rtlpriv->cfg->ops->led_control(hw, in _rtl8723e_phy_set_rf_power_state()
1643 rtlpriv->cfg->ops->led_control(hw, in _rtl8723e_phy_set_rf_power_state()
1681 _rtl8723e_phy_set_rf_sleep(hw); in _rtl8723e_phy_set_rf_power_state()
1694 bool rtl8723e_phy_set_rf_power_state(struct ieee80211_hw *hw, in rtl8723e_phy_set_rf_power_state() argument
1697 struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw)); in rtl8723e_phy_set_rf_power_state()
1703 bresult = _rtl8723e_phy_set_rf_power_state(hw, rfpwr_state); in rtl8723e_phy_set_rf_power_state()