aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGabor Juhos <juhosg@openwrt.org>2011-06-21 05:23:50 -0400
committerJohn W. Linville <linville@tuxdriver.com>2011-06-22 16:09:57 -0400
commit4187afa29a73fec1f68243c03437e7c1b37f315d (patch)
tree3e1cd7d1b0b44f24bc7dbec049015b1619d0e2ca
parent7b09e49ec822fe2bee34b45af89c72beed254a23 (diff)
ath9k: configure internal regulator for AR9330
Signed-off-by: Gabor Juhos <juhosg@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/ath/ath9k/ar9003_eeprom.c25
1 files changed, 20 insertions, 5 deletions
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
index 666a1743801..1d09f22fee4 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
+++ b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
@@ -3712,7 +3712,7 @@ static void ar9003_hw_internal_regulator_apply(struct ath_hw *ah)
3712 ath9k_hw_ar9300_get_eeprom(ah, EEP_INTERNAL_REGULATOR); 3712 ath9k_hw_ar9300_get_eeprom(ah, EEP_INTERNAL_REGULATOR);
3713 3713
3714 if (internal_regulator) { 3714 if (internal_regulator) {
3715 if (AR_SREV_9485(ah)) { 3715 if (AR_SREV_9330(ah) || AR_SREV_9485(ah)) {
3716 int reg_pmu_set; 3716 int reg_pmu_set;
3717 3717
3718 reg_pmu_set = REG_READ(ah, AR_PHY_PMU2) & ~AR_PHY_PMU2_PGM; 3718 reg_pmu_set = REG_READ(ah, AR_PHY_PMU2) & ~AR_PHY_PMU2_PGM;
@@ -3720,9 +3720,24 @@ static void ar9003_hw_internal_regulator_apply(struct ath_hw *ah)
3720 if (!is_pmu_set(ah, AR_PHY_PMU2, reg_pmu_set)) 3720 if (!is_pmu_set(ah, AR_PHY_PMU2, reg_pmu_set))
3721 return; 3721 return;
3722 3722
3723 reg_pmu_set = (5 << 1) | (7 << 4) | (1 << 8) | 3723 if (AR_SREV_9330(ah)) {
3724 (2 << 14) | (6 << 17) | (1 << 20) | 3724 if (ah->is_clk_25mhz) {
3725 (3 << 24) | (1 << 28); 3725 reg_pmu_set = (3 << 1) | (8 << 4) |
3726 (3 << 8) | (1 << 14) |
3727 (6 << 17) | (1 << 20) |
3728 (3 << 24);
3729 } else {
3730 reg_pmu_set = (4 << 1) | (7 << 4) |
3731 (3 << 8) | (1 << 14) |
3732 (6 << 17) | (1 << 20) |
3733 (3 << 24);
3734 }
3735 } else {
3736 reg_pmu_set = (5 << 1) | (7 << 4) |
3737 (1 << 8) | (2 << 14) |
3738 (6 << 17) | (1 << 20) |
3739 (3 << 24) | (1 << 28);
3740 }
3726 3741
3727 REG_WRITE(ah, AR_PHY_PMU1, reg_pmu_set); 3742 REG_WRITE(ah, AR_PHY_PMU1, reg_pmu_set);
3728 if (!is_pmu_set(ah, AR_PHY_PMU1, reg_pmu_set)) 3743 if (!is_pmu_set(ah, AR_PHY_PMU1, reg_pmu_set))
@@ -3753,7 +3768,7 @@ static void ar9003_hw_internal_regulator_apply(struct ath_hw *ah)
3753 AR_RTC_REG_CONTROL1_SWREG_PROGRAM); 3768 AR_RTC_REG_CONTROL1_SWREG_PROGRAM);
3754 } 3769 }
3755 } else { 3770 } else {
3756 if (AR_SREV_9485(ah)) { 3771 if (AR_SREV_9330(ah) || AR_SREV_9485(ah)) {
3757 REG_RMW_FIELD(ah, AR_PHY_PMU2, AR_PHY_PMU2_PGM, 0); 3772 REG_RMW_FIELD(ah, AR_PHY_PMU2, AR_PHY_PMU2_PGM, 0);
3758 while (REG_READ_FIELD(ah, AR_PHY_PMU2, 3773 while (REG_READ_FIELD(ah, AR_PHY_PMU2,
3759 AR_PHY_PMU2_PGM)) 3774 AR_PHY_PMU2_PGM))