Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ath9k: Set correct peak detect threshold

The value is different for PCOEM cards and AR955x/AR953x.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>

authored by

Sujith Manoharan and committed by
Kalle Valo
e4e292f3 7a722ebc

+11 -4
+11 -4
drivers/net/wireless/ath/ath9k/ar9003_calib.c
··· 1203 1203 static void ar9003_hw_manual_peak_cal(struct ath_hw *ah, u8 chain, bool is_2g) 1204 1204 { 1205 1205 int offset[8] = {0}, total = 0, test; 1206 - int agc_out, i; 1206 + int agc_out, i, peak_detect_threshold; 1207 + 1208 + if (AR_SREV_9550(ah) || AR_SREV_9531(ah)) 1209 + peak_detect_threshold = 8; 1210 + else 1211 + peak_detect_threshold = 0; 1207 1212 1208 1213 /* 1209 1214 * Turn off LNA/SW. ··· 1249 1244 REG_RMW_FIELD(ah, AR_PHY_65NM_RXRF_AGC(chain), 1250 1245 AR_PHY_65NM_RXRF_AGC_AGC2G_CALDAC_OVR, 0x0); 1251 1246 1252 - if (AR_SREV_9003_PCOEM(ah)) { 1247 + if (AR_SREV_9003_PCOEM(ah) || AR_SREV_9550(ah) || AR_SREV_9531(ah)) { 1253 1248 if (is_2g) 1254 1249 REG_RMW_FIELD(ah, AR_PHY_65NM_RXRF_AGC(chain), 1255 - AR_PHY_65NM_RXRF_AGC_AGC2G_DBDAC_OVR, 0x0); 1250 + AR_PHY_65NM_RXRF_AGC_AGC2G_DBDAC_OVR, 1251 + peak_detect_threshold); 1256 1252 else 1257 1253 REG_RMW_FIELD(ah, AR_PHY_65NM_RXRF_AGC(chain), 1258 - AR_PHY_65NM_RXRF_AGC_AGC5G_DBDAC_OVR, 0x0); 1254 + AR_PHY_65NM_RXRF_AGC_AGC5G_DBDAC_OVR, 1255 + peak_detect_threshold); 1259 1256 } 1260 1257 1261 1258 for (i = 6; i > 0; i--) {