Commit 22f25d0d authored by Vasanthakumar Thiagarajan's avatar Vasanthakumar Thiagarajan Committed by John W. Linville

ath9k: Determine btcoex scheme type based on chip version

Signed-off-by: default avatarVasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent f14462c6
...@@ -20,7 +20,14 @@ ...@@ -20,7 +20,14 @@
#define ATH_WLANACTIVE_GPIO 5 #define ATH_WLANACTIVE_GPIO 5
#define ATH_BTACTIVE_GPIO 6 #define ATH_BTACTIVE_GPIO 6
enum ath_btcoex_scheme {
ATH_BTCOEX_CFG_NONE,
ATH_BTCOEX_CFG_2WIRE,
ATH_BTCOEX_CFG_3WIRE,
};
struct ath_btcoex_info { struct ath_btcoex_info {
enum ath_btcoex_scheme btcoex_scheme;
u8 wlanactive_gpio; u8 wlanactive_gpio;
u8 btactive_gpio; u8 btactive_gpio;
}; };
......
...@@ -3489,6 +3489,7 @@ void ath9k_hw_fill_cap_info(struct ath_hw *ah) ...@@ -3489,6 +3489,7 @@ void ath9k_hw_fill_cap_info(struct ath_hw *ah)
{ {
struct ath9k_hw_capabilities *pCap = &ah->caps; struct ath9k_hw_capabilities *pCap = &ah->caps;
struct ath_regulatory *regulatory = ath9k_hw_regulatory(ah); struct ath_regulatory *regulatory = ath9k_hw_regulatory(ah);
struct ath_btcoex_info *btcoex_info = &ah->ah_sc->btcoex_info;
u16 capField = 0, eeval; u16 capField = 0, eeval;
...@@ -3666,8 +3667,15 @@ void ath9k_hw_fill_cap_info(struct ath_hw *ah) ...@@ -3666,8 +3667,15 @@ 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->ah_sc->btcoex_info.btactive_gpio = ATH_BTACTIVE_GPIO; btcoex_info->btactive_gpio = ATH_BTACTIVE_GPIO;
ah->ah_sc->btcoex_info.wlanactive_gpio = ATH_WLANACTIVE_GPIO; btcoex_info->wlanactive_gpio = ATH_WLANACTIVE_GPIO;
if (AR_SREV_9285(ah))
btcoex_info->btcoex_scheme = ATH_BTCOEX_CFG_3WIRE;
else
btcoex_info->btcoex_scheme = ATH_BTCOEX_CFG_2WIRE;
} else {
btcoex_info->btcoex_scheme = ATH_BTCOEX_CFG_NONE;
} }
} }
......
...@@ -1509,7 +1509,8 @@ static int ath_init_softc(u16 devid, struct ath_softc *sc) ...@@ -1509,7 +1509,8 @@ static int ath_init_softc(u16 devid, struct ath_softc *sc)
ARRAY_SIZE(ath9k_5ghz_chantable); ARRAY_SIZE(ath9k_5ghz_chantable);
} }
if (ah->caps.hw_caps & ATH9K_HW_CAP_BT_COEX) if ((ah->caps.hw_caps & ATH9K_HW_CAP_BT_COEX) &&
(sc->btcoex_info.btcoex_scheme == ATH_BTCOEX_CFG_2WIRE))
ath9k_hw_btcoex_init(ah); ath9k_hw_btcoex_init(ah);
return 0; return 0;
...@@ -1993,6 +1994,7 @@ static int ath9k_start(struct ieee80211_hw *hw) ...@@ -1993,6 +1994,7 @@ static int ath9k_start(struct ieee80211_hw *hw)
ieee80211_queue_delayed_work(sc->hw, &sc->tx_complete_work, 0); ieee80211_queue_delayed_work(sc->hw, &sc->tx_complete_work, 0);
if ((sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_BT_COEX) && if ((sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_BT_COEX) &&
(sc->btcoex_info.btcoex_scheme == ATH_BTCOEX_CFG_2WIRE) &&
!(sc->sc_flags & SC_OP_BTCOEX_ENABLED)) !(sc->sc_flags & SC_OP_BTCOEX_ENABLED))
ath9k_hw_btcoex_enable(sc->sc_ah); ath9k_hw_btcoex_enable(sc->sc_ah);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment