aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorVasanthakumar Thiagarajan <vasanth@atheros.com>2010-12-01 02:24:09 -0500
committerJohn W. Linville <linville@tuxdriver.com>2010-12-02 14:10:33 -0500
commit9306990a656d9cfd8bf3586938012729c1f2ea50 (patch)
treedf06e13f81915f3d6443df640116d0c61c747634 /drivers/net
parent1937721f5637b53c794124cf4fd9edad0eb315ef (diff)
ath9k: Fix bug in reading input gpio state for ar9003
The register which gives input gpio state is 0x404c for ar9003, currently 0x4048 is wrongly used. This will disable RF and make it unusable on some of AR9003. Cc:stable@kernel.org Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/wireless/ath/ath9k/hw.c3
-rw-r--r--drivers/net/wireless/ath/ath9k/reg.h6
2 files changed, 6 insertions, 3 deletions
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c
index 6ebc68bca91f..c7fbe25cc128 100644
--- a/drivers/net/wireless/ath/ath9k/hw.c
+++ b/drivers/net/wireless/ath/ath9k/hw.c
@@ -2044,7 +2044,8 @@ u32 ath9k_hw_gpio_get(struct ath_hw *ah, u32 gpio)
2044 val = REG_READ(ah, AR7010_GPIO_IN); 2044 val = REG_READ(ah, AR7010_GPIO_IN);
2045 return (MS(val, AR7010_GPIO_IN_VAL) & AR_GPIO_BIT(gpio)) == 0; 2045 return (MS(val, AR7010_GPIO_IN_VAL) & AR_GPIO_BIT(gpio)) == 0;
2046 } else if (AR_SREV_9300_20_OR_LATER(ah)) 2046 } else if (AR_SREV_9300_20_OR_LATER(ah))
2047 return MS_REG_READ(AR9300, gpio) != 0; 2047 return (MS(REG_READ(ah, AR_GPIO_IN), AR9300_GPIO_IN_VAL) &
2048 AR_GPIO_BIT(gpio)) != 0;
2048 else if (AR_SREV_9271(ah)) 2049 else if (AR_SREV_9271(ah))
2049 return MS_REG_READ(AR9271, gpio) != 0; 2050 return MS_REG_READ(AR9271, gpio) != 0;
2050 else if (AR_SREV_9287_11_OR_LATER(ah)) 2051 else if (AR_SREV_9287_11_OR_LATER(ah))
diff --git a/drivers/net/wireless/ath/ath9k/reg.h b/drivers/net/wireless/ath/ath9k/reg.h
index dddf579aacf1..2c6a22fbb0f0 100644
--- a/drivers/net/wireless/ath/ath9k/reg.h
+++ b/drivers/net/wireless/ath/ath9k/reg.h
@@ -984,11 +984,13 @@ enum {
984#define AR9287_GPIO_IN_VAL_S 11 984#define AR9287_GPIO_IN_VAL_S 11
985#define AR9271_GPIO_IN_VAL 0xFFFF0000 985#define AR9271_GPIO_IN_VAL 0xFFFF0000
986#define AR9271_GPIO_IN_VAL_S 16 986#define AR9271_GPIO_IN_VAL_S 16
987#define AR9300_GPIO_IN_VAL 0x0001FFFF
988#define AR9300_GPIO_IN_VAL_S 0
989#define AR7010_GPIO_IN_VAL 0x0000FFFF 987#define AR7010_GPIO_IN_VAL 0x0000FFFF
990#define AR7010_GPIO_IN_VAL_S 0 988#define AR7010_GPIO_IN_VAL_S 0
991 989
990#define AR_GPIO_IN 0x404c
991#define AR9300_GPIO_IN_VAL 0x0001FFFF
992#define AR9300_GPIO_IN_VAL_S 0
993
992#define AR_GPIO_OE_OUT (AR_SREV_9300_20_OR_LATER(ah) ? 0x4050 : 0x404c) 994#define AR_GPIO_OE_OUT (AR_SREV_9300_20_OR_LATER(ah) ? 0x4050 : 0x404c)
993#define AR_GPIO_OE_OUT_DRV 0x3 995#define AR_GPIO_OE_OUT_DRV 0x3
994#define AR_GPIO_OE_OUT_DRV_NO 0x0 996#define AR_GPIO_OE_OUT_DRV_NO 0x0