]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
ath5k: Do ADC test during reset
authorNick Kossifidis <mick@madwifi.org>
Sun, 20 Jul 2008 03:38:16 +0000 (06:38 +0300)
committerJohn W. Linville <linville@tuxdriver.com>
Fri, 1 Aug 2008 19:31:32 +0000 (15:31 -0400)
 * Do an ADC test during reset to match recent regdumps

Changes-licensed-under: ISC
Signed-off-by: Nick Kossifidis <mickflemm@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/ath5k/hw.c

index dc51b844c62d5c673a4fcd579a1c8ce524b0ce77..3937e46e47350803b007c1c8aee42127de8e8822 100644 (file)
@@ -1078,6 +1078,19 @@ int ath5k_hw_reset(struct ath5k_hw *ah, enum ieee80211_if_types op_mode,
                mdelay(1);
        }
 
+       /*
+        * Perform ADC test (?)
+        */
+       data = ath5k_hw_reg_read(ah, AR5K_PHY_TST1);
+       ath5k_hw_reg_write(ah, AR5K_PHY_TST1_TXHOLD, AR5K_PHY_TST1);
+       for (i = 0; i <= 20; i++) {
+               if (!(ath5k_hw_reg_read(ah, AR5K_PHY_ADC_TEST) & 0x10))
+                       break;
+               udelay(200);
+       }
+       ath5k_hw_reg_write(ah, data, AR5K_PHY_TST1);
+       data = 0;
+
        /*
         * Enable calibration and wait until completion
         */