提交 cee5341d 编写于 作者: S Sujith Manoharan 提交者: John W. Linville

ath9k_htc: Init BTCOEX inside htc_drv_gpio.c

Signed-off-by: NSujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
上级 bf047fcd
...@@ -400,6 +400,7 @@ struct ath_btcoex { ...@@ -400,6 +400,7 @@ struct ath_btcoex {
u32 btscan_no_stomp; u32 btscan_no_stomp;
}; };
void ath9k_htc_init_btcoex(struct ath9k_htc_priv *priv, char *product);
void ath9k_htc_start_btcoex(struct ath9k_htc_priv *priv); void ath9k_htc_start_btcoex(struct ath9k_htc_priv *priv);
void ath9k_htc_stop_btcoex(struct ath9k_htc_priv *priv); void ath9k_htc_stop_btcoex(struct ath9k_htc_priv *priv);
void ath_htc_init_btcoex_work(struct ath9k_htc_priv *priv); void ath_htc_init_btcoex_work(struct ath9k_htc_priv *priv);
......
...@@ -20,6 +20,8 @@ ...@@ -20,6 +20,8 @@
/* BTCOEX */ /* BTCOEX */
/******************/ /******************/
#define ATH_HTC_BTCOEX_PRODUCT_ID "wb193"
/* /*
* Detects if there is any priority bt traffic * Detects if there is any priority bt traffic
*/ */
...@@ -184,6 +186,36 @@ void ath9k_htc_stop_btcoex(struct ath9k_htc_priv *priv) ...@@ -184,6 +186,36 @@ void ath9k_htc_stop_btcoex(struct ath9k_htc_priv *priv)
} }
} }
void ath9k_htc_init_btcoex(struct ath9k_htc_priv *priv, char *product)
{
struct ath_hw *ah = priv->ah;
int qnum;
if (product && strncmp(product, ATH_HTC_BTCOEX_PRODUCT_ID, 5) == 0) {
ah->btcoex_hw.scheme = ATH_BTCOEX_CFG_3WIRE;
if (ath9k_hw_get_btcoex_scheme(ah) == ATH_BTCOEX_CFG_NONE)
return;
}
switch (ath9k_hw_get_btcoex_scheme(priv->ah)) {
case ATH_BTCOEX_CFG_NONE:
break;
case ATH_BTCOEX_CFG_3WIRE:
priv->ah->btcoex_hw.btactive_gpio = 7;
priv->ah->btcoex_hw.btpriority_gpio = 6;
priv->ah->btcoex_hw.wlanactive_gpio = 8;
priv->btcoex.bt_stomp_type = ATH_BTCOEX_STOMP_LOW;
ath9k_hw_btcoex_init_3wire(priv->ah);
ath_htc_init_btcoex_work(priv);
qnum = priv->hwq_map[WME_AC_BE];
ath9k_hw_init_btcoex_hw(priv->ah, qnum);
break;
default:
WARN_ON(1);
break;
}
}
/*******/ /*******/
/* LED */ /* LED */
/*******/ /*******/
......
...@@ -41,8 +41,6 @@ MODULE_PARM_DESC(nohwcrypt, "Disable hardware encryption"); ...@@ -41,8 +41,6 @@ MODULE_PARM_DESC(nohwcrypt, "Disable hardware encryption");
.max_power = 20, \ .max_power = 20, \
} }
#define ATH_HTC_BTCOEX_PRODUCT_ID "wb193"
static struct ieee80211_channel ath9k_2ghz_channels[] = { static struct ieee80211_channel ath9k_2ghz_channels[] = {
CHAN2G(2412, 0), /* Channel 1 */ CHAN2G(2412, 0), /* Channel 1 */
CHAN2G(2417, 1), /* Channel 2 */ CHAN2G(2417, 1), /* Channel 2 */
...@@ -603,29 +601,6 @@ static void ath9k_init_misc(struct ath9k_htc_priv *priv) ...@@ -603,29 +601,6 @@ static void ath9k_init_misc(struct ath9k_htc_priv *priv)
priv->ah->opmode = NL80211_IFTYPE_STATION; priv->ah->opmode = NL80211_IFTYPE_STATION;
} }
static void ath9k_init_btcoex(struct ath9k_htc_priv *priv)
{
int qnum;
switch (ath9k_hw_get_btcoex_scheme(priv->ah)) {
case ATH_BTCOEX_CFG_NONE:
break;
case ATH_BTCOEX_CFG_3WIRE:
priv->ah->btcoex_hw.btactive_gpio = 7;
priv->ah->btcoex_hw.btpriority_gpio = 6;
priv->ah->btcoex_hw.wlanactive_gpio = 8;
priv->btcoex.bt_stomp_type = ATH_BTCOEX_STOMP_LOW;
ath9k_hw_btcoex_init_3wire(priv->ah);
ath_htc_init_btcoex_work(priv);
qnum = priv->hwq_map[WME_AC_BE];
ath9k_hw_init_btcoex_hw(priv->ah, qnum);
break;
default:
WARN_ON(1);
break;
}
}
static int ath9k_init_priv(struct ath9k_htc_priv *priv, static int ath9k_init_priv(struct ath9k_htc_priv *priv,
u16 devid, char *product, u16 devid, char *product,
u32 drv_info) u32 drv_info)
...@@ -698,12 +673,7 @@ static int ath9k_init_priv(struct ath9k_htc_priv *priv, ...@@ -698,12 +673,7 @@ static int ath9k_init_priv(struct ath9k_htc_priv *priv,
ath9k_cmn_init_crypto(ah); ath9k_cmn_init_crypto(ah);
ath9k_init_channels_rates(priv); ath9k_init_channels_rates(priv);
ath9k_init_misc(priv); ath9k_init_misc(priv);
ath9k_htc_init_btcoex(priv, product);
if (product && strncmp(product, ATH_HTC_BTCOEX_PRODUCT_ID, 5) == 0) {
ah->btcoex_hw.scheme = ATH_BTCOEX_CFG_3WIRE;
if (ath9k_hw_get_btcoex_scheme(ah) != ATH_BTCOEX_CFG_NONE)
ath9k_init_btcoex(priv);
}
return 0; return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册