Searched refs:diff_pwr (Results 1 - 1 of 1) sorted by relevance

/linux-4.4.14/drivers/net/wireless/mediatek/mt7601u/
H A Dphy.c881 int curr_pwr, diff_pwr; mt7601u_tssi_cal() local
917 diff_pwr = params.trgt_power - curr_pwr; mt7601u_tssi_cal()
918 dev_dbg(dev->dev, "Power curr:%08x diff:%08x\n", curr_pwr, diff_pwr); mt7601u_tssi_cal()
920 if (params.tssi0 > 126 && diff_pwr > 0) { mt7601u_tssi_cal()
922 diff_pwr = 0; mt7601u_tssi_cal()
924 if (params.tssi0 - tssi_init < 1 && diff_pwr < 0) { mt7601u_tssi_cal()
926 diff_pwr = 0; mt7601u_tssi_cal()
929 if ((dev->prev_pwr_diff ^ diff_pwr) < 0 && abs(diff_pwr) < 4096 && mt7601u_tssi_cal()
930 (abs(diff_pwr) > abs(dev->prev_pwr_diff) || mt7601u_tssi_cal()
931 (diff_pwr > 0 && diff_pwr == -dev->prev_pwr_diff))) mt7601u_tssi_cal()
932 diff_pwr = 0; mt7601u_tssi_cal()
934 dev->prev_pwr_diff = diff_pwr; mt7601u_tssi_cal()
936 diff_pwr += (diff_pwr > 0) ? 2048 : -2048; mt7601u_tssi_cal()
937 diff_pwr /= 4096; mt7601u_tssi_cal()
939 dev_dbg(dev->dev, "final diff: %08x\n", diff_pwr); mt7601u_tssi_cal()
943 diff_pwr += curr_pwr; mt7601u_tssi_cal()
944 val = (val & ~MT_TX_ALC_CFG_1_TEMP_COMP) | int_to_s6(diff_pwr); mt7601u_tssi_cal()

Completed in 51 milliseconds