Commit 2bb7027b authored by Sergey Ryazanov's avatar Sergey Ryazanov Committed by Kalle Valo
Browse files

ath9k: interleaved NF calibration on AR9002



NF calibration and other elements of long calibration are usually faster
than ADCs & I/Q calibrations due to independence of receiption of the
OFDM signal. Moreover sometime I/Q calibration can not be completed at
all without preceding NF calibration. This is due to AGC, which has a
habit to block a weak signal without regular NF calibration. Thus, we do
not need to deferr the long calibration forever.

So, if the long calibration is requested, then deferr the ADCs & I/Q
calibration(s) and run the longcal (the NF calibration in particular) to
obtain fresh noise data.

Run tested with AR9220.

Signed-off-by: default avatarSergey Ryazanov <ryazanov.s.a@gmail.com>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20200424004923.17129-5-ryazanov.s.a@gmail.com
parent 41ba50fd
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -680,7 +680,11 @@ static int ar9002_hw_calibrate(struct ath_hw *ah, struct ath9k_channel *chan,
			return 0;

		ah->cal_list_curr = currCal = currCal->calNext;
		if (currCal->calState == CAL_WAITING)
		percal_pending = currCal->calState == CAL_WAITING;
	}

	/* Do not start a next calibration if the longcal is in action */
	if (percal_pending && !nfcal && !longcal) {
		ath9k_hw_reset_calibration(ah, currCal);

		return 0;