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>
This commit is contained in:
committed by
John W. Linville
parent
42cc41edf2
commit
f14462c666
@@ -611,6 +611,7 @@ struct ath_softc {
|
|||||||
struct ath_bus_ops *bus_ops;
|
struct ath_bus_ops *bus_ops;
|
||||||
struct ath_beacon_config cur_beacon_conf;
|
struct ath_beacon_config cur_beacon_conf;
|
||||||
struct delayed_work tx_complete_work;
|
struct delayed_work tx_complete_work;
|
||||||
|
struct ath_btcoex_info btcoex_info;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct ath_wiphy {
|
struct ath_wiphy {
|
||||||
|
@@ -18,6 +18,8 @@
|
|||||||
|
|
||||||
void ath9k_hw_btcoex_init(struct ath_hw *ah)
|
void ath9k_hw_btcoex_init(struct ath_hw *ah)
|
||||||
{
|
{
|
||||||
|
struct ath_btcoex_info *btcoex_info = &ah->ah_sc->btcoex_info;
|
||||||
|
|
||||||
/* connect bt_active to baseband */
|
/* connect bt_active to baseband */
|
||||||
REG_CLR_BIT(ah, AR_GPIO_INPUT_EN_VAL,
|
REG_CLR_BIT(ah, AR_GPIO_INPUT_EN_VAL,
|
||||||
(AR_GPIO_INPUT_EN_VAL_BT_PRIORITY_DEF |
|
(AR_GPIO_INPUT_EN_VAL_BT_PRIORITY_DEF |
|
||||||
@@ -29,16 +31,18 @@ void ath9k_hw_btcoex_init(struct ath_hw *ah)
|
|||||||
/* Set input mux for bt_active to gpio pin */
|
/* Set input mux for bt_active to gpio pin */
|
||||||
REG_RMW_FIELD(ah, AR_GPIO_INPUT_MUX1,
|
REG_RMW_FIELD(ah, AR_GPIO_INPUT_MUX1,
|
||||||
AR_GPIO_INPUT_MUX1_BT_ACTIVE,
|
AR_GPIO_INPUT_MUX1_BT_ACTIVE,
|
||||||
ah->btactive_gpio);
|
btcoex_info->btactive_gpio);
|
||||||
|
|
||||||
/* Configure the desired gpio port for input */
|
/* Configure the desired gpio port for input */
|
||||||
ath9k_hw_cfg_gpio_input(ah, ah->btactive_gpio);
|
ath9k_hw_cfg_gpio_input(ah, btcoex_info->btactive_gpio);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ath9k_hw_btcoex_enable(struct ath_hw *ah)
|
void ath9k_hw_btcoex_enable(struct ath_hw *ah)
|
||||||
{
|
{
|
||||||
|
struct ath_btcoex_info *btcoex_info = &ah->ah_sc->btcoex_info;
|
||||||
|
|
||||||
/* Configure the desired GPIO port for TX_FRAME output */
|
/* Configure the desired GPIO port for TX_FRAME output */
|
||||||
ath9k_hw_cfg_output(ah, ah->wlanactive_gpio,
|
ath9k_hw_cfg_output(ah, btcoex_info->wlanactive_gpio,
|
||||||
AR_GPIO_OUTPUT_MUX_AS_TX_FRAME);
|
AR_GPIO_OUTPUT_MUX_AS_TX_FRAME);
|
||||||
|
|
||||||
ah->ah_sc->sc_flags |= SC_OP_BTCOEX_ENABLED;
|
ah->ah_sc->sc_flags |= SC_OP_BTCOEX_ENABLED;
|
||||||
@@ -46,9 +50,11 @@ void ath9k_hw_btcoex_enable(struct ath_hw *ah)
|
|||||||
|
|
||||||
void ath9k_hw_btcoex_disable(struct ath_hw *ah)
|
void ath9k_hw_btcoex_disable(struct ath_hw *ah)
|
||||||
{
|
{
|
||||||
ath9k_hw_set_gpio(ah, ah->wlanactive_gpio, 0);
|
struct ath_btcoex_info *btcoex_info = &ah->ah_sc->btcoex_info;
|
||||||
|
|
||||||
ath9k_hw_cfg_output(ah, ah->wlanactive_gpio,
|
ath9k_hw_set_gpio(ah, btcoex_info->wlanactive_gpio, 0);
|
||||||
|
|
||||||
|
ath9k_hw_cfg_output(ah, btcoex_info->wlanactive_gpio,
|
||||||
AR_GPIO_OUTPUT_MUX_AS_OUTPUT);
|
AR_GPIO_OUTPUT_MUX_AS_OUTPUT);
|
||||||
|
|
||||||
ah->ah_sc->sc_flags &= ~SC_OP_BTCOEX_ENABLED;
|
ah->ah_sc->sc_flags &= ~SC_OP_BTCOEX_ENABLED;
|
||||||
|
@@ -17,6 +17,14 @@
|
|||||||
#ifndef BTCOEX_H
|
#ifndef BTCOEX_H
|
||||||
#define BTCOEX_H
|
#define BTCOEX_H
|
||||||
|
|
||||||
|
#define ATH_WLANACTIVE_GPIO 5
|
||||||
|
#define ATH_BTACTIVE_GPIO 6
|
||||||
|
|
||||||
|
struct ath_btcoex_info {
|
||||||
|
u8 wlanactive_gpio;
|
||||||
|
u8 btactive_gpio;
|
||||||
|
};
|
||||||
|
|
||||||
void ath9k_hw_btcoex_init(struct ath_hw *ah);
|
void ath9k_hw_btcoex_init(struct ath_hw *ah);
|
||||||
void ath9k_hw_btcoex_enable(struct ath_hw *ah);
|
void ath9k_hw_btcoex_enable(struct ath_hw *ah);
|
||||||
void ath9k_hw_btcoex_disable(struct ath_hw *ah);
|
void ath9k_hw_btcoex_disable(struct ath_hw *ah);
|
||||||
|
@@ -3666,8 +3666,8 @@ void ath9k_hw_fill_cap_info(struct ath_hw *ah)
|
|||||||
|
|
||||||
if (AR_SREV_9280_10_OR_LATER(ah) && btcoex_enable) {
|
if (AR_SREV_9280_10_OR_LATER(ah) && btcoex_enable) {
|
||||||
pCap->hw_caps |= ATH9K_HW_CAP_BT_COEX;
|
pCap->hw_caps |= ATH9K_HW_CAP_BT_COEX;
|
||||||
ah->btactive_gpio = 6;
|
ah->ah_sc->btcoex_info.btactive_gpio = ATH_BTACTIVE_GPIO;
|
||||||
ah->wlanactive_gpio = 5;
|
ah->ah_sc->btcoex_info.wlanactive_gpio = ATH_WLANACTIVE_GPIO;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -414,8 +414,6 @@ struct ath_hw {
|
|||||||
u16 rfsilent;
|
u16 rfsilent;
|
||||||
u32 rfkill_gpio;
|
u32 rfkill_gpio;
|
||||||
u32 rfkill_polarity;
|
u32 rfkill_polarity;
|
||||||
u32 btactive_gpio;
|
|
||||||
u32 wlanactive_gpio;
|
|
||||||
u32 ah_flags;
|
u32 ah_flags;
|
||||||
|
|
||||||
bool htc_reset_init;
|
bool htc_reset_init;
|
||||||
|
Reference in New Issue
Block a user