diff options
author | Sujith Manoharan <c_manoha@qca.qualcomm.com> | 2012-12-10 01:52:38 (GMT) |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-12-10 20:49:51 (GMT) |
commit | 1562580e37e7a6936d591fd04cf9d7b79a096bf0 (patch) | |
tree | a32b35a602c71daf045441fd7ff17fa70936142b /drivers/net/wireless/ath/ath9k/ar9003_paprd.c | |
parent | 0f21ee8d9c8a041b974cfb75d81d07b61bd0869f (diff) | |
download | linux-fsl-qoriq-1562580e37e7a6936d591fd04cf9d7b79a096bf0.tar.xz |
ath9k_hw: Calculate the correct training power for PAPRD
Assign the training power for PAPRD based on the chip.
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/ar9003_paprd.c')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/ar9003_paprd.c | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_paprd.c b/drivers/net/wireless/ath/ath9k/ar9003_paprd.c index aea1908..09c1f9d 100644 --- a/drivers/net/wireless/ath/ath9k/ar9003_paprd.c +++ b/drivers/net/wireless/ath/ath9k/ar9003_paprd.c @@ -74,15 +74,23 @@ static int ar9003_get_training_power_2g(struct ath_hw *ah) unsigned int power, scale, delta; scale = ar9003_get_paprd_scale_factor(ah, chan); - power = REG_READ_FIELD(ah, AR_PHY_POWERTX_RATE5, - AR_PHY_POWERTX_RATE5_POWERTXHT20_0); - delta = abs((int) ah->paprd_target_power - (int) power); - if (delta > scale) - return -1; + if (AR_SREV_9330(ah) || AR_SREV_9340(ah) || + AR_SREV_9462(ah) || AR_SREV_9565(ah)) { + power = ah->paprd_target_power + 2; + } else if (AR_SREV_9485(ah)) { + power = 25; + } else { + power = REG_READ_FIELD(ah, AR_PHY_POWERTX_RATE5, + AR_PHY_POWERTX_RATE5_POWERTXHT20_0); + + delta = abs((int) ah->paprd_target_power - (int) power); + if (delta > scale) + return -1; - if (delta < 4) - power -= 4 - delta; + if (delta < 4) + power -= 4 - delta; + } return power; } |