aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless
diff options
context:
space:
mode:
authorSujith <Sujith.Manoharan@atheros.com>2010-03-17 04:55:15 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-03-23 16:50:12 -0400
commit5b5fa3558db7451f4744ef92f2b1830d05b9307b (patch)
tree33a4fc2b6d2a2aac98538f9d95ef6d161400e537 /drivers/net/wireless
parent70807e99dbb0c5847668b617caf0ad7f876a23d9 (diff)
ath9k_hw: add GPIO setup code for AR9271
Assign the proper number of GPIO pins for AR9271. 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>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r--drivers/net/wireless/ath/ath9k/hw.c11
-rw-r--r--drivers/net/wireless/ath/ath9k/reg.h3
2 files changed, 12 insertions, 2 deletions
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c
index 9de46036db0e..7b1ba6fa4bec 100644
--- a/drivers/net/wireless/ath/ath9k/hw.c
+++ b/drivers/net/wireless/ath/ath9k/hw.c
@@ -3229,7 +3229,9 @@ int ath9k_hw_fill_cap_info(struct ath_hw *ah)
3229 else 3229 else
3230 pCap->tx_triglevel_max = MAX_TX_FIFO_THRESHOLD; 3230 pCap->tx_triglevel_max = MAX_TX_FIFO_THRESHOLD;
3231 3231
3232 if (AR_SREV_9285_10_OR_LATER(ah)) 3232 if (AR_SREV_9271(ah))
3233 pCap->num_gpio_pins = AR9271_NUM_GPIO;
3234 else if (AR_SREV_9285_10_OR_LATER(ah))
3233 pCap->num_gpio_pins = AR9285_NUM_GPIO; 3235 pCap->num_gpio_pins = AR9285_NUM_GPIO;
3234 else if (AR_SREV_9280_10_OR_LATER(ah)) 3236 else if (AR_SREV_9280_10_OR_LATER(ah))
3235 pCap->num_gpio_pins = AR928X_NUM_GPIO; 3237 pCap->num_gpio_pins = AR928X_NUM_GPIO;
@@ -3465,7 +3467,9 @@ u32 ath9k_hw_gpio_get(struct ath_hw *ah, u32 gpio)
3465 if (gpio >= ah->caps.num_gpio_pins) 3467 if (gpio >= ah->caps.num_gpio_pins)
3466 return 0xffffffff; 3468 return 0xffffffff;
3467 3469
3468 if (AR_SREV_9287_10_OR_LATER(ah)) 3470 if (AR_SREV_9271(ah))
3471 return MS_REG_READ(AR9271, gpio) != 0;
3472 else if (AR_SREV_9287_10_OR_LATER(ah))
3469 return MS_REG_READ(AR9287, gpio) != 0; 3473 return MS_REG_READ(AR9287, gpio) != 0;
3470 else if (AR_SREV_9285_10_OR_LATER(ah)) 3474 else if (AR_SREV_9285_10_OR_LATER(ah))
3471 return MS_REG_READ(AR9285, gpio) != 0; 3475 return MS_REG_READ(AR9285, gpio) != 0;
@@ -3494,6 +3498,9 @@ EXPORT_SYMBOL(ath9k_hw_cfg_output);
3494 3498
3495void ath9k_hw_set_gpio(struct ath_hw *ah, u32 gpio, u32 val) 3499void ath9k_hw_set_gpio(struct ath_hw *ah, u32 gpio, u32 val)
3496{ 3500{
3501 if (AR_SREV_9271(ah))
3502 val = ~val;
3503
3497 REG_RMW(ah, AR_GPIO_IN_OUT, ((val & 1) << gpio), 3504 REG_RMW(ah, AR_GPIO_IN_OUT, ((val & 1) << gpio),
3498 AR_GPIO_BIT(gpio)); 3505 AR_GPIO_BIT(gpio));
3499} 3506}
diff --git a/drivers/net/wireless/ath/ath9k/reg.h b/drivers/net/wireless/ath/ath9k/reg.h
index 72cfa8ebd9ae..198e41dd38a6 100644
--- a/drivers/net/wireless/ath/ath9k/reg.h
+++ b/drivers/net/wireless/ath/ath9k/reg.h
@@ -940,6 +940,7 @@ enum {
940#define AR928X_NUM_GPIO 10 940#define AR928X_NUM_GPIO 10
941#define AR9285_NUM_GPIO 12 941#define AR9285_NUM_GPIO 12
942#define AR9287_NUM_GPIO 11 942#define AR9287_NUM_GPIO 11
943#define AR9271_NUM_GPIO 16
943 944
944#define AR_GPIO_IN_OUT 0x4048 945#define AR_GPIO_IN_OUT 0x4048
945#define AR_GPIO_IN_VAL 0x0FFFC000 946#define AR_GPIO_IN_VAL 0x0FFFC000
@@ -950,6 +951,8 @@ enum {
950#define AR9285_GPIO_IN_VAL_S 12 951#define AR9285_GPIO_IN_VAL_S 12
951#define AR9287_GPIO_IN_VAL 0x003FF800 952#define AR9287_GPIO_IN_VAL 0x003FF800
952#define AR9287_GPIO_IN_VAL_S 11 953#define AR9287_GPIO_IN_VAL_S 11
954#define AR9271_GPIO_IN_VAL 0xFFFF0000
955#define AR9271_GPIO_IN_VAL_S 16
953 956
954#define AR_GPIO_OE_OUT 0x404c 957#define AR_GPIO_OE_OUT 0x404c
955#define AR_GPIO_OE_OUT_DRV 0x3 958#define AR_GPIO_OE_OUT_DRV 0x3