diff options
author | Felix Fietkau <nbd@openwrt.org> | 2010-04-15 17:38:34 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-04-16 15:43:23 -0400 |
commit | 317d33280c63f32bd84c49aacaaae047e981b441 (patch) | |
tree | 7a473c49289a5b26a189ecbfb2546d6ad1500283 /drivers/net/wireless/ath/ath9k/ar9003_phy.c | |
parent | f7abf0c1958ab363874cad0d799a1bb43880145a (diff) |
ath9k_hw: Implement PLL control on AR9003
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
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/ar9003_phy.c')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/ar9003_phy.c | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_phy.c b/drivers/net/wireless/ath/ath9k/ar9003_phy.c index f1632abdce50..9767265cde02 100644 --- a/drivers/net/wireless/ath/ath9k/ar9003_phy.c +++ b/drivers/net/wireless/ath/ath9k/ar9003_phy.c | |||
@@ -112,8 +112,27 @@ static void ar9003_hw_spur_mitigate(struct ath_hw *ah, | |||
112 | static u32 ar9003_hw_compute_pll_control(struct ath_hw *ah, | 112 | static u32 ar9003_hw_compute_pll_control(struct ath_hw *ah, |
113 | struct ath9k_channel *chan) | 113 | struct ath9k_channel *chan) |
114 | { | 114 | { |
115 | /* TODO */ | 115 | u32 pll; |
116 | return 0; | 116 | |
117 | pll = SM(0x5, AR_RTC_9300_PLL_REFDIV); | ||
118 | |||
119 | if (chan && IS_CHAN_HALF_RATE(chan)) | ||
120 | pll |= SM(0x1, AR_RTC_9300_PLL_CLKSEL); | ||
121 | else if (chan && IS_CHAN_QUARTER_RATE(chan)) | ||
122 | pll |= SM(0x2, AR_RTC_9300_PLL_CLKSEL); | ||
123 | |||
124 | if (chan && IS_CHAN_5GHZ(chan)) { | ||
125 | pll |= SM(0x28, AR_RTC_9300_PLL_DIV); | ||
126 | |||
127 | /* | ||
128 | * When doing fast clock, set PLL to 0x142c | ||
129 | */ | ||
130 | if (IS_CHAN_A_5MHZ_SPACED(chan)) | ||
131 | pll = 0x142c; | ||
132 | } else | ||
133 | pll |= SM(0x2c, AR_RTC_9300_PLL_DIV); | ||
134 | |||
135 | return pll; | ||
117 | } | 136 | } |
118 | 137 | ||
119 | static void ar9003_hw_set_channel_regs(struct ath_hw *ah, | 138 | static void ar9003_hw_set_channel_regs(struct ath_hw *ah, |