diff options
author | Vivek Natarajan <vnatarajan@atheros.com> | 2011-01-27 04:15:07 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-01-28 15:44:28 -0500 |
commit | b141581923ab4904052174e3b4eb17cc3ce8632c (patch) | |
tree | 7b6249510e86a8e72cc10c73ab8e6eeecb631917 /drivers/net/wireless/ath/ath9k/hw.c | |
parent | 74f7635930bb157b2e83d38a68177a2b28138ead (diff) |
ath9k_hw: Add a function to read sqsum_dvc.
Add a function to observe the delta VC of BB_PLL.
For a good chip, the sqsum_dvc is below 2000.
Signed-off-by: Vivek Natarajan <vnatarajan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/hw.c')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/hw.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c index 48d121c24eb7..0e64d7666057 100644 --- a/drivers/net/wireless/ath/ath9k/hw.c +++ b/drivers/net/wireless/ath/ath9k/hw.c | |||
@@ -668,6 +668,19 @@ static void ath9k_hw_init_qos(struct ath_hw *ah) | |||
668 | REGWRITE_BUFFER_FLUSH(ah); | 668 | REGWRITE_BUFFER_FLUSH(ah); |
669 | } | 669 | } |
670 | 670 | ||
671 | unsigned long ar9003_get_pll_sqsum_dvc(struct ath_hw *ah) | ||
672 | { | ||
673 | REG_WRITE(ah, PLL3, (REG_READ(ah, PLL3) & ~(PLL3_DO_MEAS_MASK))); | ||
674 | udelay(100); | ||
675 | REG_WRITE(ah, PLL3, (REG_READ(ah, PLL3) | PLL3_DO_MEAS_MASK)); | ||
676 | |||
677 | while ((REG_READ(ah, PLL4) & PLL4_MEAS_DONE) == 0) | ||
678 | udelay(100); | ||
679 | |||
680 | return (REG_READ(ah, PLL3) & SQSUM_DVC_MASK) >> 3; | ||
681 | } | ||
682 | EXPORT_SYMBOL(ar9003_get_pll_sqsum_dvc); | ||
683 | |||
671 | static void ath9k_hw_init_pll(struct ath_hw *ah, | 684 | static void ath9k_hw_init_pll(struct ath_hw *ah, |
672 | struct ath9k_channel *chan) | 685 | struct ath9k_channel *chan) |
673 | { | 686 | { |