diff options
author | Felix Fietkau <nbd@openwrt.org> | 2011-07-09 00:12:46 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-07-11 15:02:11 -0400 |
commit | 804f6acb7cea1ea5b3e0ded1bf037f9bf02f1124 (patch) | |
tree | 23a5ab51400ffb17de3e0d8c8f771c00b3e3774b /drivers | |
parent | cd27bc3c3efb95ee20e5b627c483eb9513cd0350 (diff) |
ath9k_hw: remove hardcoded PLL overrides for AR9280
Use the proper masks for the register instead.
Fixes adding the (still unused) half/quarter PLL flags.
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/ar9002_phy.c | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/drivers/net/wireless/ath/ath9k/ar9002_phy.c b/drivers/net/wireless/ath/ath9k/ar9002_phy.c index 2fe0a34cbabc..abc2cc8cefb7 100644 --- a/drivers/net/wireless/ath/ath9k/ar9002_phy.c +++ b/drivers/net/wireless/ath/ath9k/ar9002_phy.c | |||
@@ -447,26 +447,27 @@ static void ar9002_olc_init(struct ath_hw *ah) | |||
447 | static u32 ar9002_hw_compute_pll_control(struct ath_hw *ah, | 447 | static u32 ar9002_hw_compute_pll_control(struct ath_hw *ah, |
448 | struct ath9k_channel *chan) | 448 | struct ath9k_channel *chan) |
449 | { | 449 | { |
450 | int ref_div = 5; | ||
451 | int pll_div = 0x2c; | ||
450 | u32 pll; | 452 | u32 pll; |
451 | 453 | ||
452 | pll = SM(0x5, AR_RTC_9160_PLL_REFDIV); | 454 | if (chan && IS_CHAN_5GHZ(chan) && !IS_CHAN_A_FAST_CLOCK(ah, chan)) { |
455 | if (AR_SREV_9280_20(ah)) { | ||
456 | ref_div = 10; | ||
457 | pll_div = 0x50; | ||
458 | } else { | ||
459 | pll_div = 0x28; | ||
460 | } | ||
461 | } | ||
462 | |||
463 | pll = SM(ref_div, AR_RTC_9160_PLL_REFDIV); | ||
464 | pll |= SM(pll_div, AR_RTC_9160_PLL_DIV); | ||
453 | 465 | ||
454 | if (chan && IS_CHAN_HALF_RATE(chan)) | 466 | if (chan && IS_CHAN_HALF_RATE(chan)) |
455 | pll |= SM(0x1, AR_RTC_9160_PLL_CLKSEL); | 467 | pll |= SM(0x1, AR_RTC_9160_PLL_CLKSEL); |
456 | else if (chan && IS_CHAN_QUARTER_RATE(chan)) | 468 | else if (chan && IS_CHAN_QUARTER_RATE(chan)) |
457 | pll |= SM(0x2, AR_RTC_9160_PLL_CLKSEL); | 469 | pll |= SM(0x2, AR_RTC_9160_PLL_CLKSEL); |
458 | 470 | ||
459 | if (chan && IS_CHAN_5GHZ(chan)) { | ||
460 | if (IS_CHAN_A_FAST_CLOCK(ah, chan)) | ||
461 | pll = 0x142c; | ||
462 | else if (AR_SREV_9280_20(ah)) | ||
463 | pll = 0x2850; | ||
464 | else | ||
465 | pll |= SM(0x28, AR_RTC_9160_PLL_DIV); | ||
466 | } else { | ||
467 | pll |= SM(0x2c, AR_RTC_9160_PLL_DIV); | ||
468 | } | ||
469 | |||
470 | return pll; | 471 | return pll; |
471 | } | 472 | } |
472 | 473 | ||