Skip to content

Commit 4e6ce4d

Browse files
Miaoqing Panlinvjw
Miaoqing Pan
authored andcommitted
ath9k: Fix RTC_DERIVED_CLK usage
Based on the reference clock, which could be 25MHz or 40MHz, AR_RTC_DERIVED_CLK is programmed differently for AR9340 and AR9550. But, when a chip reset is done, processing the initvals sets the register back to the default value. Fix this by moving the code in ath9k_hw_init_pll() to ar9003_hw_override_ini(). Also, do this override for AR9531. Cc: [email protected] Signed-off-by: Miaoqing Pan <[email protected]> Signed-off-by: Sujith Manoharan <[email protected]> Signed-off-by: John W. Linville <[email protected]>
1 parent 0cd75b1 commit 4e6ce4d

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

drivers/net/wireless/ath/ath9k/ar9003_phy.c

+13
Original file line numberDiff line numberDiff line change
@@ -664,6 +664,19 @@ static void ar9003_hw_override_ini(struct ath_hw *ah)
664664
ah->enabled_cals |= TX_CL_CAL;
665665
else
666666
ah->enabled_cals &= ~TX_CL_CAL;
667+
668+
if (AR_SREV_9340(ah) || AR_SREV_9531(ah) || AR_SREV_9550(ah)) {
669+
if (ah->is_clk_25mhz) {
670+
REG_WRITE(ah, AR_RTC_DERIVED_CLK, 0x17c << 1);
671+
REG_WRITE(ah, AR_SLP32_MODE, 0x0010f3d7);
672+
REG_WRITE(ah, AR_SLP32_INC, 0x0001e7ae);
673+
} else {
674+
REG_WRITE(ah, AR_RTC_DERIVED_CLK, 0x261 << 1);
675+
REG_WRITE(ah, AR_SLP32_MODE, 0x0010f400);
676+
REG_WRITE(ah, AR_SLP32_INC, 0x0001e800);
677+
}
678+
udelay(100);
679+
}
667680
}
668681

669682
static void ar9003_hw_prog_ini(struct ath_hw *ah,

drivers/net/wireless/ath/ath9k/hw.c

-13
Original file line numberDiff line numberDiff line change
@@ -861,19 +861,6 @@ static void ath9k_hw_init_pll(struct ath_hw *ah,
861861
udelay(RTC_PLL_SETTLE_DELAY);
862862

863863
REG_WRITE(ah, AR_RTC_SLEEP_CLK, AR_RTC_FORCE_DERIVED_CLK);
864-
865-
if (AR_SREV_9340(ah) || AR_SREV_9550(ah)) {
866-
if (ah->is_clk_25mhz) {
867-
REG_WRITE(ah, AR_RTC_DERIVED_CLK, 0x17c << 1);
868-
REG_WRITE(ah, AR_SLP32_MODE, 0x0010f3d7);
869-
REG_WRITE(ah, AR_SLP32_INC, 0x0001e7ae);
870-
} else {
871-
REG_WRITE(ah, AR_RTC_DERIVED_CLK, 0x261 << 1);
872-
REG_WRITE(ah, AR_SLP32_MODE, 0x0010f400);
873-
REG_WRITE(ah, AR_SLP32_INC, 0x0001e800);
874-
}
875-
udelay(100);
876-
}
877864
}
878865

879866
static void ath9k_hw_init_interrupt_masks(struct ath_hw *ah,

0 commit comments

Comments
 (0)