diff options
author | Felix Fietkau <nbd@openwrt.org> | 2011-07-11 21:02:03 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-07-13 14:49:40 -0400 |
commit | f00643888ca435ce6934482243733cc140281d10 (patch) | |
tree | 55b14b466411b529a17830738dac49c95f898a96 /drivers | |
parent | fe00deb3e4b50eede61cc7d4ab9bce7911f0a074 (diff) |
ath5k: fix reference clock usec duration setting restore
enabling the sleep clock alters the AR5K_USEC_32 field, but disabling
it didn't restore it.
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Acked-by: Nick Kossifidis <mickflemm@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/ath/ath5k/reset.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/drivers/net/wireless/ath/ath5k/reset.c b/drivers/net/wireless/ath/ath5k/reset.c index 57f2e56bc064..0e89fc9a75a7 100644 --- a/drivers/net/wireless/ath/ath5k/reset.c +++ b/drivers/net/wireless/ath/ath5k/reset.c | |||
@@ -142,6 +142,7 @@ static void ath5k_hw_init_core_clock(struct ath5k_hw *ah) | |||
142 | 142 | ||
143 | /* Set 32MHz USEC counter */ | 143 | /* Set 32MHz USEC counter */ |
144 | if ((ah->ah_radio == AR5K_RF5112) || | 144 | if ((ah->ah_radio == AR5K_RF5112) || |
145 | (ah->ah_radio == AR5K_RF2413) || | ||
145 | (ah->ah_radio == AR5K_RF5413) || | 146 | (ah->ah_radio == AR5K_RF5413) || |
146 | (ah->ah_radio == AR5K_RF2316) || | 147 | (ah->ah_radio == AR5K_RF2316) || |
147 | (ah->ah_radio == AR5K_RF2317)) | 148 | (ah->ah_radio == AR5K_RF2317)) |
@@ -233,7 +234,7 @@ static void ath5k_hw_init_core_clock(struct ath5k_hw *ah) | |||
233 | static void ath5k_hw_set_sleep_clock(struct ath5k_hw *ah, bool enable) | 234 | static void ath5k_hw_set_sleep_clock(struct ath5k_hw *ah, bool enable) |
234 | { | 235 | { |
235 | struct ath5k_eeprom_info *ee = &ah->ah_capabilities.cap_eeprom; | 236 | struct ath5k_eeprom_info *ee = &ah->ah_capabilities.cap_eeprom; |
236 | u32 scal, spending; | 237 | u32 scal, spending, sclock; |
237 | 238 | ||
238 | /* Only set 32KHz settings if we have an external | 239 | /* Only set 32KHz settings if we have an external |
239 | * 32KHz crystal present */ | 240 | * 32KHz crystal present */ |
@@ -317,6 +318,15 @@ static void ath5k_hw_set_sleep_clock(struct ath5k_hw *ah, bool enable) | |||
317 | 318 | ||
318 | /* Set up tsf increment on each cycle */ | 319 | /* Set up tsf increment on each cycle */ |
319 | AR5K_REG_WRITE_BITS(ah, AR5K_TSF_PARM, AR5K_TSF_PARM_INC, 1); | 320 | AR5K_REG_WRITE_BITS(ah, AR5K_TSF_PARM, AR5K_TSF_PARM_INC, 1); |
321 | |||
322 | if ((ah->ah_radio == AR5K_RF5112) || | ||
323 | (ah->ah_radio == AR5K_RF5413) || | ||
324 | (ah->ah_radio == AR5K_RF2316) || | ||
325 | (ah->ah_radio == AR5K_RF2317)) | ||
326 | sclock = 40 - 1; | ||
327 | else | ||
328 | sclock = 32 - 1; | ||
329 | AR5K_REG_WRITE_BITS(ah, AR5K_USEC_5211, AR5K_USEC_32, sclock); | ||
320 | } | 330 | } |
321 | } | 331 | } |
322 | 332 | ||