ath9k_hw: always set the core clock for AR9271
authorSujith <Sujith.Manoharan@atheros.com>
Wed, 17 Mar 2010 08:55:22 +0000 (14:25 +0530)
committerJohn W. Linville <linville@tuxdriver.com>
Tue, 23 Mar 2010 20:50:16 +0000 (16:50 -0400)
When initializing the PLL on AR9271 we always need
to set the core clock to 117MHz. While at it remove
the baud rate settings for the serial device on the
AR9271, the default settings work well unless you
want to customize it.

Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/ath/ath9k/hw.c

index 023c38b..5bc5f5f 100644 (file)
@@ -1006,22 +1006,6 @@ static void ath9k_hw_init_qos(struct ath_hw *ah)
        REG_WRITE(ah, AR_TXOP_12_15, 0xFFFFFFFF);
 }
 
-static void ath9k_hw_change_target_baud(struct ath_hw *ah, u32 freq, u32 baud)
-{
-       u32 lcr;
-       u32 baud_divider = freq * 1000 * 1000 / 16 / baud;
-
-       lcr = REG_READ(ah , 0x5100c);
-       lcr |= 0x80;
-
-       REG_WRITE(ah, 0x5100c, lcr);
-       REG_WRITE(ah, 0x51004, (baud_divider >> 8));
-       REG_WRITE(ah, 0x51000, (baud_divider & 0xff));
-
-       lcr &= ~0x80;
-       REG_WRITE(ah, 0x5100c, lcr);
-}
-
 static void ath9k_hw_init_pll(struct ath_hw *ah,
                              struct ath9k_channel *chan)
 {
@@ -1087,22 +1071,8 @@ static void ath9k_hw_init_pll(struct ath_hw *ah,
 
        /* Switch the core clock for ar9271 to 117Mhz */
        if (AR_SREV_9271(ah)) {
-               if ((pll == 0x142c) || (pll == 0x2850) ) {
-                       udelay(500);
-                       /* set CLKOBS to output AHB clock */
-                       REG_WRITE(ah, 0x7020, 0xe);
-                       /*
-                        * 0x304: 117Mhz, ahb_ratio: 1x1
-                        * 0x306: 40Mhz, ahb_ratio: 1x1
-                        */
-                       REG_WRITE(ah, 0x50040, 0x304);
-                       /*
-                        * makes adjustments for the baud dividor to keep the
-                        * targetted baud rate based on the used core clock.
-                        */
-                       ath9k_hw_change_target_baud(ah, AR9271_CORE_CLOCK,
-                                                   AR9271_TARGET_BAUD_RATE);
-               }
+               udelay(500);
+               REG_WRITE(ah, 0x50040, 0x304);
        }
 
        udelay(RTC_PLL_SETTLE_DELAY);