diff options
author | Vasanthakumar Thiagarajan <vasanth@atheros.com> | 2009-08-26 11:38:46 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-08-28 14:40:49 -0400 |
commit | f14462c6661c6b9e91d436f7ab66b35ed52ea703 (patch) | |
tree | 9127982bad569b7798ca8d038b5a6e38e1acca40 /drivers/net/wireless | |
parent | 42cc41edf24b75fc6c37c99aed6e85455687e080 (diff) |
ath9k: Move btcoex related data to a separate struct
Also define macros for wlanactive and btactive (5 & 6) gpios.
Signed-off-by: Vasanthakumar Thiagarajan <vasanth@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/ath9k.h | 1 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/btcoex.c | 16 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/btcoex.h | 8 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/hw.c | 4 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/hw.h | 2 |
5 files changed, 22 insertions, 9 deletions
diff --git a/drivers/net/wireless/ath/ath9k/ath9k.h b/drivers/net/wireless/ath/ath9k/ath9k.h index 1a8d67997667..83f2c8fa8879 100644 --- a/drivers/net/wireless/ath/ath9k/ath9k.h +++ b/drivers/net/wireless/ath/ath9k/ath9k.h | |||
@@ -611,6 +611,7 @@ struct ath_softc { | |||
611 | struct ath_bus_ops *bus_ops; | 611 | struct ath_bus_ops *bus_ops; |
612 | struct ath_beacon_config cur_beacon_conf; | 612 | struct ath_beacon_config cur_beacon_conf; |
613 | struct delayed_work tx_complete_work; | 613 | struct delayed_work tx_complete_work; |
614 | struct ath_btcoex_info btcoex_info; | ||
614 | }; | 615 | }; |
615 | 616 | ||
616 | struct ath_wiphy { | 617 | struct ath_wiphy { |
diff --git a/drivers/net/wireless/ath/ath9k/btcoex.c b/drivers/net/wireless/ath/ath9k/btcoex.c index abaf92d8074c..9f19cd1c1bef 100644 --- a/drivers/net/wireless/ath/ath9k/btcoex.c +++ b/drivers/net/wireless/ath/ath9k/btcoex.c | |||
@@ -18,6 +18,8 @@ | |||
18 | 18 | ||
19 | void ath9k_hw_btcoex_init(struct ath_hw *ah) | 19 | void ath9k_hw_btcoex_init(struct ath_hw *ah) |
20 | { | 20 | { |
21 | struct ath_btcoex_info *btcoex_info = &ah->ah_sc->btcoex_info; | ||
22 | |||
21 | /* connect bt_active to baseband */ | 23 | /* connect bt_active to baseband */ |
22 | REG_CLR_BIT(ah, AR_GPIO_INPUT_EN_VAL, | 24 | REG_CLR_BIT(ah, AR_GPIO_INPUT_EN_VAL, |
23 | (AR_GPIO_INPUT_EN_VAL_BT_PRIORITY_DEF | | 25 | (AR_GPIO_INPUT_EN_VAL_BT_PRIORITY_DEF | |
@@ -29,16 +31,18 @@ void ath9k_hw_btcoex_init(struct ath_hw *ah) | |||
29 | /* Set input mux for bt_active to gpio pin */ | 31 | /* Set input mux for bt_active to gpio pin */ |
30 | REG_RMW_FIELD(ah, AR_GPIO_INPUT_MUX1, | 32 | REG_RMW_FIELD(ah, AR_GPIO_INPUT_MUX1, |
31 | AR_GPIO_INPUT_MUX1_BT_ACTIVE, | 33 | AR_GPIO_INPUT_MUX1_BT_ACTIVE, |
32 | ah->btactive_gpio); | 34 | btcoex_info->btactive_gpio); |
33 | 35 | ||
34 | /* Configure the desired gpio port for input */ | 36 | /* Configure the desired gpio port for input */ |
35 | ath9k_hw_cfg_gpio_input(ah, ah->btactive_gpio); | 37 | ath9k_hw_cfg_gpio_input(ah, btcoex_info->btactive_gpio); |
36 | } | 38 | } |
37 | 39 | ||
38 | void ath9k_hw_btcoex_enable(struct ath_hw *ah) | 40 | void ath9k_hw_btcoex_enable(struct ath_hw *ah) |
39 | { | 41 | { |
42 | struct ath_btcoex_info *btcoex_info = &ah->ah_sc->btcoex_info; | ||
43 | |||
40 | /* Configure the desired GPIO port for TX_FRAME output */ | 44 | /* Configure the desired GPIO port for TX_FRAME output */ |
41 | ath9k_hw_cfg_output(ah, ah->wlanactive_gpio, | 45 | ath9k_hw_cfg_output(ah, btcoex_info->wlanactive_gpio, |
42 | AR_GPIO_OUTPUT_MUX_AS_TX_FRAME); | 46 | AR_GPIO_OUTPUT_MUX_AS_TX_FRAME); |
43 | 47 | ||
44 | ah->ah_sc->sc_flags |= SC_OP_BTCOEX_ENABLED; | 48 | ah->ah_sc->sc_flags |= SC_OP_BTCOEX_ENABLED; |
@@ -46,9 +50,11 @@ void ath9k_hw_btcoex_enable(struct ath_hw *ah) | |||
46 | 50 | ||
47 | void ath9k_hw_btcoex_disable(struct ath_hw *ah) | 51 | void ath9k_hw_btcoex_disable(struct ath_hw *ah) |
48 | { | 52 | { |
49 | ath9k_hw_set_gpio(ah, ah->wlanactive_gpio, 0); | 53 | struct ath_btcoex_info *btcoex_info = &ah->ah_sc->btcoex_info; |
54 | |||
55 | ath9k_hw_set_gpio(ah, btcoex_info->wlanactive_gpio, 0); | ||
50 | 56 | ||
51 | ath9k_hw_cfg_output(ah, ah->wlanactive_gpio, | 57 | ath9k_hw_cfg_output(ah, btcoex_info->wlanactive_gpio, |
52 | AR_GPIO_OUTPUT_MUX_AS_OUTPUT); | 58 | AR_GPIO_OUTPUT_MUX_AS_OUTPUT); |
53 | 59 | ||
54 | ah->ah_sc->sc_flags &= ~SC_OP_BTCOEX_ENABLED; | 60 | ah->ah_sc->sc_flags &= ~SC_OP_BTCOEX_ENABLED; |
diff --git a/drivers/net/wireless/ath/ath9k/btcoex.h b/drivers/net/wireless/ath/ath9k/btcoex.h index 99542808b8ef..c80492bac768 100644 --- a/drivers/net/wireless/ath/ath9k/btcoex.h +++ b/drivers/net/wireless/ath/ath9k/btcoex.h | |||
@@ -17,6 +17,14 @@ | |||
17 | #ifndef BTCOEX_H | 17 | #ifndef BTCOEX_H |
18 | #define BTCOEX_H | 18 | #define BTCOEX_H |
19 | 19 | ||
20 | #define ATH_WLANACTIVE_GPIO 5 | ||
21 | #define ATH_BTACTIVE_GPIO 6 | ||
22 | |||
23 | struct ath_btcoex_info { | ||
24 | u8 wlanactive_gpio; | ||
25 | u8 btactive_gpio; | ||
26 | }; | ||
27 | |||
20 | void ath9k_hw_btcoex_init(struct ath_hw *ah); | 28 | void ath9k_hw_btcoex_init(struct ath_hw *ah); |
21 | void ath9k_hw_btcoex_enable(struct ath_hw *ah); | 29 | void ath9k_hw_btcoex_enable(struct ath_hw *ah); |
22 | void ath9k_hw_btcoex_disable(struct ath_hw *ah); | 30 | void ath9k_hw_btcoex_disable(struct ath_hw *ah); |
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c index d7e03f9788c0..3bb6abd7b2b6 100644 --- a/drivers/net/wireless/ath/ath9k/hw.c +++ b/drivers/net/wireless/ath/ath9k/hw.c | |||
@@ -3666,8 +3666,8 @@ void ath9k_hw_fill_cap_info(struct ath_hw *ah) | |||
3666 | 3666 | ||
3667 | if (AR_SREV_9280_10_OR_LATER(ah) && btcoex_enable) { | 3667 | if (AR_SREV_9280_10_OR_LATER(ah) && btcoex_enable) { |
3668 | pCap->hw_caps |= ATH9K_HW_CAP_BT_COEX; | 3668 | pCap->hw_caps |= ATH9K_HW_CAP_BT_COEX; |
3669 | ah->btactive_gpio = 6; | 3669 | ah->ah_sc->btcoex_info.btactive_gpio = ATH_BTACTIVE_GPIO; |
3670 | ah->wlanactive_gpio = 5; | 3670 | ah->ah_sc->btcoex_info.wlanactive_gpio = ATH_WLANACTIVE_GPIO; |
3671 | } | 3671 | } |
3672 | } | 3672 | } |
3673 | 3673 | ||
diff --git a/drivers/net/wireless/ath/ath9k/hw.h b/drivers/net/wireless/ath/ath9k/hw.h index 32f7c4b86ed3..259936c90467 100644 --- a/drivers/net/wireless/ath/ath9k/hw.h +++ b/drivers/net/wireless/ath/ath9k/hw.h | |||
@@ -414,8 +414,6 @@ struct ath_hw { | |||
414 | u16 rfsilent; | 414 | u16 rfsilent; |
415 | u32 rfkill_gpio; | 415 | u32 rfkill_gpio; |
416 | u32 rfkill_polarity; | 416 | u32 rfkill_polarity; |
417 | u32 btactive_gpio; | ||
418 | u32 wlanactive_gpio; | ||
419 | u32 ah_flags; | 417 | u32 ah_flags; |
420 | 418 | ||
421 | bool htc_reset_init; | 419 | bool htc_reset_init; |