aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSujith Manoharan <c_manoha@qca.qualcomm.com>2014-11-15 19:41:05 -0500
committerJohn W. Linville <linville@tuxdriver.com>2014-11-17 15:32:16 -0500
commit89b6e35c2032d74f51333fbf3635d980b3311c68 (patch)
tree8c57a8712dd289bf572c19b6fc442fa2fe8e3538
parentee79ccd9ea8617220783ace007d722ed3815e00f (diff)
ath9k: Fix thermometer programming
The registers that control the on-chip thermometer need to be programmed based on the chainmask that the solution supports, not the chainmask that is present in the eeprom. Cc: Miaoqing Pan <miaoqing@qca.qualcomm.com> Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/ath/ath9k/ar9003_eeprom.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
index 80c6eacbda53..e726e405152c 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
+++ b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
@@ -4079,27 +4079,28 @@ static int ar9003_hw_get_thermometer(struct ath_hw *ah)
4079 4079
4080static void ar9003_hw_thermometer_apply(struct ath_hw *ah) 4080static void ar9003_hw_thermometer_apply(struct ath_hw *ah)
4081{ 4081{
4082 struct ath9k_hw_capabilities *pCap = &ah->caps;
4082 int thermometer = ar9003_hw_get_thermometer(ah); 4083 int thermometer = ar9003_hw_get_thermometer(ah);
4083 u8 therm_on = (thermometer < 0) ? 0 : 1; 4084 u8 therm_on = (thermometer < 0) ? 0 : 1;
4084 4085
4085 REG_RMW_FIELD(ah, AR_PHY_65NM_CH0_RXTX4, 4086 REG_RMW_FIELD(ah, AR_PHY_65NM_CH0_RXTX4,
4086 AR_PHY_65NM_CH0_RXTX4_THERM_ON_OVR, therm_on); 4087 AR_PHY_65NM_CH0_RXTX4_THERM_ON_OVR, therm_on);
4087 if (ah->caps.tx_chainmask & BIT(1)) 4088 if (pCap->chip_chainmask & BIT(1))
4088 REG_RMW_FIELD(ah, AR_PHY_65NM_CH1_RXTX4, 4089 REG_RMW_FIELD(ah, AR_PHY_65NM_CH1_RXTX4,
4089 AR_PHY_65NM_CH0_RXTX4_THERM_ON_OVR, therm_on); 4090 AR_PHY_65NM_CH0_RXTX4_THERM_ON_OVR, therm_on);
4090 if (ah->caps.tx_chainmask & BIT(2)) 4091 if (pCap->chip_chainmask & BIT(2))
4091 REG_RMW_FIELD(ah, AR_PHY_65NM_CH2_RXTX4, 4092 REG_RMW_FIELD(ah, AR_PHY_65NM_CH2_RXTX4,
4092 AR_PHY_65NM_CH0_RXTX4_THERM_ON_OVR, therm_on); 4093 AR_PHY_65NM_CH0_RXTX4_THERM_ON_OVR, therm_on);
4093 4094
4094 therm_on = (thermometer < 0) ? 0 : (thermometer == 0); 4095 therm_on = (thermometer < 0) ? 0 : (thermometer == 0);
4095 REG_RMW_FIELD(ah, AR_PHY_65NM_CH0_RXTX4, 4096 REG_RMW_FIELD(ah, AR_PHY_65NM_CH0_RXTX4,
4096 AR_PHY_65NM_CH0_RXTX4_THERM_ON, therm_on); 4097 AR_PHY_65NM_CH0_RXTX4_THERM_ON, therm_on);
4097 if (ah->caps.tx_chainmask & BIT(1)) { 4098 if (pCap->chip_chainmask & BIT(1)) {
4098 therm_on = (thermometer < 0) ? 0 : (thermometer == 1); 4099 therm_on = (thermometer < 0) ? 0 : (thermometer == 1);
4099 REG_RMW_FIELD(ah, AR_PHY_65NM_CH1_RXTX4, 4100 REG_RMW_FIELD(ah, AR_PHY_65NM_CH1_RXTX4,
4100 AR_PHY_65NM_CH0_RXTX4_THERM_ON, therm_on); 4101 AR_PHY_65NM_CH0_RXTX4_THERM_ON, therm_on);
4101 } 4102 }
4102 if (ah->caps.tx_chainmask & BIT(2)) { 4103 if (pCap->chip_chainmask & BIT(2)) {
4103 therm_on = (thermometer < 0) ? 0 : (thermometer == 2); 4104 therm_on = (thermometer < 0) ? 0 : (thermometer == 2);
4104 REG_RMW_FIELD(ah, AR_PHY_65NM_CH2_RXTX4, 4105 REG_RMW_FIELD(ah, AR_PHY_65NM_CH2_RXTX4,
4105 AR_PHY_65NM_CH0_RXTX4_THERM_ON, therm_on); 4106 AR_PHY_65NM_CH0_RXTX4_THERM_ON, therm_on);