aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVasanthakumar Thiagarajan <vasanth@atheros.com>2010-12-06 07:27:52 -0500
committerJohn W. Linville <linville@tuxdriver.com>2010-12-07 16:34:58 -0500
commitdd040f76cef0cc977b83e905a16b68d41322b735 (patch)
tree28b58fa49d6549544b95e77feb50fe368689079f
parentab09b5b4beda8b33a117bf6fbbb2b5aa8f566129 (diff)
ath9k_hw: Read and configure turnning caps to regulate freq accuracy
Right now it is done for only AR9485, will be done for ar9003 also after proper testing. Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/ath/ath9k/ar9003_eeprom.c16
-rw-r--r--drivers/net/wireless/ath/ath9k/ar9003_phy.h6
2 files changed, 22 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
index c02e43d5c9c9..76508f82f859 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
+++ b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
@@ -3737,6 +3737,20 @@ static void ar9003_hw_internal_regulator_apply(struct ath_hw *ah)
3737 3737
3738} 3738}
3739 3739
3740static void ar9003_hw_apply_tuning_caps(struct ath_hw *ah)
3741{
3742 struct ar9300_eeprom *eep = &ah->eeprom.ar9300_eep;
3743 u8 tuning_caps_param = eep->baseEepHeader.params_for_tuning_caps[0];
3744
3745 if (eep->baseEepHeader.featureEnable & 0x40) {
3746 tuning_caps_param &= 0x7f;
3747 REG_RMW_FIELD(ah, AR_CH0_XTAL, AR_CH0_XTAL_CAPINDAC,
3748 tuning_caps_param);
3749 REG_RMW_FIELD(ah, AR_CH0_XTAL, AR_CH0_XTAL_CAPOUTDAC,
3750 tuning_caps_param);
3751 }
3752}
3753
3740static void ath9k_hw_ar9300_set_board_values(struct ath_hw *ah, 3754static void ath9k_hw_ar9300_set_board_values(struct ath_hw *ah,
3741 struct ath9k_channel *chan) 3755 struct ath9k_channel *chan)
3742{ 3756{
@@ -3745,6 +3759,8 @@ static void ath9k_hw_ar9300_set_board_values(struct ath_hw *ah,
3745 ar9003_hw_drive_strength_apply(ah); 3759 ar9003_hw_drive_strength_apply(ah);
3746 ar9003_hw_atten_apply(ah, chan); 3760 ar9003_hw_atten_apply(ah, chan);
3747 ar9003_hw_internal_regulator_apply(ah); 3761 ar9003_hw_internal_regulator_apply(ah);
3762 if (AR_SREV_9485(ah))
3763 ar9003_hw_apply_tuning_caps(ah);
3748} 3764}
3749 3765
3750static void ath9k_hw_ar9300_set_addac(struct ath_hw *ah, 3766static void ath9k_hw_ar9300_set_addac(struct ath_hw *ah,
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_phy.h b/drivers/net/wireless/ath/ath9k/ar9003_phy.h
index 8de3ffd5a92b..4c64eb1888a2 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_phy.h
+++ b/drivers/net/wireless/ath/ath9k/ar9003_phy.h
@@ -598,6 +598,12 @@
598#define AR_CH0_TOP2_XPABIASLVL 0xf000 598#define AR_CH0_TOP2_XPABIASLVL 0xf000
599#define AR_CH0_TOP2_XPABIASLVL_S 12 599#define AR_CH0_TOP2_XPABIASLVL_S 12
600 600
601#define AR_CH0_XTAL (AR_SREV_9485(ah) ? 0x16290 : 0x16294)
602#define AR_CH0_XTAL_CAPINDAC 0x7f000000
603#define AR_CH0_XTAL_CAPINDAC_S 24
604#define AR_CH0_XTAL_CAPOUTDAC 0x00fe0000
605#define AR_CH0_XTAL_CAPOUTDAC_S 17
606
601#define AR_PHY_PMU1 0x16c40 607#define AR_PHY_PMU1 0x16c40
602#define AR_PHY_PMU1_PWD 0x1 608#define AR_PHY_PMU1_PWD 0x1
603#define AR_PHY_PMU1_PWD_S 0 609#define AR_PHY_PMU1_PWD_S 0