aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath9k/calib.c
diff options
context:
space:
mode:
authorLuis R. Rodriguez <lrodriguez@atheros.com>2010-04-15 17:38:55 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-04-16 15:43:29 -0400
commit2b5facfe7669b36a04845928abd1fcc153990026 (patch)
tree3c292bc57544e0e1a62794932bde8263648c0aba /drivers/net/wireless/ath/ath9k/calib.c
parent80b99932fd43ce3477fb2d952f12657963a2562d (diff)
ath9k_hw: move the AR9280 OLC temp comp to its own helper
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/calib.c')
-rw-r--r--drivers/net/wireless/ath/ath9k/calib.c52
1 files changed, 28 insertions, 24 deletions
diff --git a/drivers/net/wireless/ath/ath9k/calib.c b/drivers/net/wireless/ath/ath9k/calib.c
index 5d61169de07b..dae200c5fe0d 100644
--- a/drivers/net/wireless/ath/ath9k/calib.c
+++ b/drivers/net/wireless/ath/ath9k/calib.c
@@ -700,40 +700,44 @@ static void ar9287_hw_olc_temp_compensation(struct ath_hw *ah)
700 } 700 }
701} 701}
702 702
703static void ath9k_olc_temp_compensation(struct ath_hw *ah) 703static void ar9280_hw_olc_temp_compensation(struct ath_hw *ah)
704{ 704{
705 u32 rddata, i; 705 u32 rddata, i;
706 int delta, currPDADC, regval; 706 int delta, currPDADC, regval;
707 707
708 if (OLC_FOR_AR9287_10_LATER) { 708 rddata = REG_READ(ah, AR_PHY_TX_PWRCTRL4);
709 ar9287_hw_olc_temp_compensation(ah); 709 currPDADC = MS(rddata, AR_PHY_TX_PWRCTRL_PD_AVG_OUT);
710 } else {
711 rddata = REG_READ(ah, AR_PHY_TX_PWRCTRL4);
712 currPDADC = MS(rddata, AR_PHY_TX_PWRCTRL_PD_AVG_OUT);
713 710
714 if (ah->initPDADC == 0 || currPDADC == 0) 711 if (ah->initPDADC == 0 || currPDADC == 0)
715 return; 712 return;
716 713
717 if (ah->eep_ops->get_eeprom(ah, EEP_DAC_HPWR_5G)) 714 if (ah->eep_ops->get_eeprom(ah, EEP_DAC_HPWR_5G))
718 delta = (currPDADC - ah->initPDADC + 4) / 8; 715 delta = (currPDADC - ah->initPDADC + 4) / 8;
719 else 716 else
720 delta = (currPDADC - ah->initPDADC + 5) / 10; 717 delta = (currPDADC - ah->initPDADC + 5) / 10;
721 718
722 if (delta != ah->PDADCdelta) { 719 if (delta != ah->PDADCdelta) {
723 ah->PDADCdelta = delta; 720 ah->PDADCdelta = delta;
724 for (i = 1; i < AR9280_TX_GAIN_TABLE_SIZE; i++) { 721 for (i = 1; i < AR9280_TX_GAIN_TABLE_SIZE; i++) {
725 regval = ah->originalGain[i] - delta; 722 regval = ah->originalGain[i] - delta;
726 if (regval < 0) 723 if (regval < 0)
727 regval = 0; 724 regval = 0;
728 725
729 REG_RMW_FIELD(ah, 726 REG_RMW_FIELD(ah,
730 AR_PHY_TX_GAIN_TBL1 + i * 4, 727 AR_PHY_TX_GAIN_TBL1 + i * 4,
731 AR_PHY_TX_GAIN, regval); 728 AR_PHY_TX_GAIN, regval);
732 }
733 } 729 }
734 } 730 }
735} 731}
736 732
733static void ath9k_olc_temp_compensation(struct ath_hw *ah)
734{
735 if (OLC_FOR_AR9287_10_LATER)
736 ar9287_hw_olc_temp_compensation(ah);
737 else
738 ar9280_hw_olc_temp_compensation(ah);
739}
740
737static void ath9k_hw_9271_pa_cal(struct ath_hw *ah, bool is_reset) 741static void ath9k_hw_9271_pa_cal(struct ath_hw *ah, bool is_reset)
738{ 742{
739 u32 regVal; 743 u32 regVal;