Skip to content

Commit 1f64252

Browse files
miaoqing-pankvalo
authored andcommitted
ath9k: set correct peak detect threshold
Set QCA9561 peak detect threshold to 11. Signed-off-by: Miaoqing Pan <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
1 parent 9c8ec99 commit 1f64252

File tree

1 file changed

+11
-14
lines changed

1 file changed

+11
-14
lines changed

drivers/net/wireless/ath/ath9k/ar9003_calib.c

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1203,12 +1203,12 @@ static void ar9003_hw_tx_iq_cal_reload(struct ath_hw *ah)
12031203
static void ar9003_hw_manual_peak_cal(struct ath_hw *ah, u8 chain, bool is_2g)
12041204
{
12051205
int offset[8] = {0}, total = 0, test;
1206-
int agc_out, i, peak_detect_threshold;
1206+
int agc_out, i, peak_detect_threshold = 0;
12071207

12081208
if (AR_SREV_9550(ah) || AR_SREV_9531(ah))
12091209
peak_detect_threshold = 8;
1210-
else
1211-
peak_detect_threshold = 0;
1210+
else if (AR_SREV_9561(ah))
1211+
peak_detect_threshold = 11;
12121212

12131213
/*
12141214
* Turn off LNA/SW.
@@ -1249,17 +1249,14 @@ static void ar9003_hw_manual_peak_cal(struct ath_hw *ah, u8 chain, bool is_2g)
12491249
REG_RMW_FIELD(ah, AR_PHY_65NM_RXRF_AGC(chain),
12501250
AR_PHY_65NM_RXRF_AGC_AGC2G_CALDAC_OVR, 0x0);
12511251

1252-
if (AR_SREV_9003_PCOEM(ah) || AR_SREV_9550(ah) || AR_SREV_9531(ah) ||
1253-
AR_SREV_9561(ah)) {
1254-
if (is_2g)
1255-
REG_RMW_FIELD(ah, AR_PHY_65NM_RXRF_AGC(chain),
1256-
AR_PHY_65NM_RXRF_AGC_AGC2G_DBDAC_OVR,
1257-
peak_detect_threshold);
1258-
else
1259-
REG_RMW_FIELD(ah, AR_PHY_65NM_RXRF_AGC(chain),
1260-
AR_PHY_65NM_RXRF_AGC_AGC5G_DBDAC_OVR,
1261-
peak_detect_threshold);
1262-
}
1252+
if (is_2g)
1253+
REG_RMW_FIELD(ah, AR_PHY_65NM_RXRF_AGC(chain),
1254+
AR_PHY_65NM_RXRF_AGC_AGC2G_DBDAC_OVR,
1255+
peak_detect_threshold);
1256+
else
1257+
REG_RMW_FIELD(ah, AR_PHY_65NM_RXRF_AGC(chain),
1258+
AR_PHY_65NM_RXRF_AGC_AGC5G_DBDAC_OVR,
1259+
peak_detect_threshold);
12631260

12641261
for (i = 6; i > 0; i--) {
12651262
offset[i] = BIT(i - 1);

0 commit comments

Comments
 (0)