Skip to contentSkip to conversation

ath9k_hw: Program correct PLL value for AR9565

RFC In review Sujith Manoharan 2 participants 3 messages Sep 8, 2012 Qualcomm Atheros ATH9K wireless driver

lore
Share & tools
lore
#0 lore raw

RFC 6/7 ath9k_hw: Program correct PLL value for AR9565

---
 drivers/net/wireless/ath/ath9k/hw.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
drivers/net/wireless/ath/ath9k/hw.c +7 -3
index 063d724..07dd330 100644
@@ -837,6 +837,9 @@ static void ath9k_hw_init_pll(struct ath_hw *ah,
 		REG_RMW_FIELD(ah, AR_CH0_BB_DPLL2,
 			      AR_CH0_BB_DPLL2_PLL_PWD, 0x0);
 		udelay(1000);
+
+		if (AR_SREV_9565(ah))
+			REG_WRITE(ah, AR_RTC_PLL_CONTROL, 0x4142c);
 	} else if (AR_SREV_9330(ah)) {
 		u32 ddr_dpll2, pll_control2, kd;
 
@@ -917,9 +920,10 @@ static void ath9k_hw_init_pll(struct ath_hw *ah,
 		udelay(1000);
 	}
 
-	pll = ath9k_hw_compute_pll_control(ah, chan);
-
-	REG_WRITE(ah, AR_RTC_PLL_CONTROL, pll);
+	if (!AR_SREV_9565(ah)) {
+		pll = ath9k_hw_compute_pll_control(ah, chan);
+		REG_WRITE(ah, AR_RTC_PLL_CONTROL, pll);
+	}
 
 	if (AR_SREV_9485(ah) || AR_SREV_9340(ah) || AR_SREV_9330(ah) ||
 	    AR_SREV_9550(ah))
Signature · 1 line
1.7.12
#1 lore raw
Quoted 20 lines · Sujith Manoharan
---
 drivers/net/wireless/ath/ath9k/hw.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
drivers/net/wireless/ath/ath9k/hw.c +3 -0
index 063d724..07dd330 100644
@@ -837,6 +837,9 @@ static void ath9k_hw_init_pll(struct ath_hw *ah,
 		REG_RMW_FIELD(ah, AR_CH0_BB_DPLL2,
 			      AR_CH0_BB_DPLL2_PLL_PWD, 0x0);
 		udelay(1000);
+
+		if (AR_SREV_9565(ah))
+			REG_WRITE(ah, AR_RTC_PLL_CONTROL, 0x4142c);
 	} else if (AR_SREV_9330(ah)) {
 		u32 ddr_dpll2, pll_control2, kd;
 

drivers/net/wireless/ath/ath9k/hw.c static void ath9k_hw_init_pll(struct ath_hw *ah, · line 926

Quoted 10 lines
drivers/net/wireless/ath/ath9k/hw.c +4 -3
@@ -917,9 +920,10 @@ static void ath9k_hw_init_pll(struct ath_hw *ah,
 		udelay(1000);
 	}
 
-	pll = ath9k_hw_compute_pll_control(ah, chan);
-
-	REG_WRITE(ah, AR_RTC_PLL_CONTROL, pll);
+	if (!AR_SREV_9565(ah)) {
+		pll = ath9k_hw_compute_pll_control(ah, chan);
+		REG_WRITE(ah, AR_RTC_PLL_CONTROL, pll);
+	}

That looks messed up, how about just:

	pll = ath9k_hw_compute_pll_control(ah, chan);
	if (AR_SREV_9565(ah))
		pll |= 0x40000;
	REG_WRITE(ah, AR_RTC_PLL_CONTROL, pll);

Or alternatively move that OR mask into ath9k_hw_compute_pll_control

- Felix

#2 lore raw
Quoted 8 lines · Felix Fietkau

That looks messed up, how about just:

	pll = ath9k_hw_compute_pll_control(ah, chan);
	if (AR_SREV_9565(ah))
		pll |= 0x40000;
	REG_WRITE(ah, AR_RTC_PLL_CONTROL, pll);

Or alternatively move that OR mask into ath9k_hw_compute_pll_control

[RFC v2] ath9k_hw: Program correct PLL value for AR9565

---
 drivers/net/wireless/ath/ath9k/hw.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/wireless/ath/ath9k/hw.c +2 -1
index 063d724..47de1a9 100644
@@ -918,7 +918,8 @@ static void ath9k_hw_init_pll(struct ath_hw *ah,
 	}
 
 	pll = ath9k_hw_compute_pll_control(ah, chan);
-
+	if (AR_SREV_9565(ah))
+		pll |= 0x40000;
 	REG_WRITE(ah, AR_RTC_PLL_CONTROL, pll);
 
 	if (AR_SREV_9485(ah) || AR_SREV_9340(ah) || AR_SREV_9330(ah) ||
Signature · 1 line
1.7.12