Lines Matching refs:diff_pwr
879 int curr_pwr, diff_pwr; in mt7601u_tssi_cal() local
915 diff_pwr = params.trgt_power - curr_pwr; in mt7601u_tssi_cal()
916 dev_dbg(dev->dev, "Power curr:%08x diff:%08x\n", curr_pwr, diff_pwr); in mt7601u_tssi_cal()
918 if (params.tssi0 > 126 && diff_pwr > 0) { in mt7601u_tssi_cal()
920 diff_pwr = 0; in mt7601u_tssi_cal()
922 if (params.tssi0 - tssi_init < 1 && diff_pwr < 0) { in mt7601u_tssi_cal()
924 diff_pwr = 0; in mt7601u_tssi_cal()
927 if ((dev->prev_pwr_diff ^ diff_pwr) < 0 && abs(diff_pwr) < 4096 && in mt7601u_tssi_cal()
928 (abs(diff_pwr) > abs(dev->prev_pwr_diff) || in mt7601u_tssi_cal()
929 (diff_pwr > 0 && diff_pwr == -dev->prev_pwr_diff))) in mt7601u_tssi_cal()
930 diff_pwr = 0; in mt7601u_tssi_cal()
932 dev->prev_pwr_diff = diff_pwr; in mt7601u_tssi_cal()
934 diff_pwr += (diff_pwr > 0) ? 2048 : -2048; in mt7601u_tssi_cal()
935 diff_pwr /= 4096; in mt7601u_tssi_cal()
937 dev_dbg(dev->dev, "final diff: %08x\n", diff_pwr); in mt7601u_tssi_cal()
941 diff_pwr += curr_pwr; in mt7601u_tssi_cal()
942 val = (val & ~MT_TX_ALC_CFG_1_TEMP_COMP) | int_to_s6(diff_pwr); in mt7601u_tssi_cal()