• Home
  • Raw
  • Download

Lines Matching refs:rtldm

161 	struct rtl_dm *rtldm = rtl_dm(rtl_priv(hw));  in rtl8723be_dm_txpower_track_adjust()  local
165 u8 cck_base = rtldm->swing_idx_cck_base; in rtl8723be_dm_txpower_track_adjust()
166 u8 cck_val = rtldm->swing_idx_cck; in rtl8723be_dm_txpower_track_adjust()
654 struct rtl_dm *rtldm = rtl_dm(rtl_priv(hw)); in rtl8723be_dm_tx_power_track_set_power() local
660 if (rtldm->swing_idx_cck >= CCK_TABLE_SIZE) in rtl8723be_dm_tx_power_track_set_power()
661 rtldm->swing_idx_cck = CCK_TABLE_SIZE - 1; in rtl8723be_dm_tx_power_track_set_power()
663 if (!rtldm->cck_inch14) { in rtl8723be_dm_tx_power_track_set_power()
665 cckswing_table_ch1ch13[rtldm->swing_idx_cck][0]); in rtl8723be_dm_tx_power_track_set_power()
667 cckswing_table_ch1ch13[rtldm->swing_idx_cck][1]); in rtl8723be_dm_tx_power_track_set_power()
669 cckswing_table_ch1ch13[rtldm->swing_idx_cck][2]); in rtl8723be_dm_tx_power_track_set_power()
671 cckswing_table_ch1ch13[rtldm->swing_idx_cck][3]); in rtl8723be_dm_tx_power_track_set_power()
673 cckswing_table_ch1ch13[rtldm->swing_idx_cck][4]); in rtl8723be_dm_tx_power_track_set_power()
675 cckswing_table_ch1ch13[rtldm->swing_idx_cck][5]); in rtl8723be_dm_tx_power_track_set_power()
677 cckswing_table_ch1ch13[rtldm->swing_idx_cck][6]); in rtl8723be_dm_tx_power_track_set_power()
679 cckswing_table_ch1ch13[rtldm->swing_idx_cck][7]); in rtl8723be_dm_tx_power_track_set_power()
682 cckswing_table_ch14[rtldm->swing_idx_cck][0]); in rtl8723be_dm_tx_power_track_set_power()
684 cckswing_table_ch14[rtldm->swing_idx_cck][1]); in rtl8723be_dm_tx_power_track_set_power()
686 cckswing_table_ch14[rtldm->swing_idx_cck][2]); in rtl8723be_dm_tx_power_track_set_power()
688 cckswing_table_ch14[rtldm->swing_idx_cck][3]); in rtl8723be_dm_tx_power_track_set_power()
690 cckswing_table_ch14[rtldm->swing_idx_cck][4]); in rtl8723be_dm_tx_power_track_set_power()
692 cckswing_table_ch14[rtldm->swing_idx_cck][5]); in rtl8723be_dm_tx_power_track_set_power()
694 cckswing_table_ch14[rtldm->swing_idx_cck][6]); in rtl8723be_dm_tx_power_track_set_power()
696 cckswing_table_ch14[rtldm->swing_idx_cck][7]); in rtl8723be_dm_tx_power_track_set_power()
700 if (rtldm->swing_idx_ofdm[RF90_PATH_A] < in rtl8723be_dm_tx_power_track_set_power()
703 rtldm->swing_idx_ofdm[RF90_PATH_A]; in rtl8723be_dm_tx_power_track_set_power()
706 rtldm->swing_idx_ofdm[rfpath], rfpath, in rtl8723be_dm_tx_power_track_set_power()
710 if (rtldm->swing_idx_ofdm[RF90_PATH_B] < in rtl8723be_dm_tx_power_track_set_power()
713 rtldm->swing_idx_ofdm[RF90_PATH_B]; in rtl8723be_dm_tx_power_track_set_power()
716 rtldm->swing_idx_ofdm[rfpath], rfpath, in rtl8723be_dm_tx_power_track_set_power()
730 struct rtl_dm *rtldm = rtl_dm(rtl_priv(hw)); in rtl8723be_dm_txpower_tracking_callback_thermalmeter() local
760 thermalvalue, rtldm->thermalvalue, in rtl8723be_dm_txpower_tracking_callback_thermalmeter()
763 if (!rtldm->thermalvalue) { in rtl8723be_dm_txpower_tracking_callback_thermalmeter()
769 rtldm->thermalvalue_avg[rtldm->thermalvalue_avg_index] = thermalvalue; in rtl8723be_dm_txpower_tracking_callback_thermalmeter()
770 rtldm->thermalvalue_avg_index++; in rtl8723be_dm_txpower_tracking_callback_thermalmeter()
771 if (rtldm->thermalvalue_avg_index == AVG_THERMAL_NUM_8723BE) in rtl8723be_dm_txpower_tracking_callback_thermalmeter()
772 rtldm->thermalvalue_avg_index = 0; in rtl8723be_dm_txpower_tracking_callback_thermalmeter()
775 if (rtldm->thermalvalue_avg[i]) { in rtl8723be_dm_txpower_tracking_callback_thermalmeter()
776 thermalvalue_avg += rtldm->thermalvalue_avg[i]; in rtl8723be_dm_txpower_tracking_callback_thermalmeter()
819 rtldm->delta_power_index_last[RF90_PATH_A] = in rtl8723be_dm_txpower_tracking_callback_thermalmeter()
820 rtldm->delta_power_index[RF90_PATH_A]; in rtl8723be_dm_txpower_tracking_callback_thermalmeter()
821 rtldm->delta_power_index[RF90_PATH_A] = in rtl8723be_dm_txpower_tracking_callback_thermalmeter()
824 rtldm->delta_power_index_last[RF90_PATH_A] = in rtl8723be_dm_txpower_tracking_callback_thermalmeter()
825 rtldm->delta_power_index[RF90_PATH_A]; in rtl8723be_dm_txpower_tracking_callback_thermalmeter()
826 rtldm->delta_power_index[RF90_PATH_A] = in rtl8723be_dm_txpower_tracking_callback_thermalmeter()
831 if (rtldm->delta_power_index[RF90_PATH_A] == in rtl8723be_dm_txpower_tracking_callback_thermalmeter()
832 rtldm->delta_power_index_last[RF90_PATH_A]) in rtl8723be_dm_txpower_tracking_callback_thermalmeter()
833 rtldm->power_index_offset[RF90_PATH_A] = 0; in rtl8723be_dm_txpower_tracking_callback_thermalmeter()
835 rtldm->power_index_offset[RF90_PATH_A] = in rtl8723be_dm_txpower_tracking_callback_thermalmeter()
836 rtldm->delta_power_index[RF90_PATH_A] - in rtl8723be_dm_txpower_tracking_callback_thermalmeter()
837 rtldm->delta_power_index_last[RF90_PATH_A]; in rtl8723be_dm_txpower_tracking_callback_thermalmeter()
839 rtldm->ofdm_index[0] = in rtl8723be_dm_txpower_tracking_callback_thermalmeter()
840 rtldm->swing_idx_ofdm_base[RF90_PATH_A] + in rtl8723be_dm_txpower_tracking_callback_thermalmeter()
841 rtldm->power_index_offset[RF90_PATH_A]; in rtl8723be_dm_txpower_tracking_callback_thermalmeter()
842 rtldm->cck_index = rtldm->swing_idx_cck_base + in rtl8723be_dm_txpower_tracking_callback_thermalmeter()
843 rtldm->power_index_offset[RF90_PATH_A]; in rtl8723be_dm_txpower_tracking_callback_thermalmeter()
845 rtldm->swing_idx_cck = rtldm->cck_index; in rtl8723be_dm_txpower_tracking_callback_thermalmeter()
846 rtldm->swing_idx_ofdm[0] = rtldm->ofdm_index[0]; in rtl8723be_dm_txpower_tracking_callback_thermalmeter()
848 if (rtldm->ofdm_index[0] > OFDM_TABLE_SIZE - 1) in rtl8723be_dm_txpower_tracking_callback_thermalmeter()
849 rtldm->ofdm_index[0] = OFDM_TABLE_SIZE - 1; in rtl8723be_dm_txpower_tracking_callback_thermalmeter()
850 else if (rtldm->ofdm_index[0] < ofdm_min_index) in rtl8723be_dm_txpower_tracking_callback_thermalmeter()
851 rtldm->ofdm_index[0] = ofdm_min_index; in rtl8723be_dm_txpower_tracking_callback_thermalmeter()
853 if (rtldm->cck_index > CCK_TABLE_SIZE - 1) in rtl8723be_dm_txpower_tracking_callback_thermalmeter()
854 rtldm->cck_index = CCK_TABLE_SIZE - 1; in rtl8723be_dm_txpower_tracking_callback_thermalmeter()
855 else if (rtldm->cck_index < 0) in rtl8723be_dm_txpower_tracking_callback_thermalmeter()
856 rtldm->cck_index = 0; in rtl8723be_dm_txpower_tracking_callback_thermalmeter()
858 rtldm->power_index_offset[RF90_PATH_A] = 0; in rtl8723be_dm_txpower_tracking_callback_thermalmeter()
861 if ((rtldm->power_index_offset[RF90_PATH_A] != 0) && in rtl8723be_dm_txpower_tracking_callback_thermalmeter()
862 (rtldm->txpower_track_control)) { in rtl8723be_dm_txpower_tracking_callback_thermalmeter()
863 rtldm->done_txpower = true; in rtl8723be_dm_txpower_tracking_callback_thermalmeter()
867 rtldm->swing_idx_cck_base = rtldm->swing_idx_cck; in rtl8723be_dm_txpower_tracking_callback_thermalmeter()
868 rtldm->swing_idx_ofdm_base[RF90_PATH_A] = in rtl8723be_dm_txpower_tracking_callback_thermalmeter()
869 rtldm->swing_idx_ofdm[0]; in rtl8723be_dm_txpower_tracking_callback_thermalmeter()
870 rtldm->thermalvalue = thermalvalue; in rtl8723be_dm_txpower_tracking_callback_thermalmeter()
874 rtldm->thermalvalue_iqk = thermalvalue; in rtl8723be_dm_txpower_tracking_callback_thermalmeter()
878 rtldm->txpowercount = 0; in rtl8723be_dm_txpower_tracking_callback_thermalmeter()
1110 struct rtl_dm *rtldm = rtl_dm(rtl_priv(hw)); in rtl8723be_dm_dynamic_atc_switch() local
1117 if (rtldm->atc_status == ATC_STATUS_OFF) { in rtl8723be_dm_dynamic_atc_switch()
1120 rtldm->atc_status = ATC_STATUS_ON; in rtl8723be_dm_dynamic_atc_switch()
1130 if (rtldm->crystal_cap != rtlpriv->efuse.crystalcap) { in rtl8723be_dm_dynamic_atc_switch()
1131 rtldm->crystal_cap = rtlpriv->efuse.crystalcap; in rtl8723be_dm_dynamic_atc_switch()
1132 crystal_cap = rtldm->crystal_cap & 0x3f; in rtl8723be_dm_dynamic_atc_switch()
1137 cfo_khz_a = (int)(rtldm->cfo_tail[0] * 3125) / 1280; in rtl8723be_dm_dynamic_atc_switch()
1138 cfo_khz_b = (int)(rtldm->cfo_tail[1] * 3125) / 1280; in rtl8723be_dm_dynamic_atc_switch()
1139 packet_count = rtldm->packet_count; in rtl8723be_dm_dynamic_atc_switch()
1141 if (packet_count == rtldm->packet_count_pre) in rtl8723be_dm_dynamic_atc_switch()
1144 rtldm->packet_count_pre = packet_count; in rtl8723be_dm_dynamic_atc_switch()
1151 cfo_ave_diff = (rtldm->cfo_ave_pre >= cfo_ave) ? in rtl8723be_dm_dynamic_atc_switch()
1152 (rtldm->cfo_ave_pre - cfo_ave) : in rtl8723be_dm_dynamic_atc_switch()
1153 (cfo_ave - rtldm->cfo_ave_pre); in rtl8723be_dm_dynamic_atc_switch()
1155 if (cfo_ave_diff > 20 && !rtldm->large_cfo_hit) { in rtl8723be_dm_dynamic_atc_switch()
1156 rtldm->large_cfo_hit = true; in rtl8723be_dm_dynamic_atc_switch()
1159 rtldm->large_cfo_hit = false; in rtl8723be_dm_dynamic_atc_switch()
1161 rtldm->cfo_ave_pre = cfo_ave; in rtl8723be_dm_dynamic_atc_switch()
1163 if (cfo_ave >= -rtldm->cfo_threshold && in rtl8723be_dm_dynamic_atc_switch()
1164 cfo_ave <= rtldm->cfo_threshold && rtldm->is_freeze == 0) { in rtl8723be_dm_dynamic_atc_switch()
1165 if (rtldm->cfo_threshold == CFO_THRESHOLD_XTAL) { in rtl8723be_dm_dynamic_atc_switch()
1166 rtldm->cfo_threshold = CFO_THRESHOLD_XTAL + 10; in rtl8723be_dm_dynamic_atc_switch()
1167 rtldm->is_freeze = 1; in rtl8723be_dm_dynamic_atc_switch()
1169 rtldm->cfo_threshold = CFO_THRESHOLD_XTAL; in rtl8723be_dm_dynamic_atc_switch()
1173 if (cfo_ave > rtldm->cfo_threshold && rtldm->crystal_cap < 0x3f) in rtl8723be_dm_dynamic_atc_switch()
1180 rtldm->is_freeze = 0; in rtl8723be_dm_dynamic_atc_switch()
1181 rtldm->crystal_cap += adjust_xtal; in rtl8723be_dm_dynamic_atc_switch()
1183 if (rtldm->crystal_cap > 0x3f) in rtl8723be_dm_dynamic_atc_switch()
1184 rtldm->crystal_cap = 0x3f; in rtl8723be_dm_dynamic_atc_switch()
1185 else if (rtldm->crystal_cap < 0) in rtl8723be_dm_dynamic_atc_switch()
1186 rtldm->crystal_cap = 0; in rtl8723be_dm_dynamic_atc_switch()
1188 crystal_cap = rtldm->crystal_cap & 0x3f; in rtl8723be_dm_dynamic_atc_switch()
1195 if (rtldm->atc_status == ATC_STATUS_ON) { in rtl8723be_dm_dynamic_atc_switch()
1198 rtldm->atc_status = ATC_STATUS_OFF; in rtl8723be_dm_dynamic_atc_switch()
1201 if (rtldm->atc_status == ATC_STATUS_OFF) { in rtl8723be_dm_dynamic_atc_switch()
1204 rtldm->atc_status = ATC_STATUS_ON; in rtl8723be_dm_dynamic_atc_switch()