aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath9k/hw.c
diff options
context:
space:
mode:
authorVivek Natarajan <vnatarajan@atheros.com>2011-01-27 14:45:07 +0530
committerJohn W. Linville <linville@tuxdriver.com>2011-01-28 15:44:28 -0500
commitb141581923ab4904052174e3b4eb17cc3ce8632c (patch)
tree7b6249510e86a8e72cc10c73ab8e6eeecb631917 /drivers/net/wireless/ath/ath9k/hw.c
parent74f7635930bb157b2e83d38a68177a2b28138ead (diff)
downloadkernel_samsung_smdk4412-b141581923ab4904052174e3b4eb17cc3ce8632c.zip
kernel_samsung_smdk4412-b141581923ab4904052174e3b4eb17cc3ce8632c.tar.gz
kernel_samsung_smdk4412-b141581923ab4904052174e3b4eb17cc3ce8632c.tar.bz2
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.c13
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 48d121c..0e64d76 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)
REGWRITE_BUFFER_FLUSH(ah);
}
+unsigned long ar9003_get_pll_sqsum_dvc(struct ath_hw *ah)
+{
+ REG_WRITE(ah, PLL3, (REG_READ(ah, PLL3) & ~(PLL3_DO_MEAS_MASK)));
+ udelay(100);
+ REG_WRITE(ah, PLL3, (REG_READ(ah, PLL3) | PLL3_DO_MEAS_MASK));
+
+ while ((REG_READ(ah, PLL4) & PLL4_MEAS_DONE) == 0)
+ udelay(100);
+
+ return (REG_READ(ah, PLL3) & SQSUM_DVC_MASK) >> 3;
+}
+EXPORT_SYMBOL(ar9003_get_pll_sqsum_dvc);
+
static void ath9k_hw_init_pll(struct ath_hw *ah,
struct ath9k_channel *chan)
{