diff options
author | Sujith Manoharan <c_manoha@qca.qualcomm.com> | 2012-02-22 02:11:41 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-02-27 14:06:38 -0500 |
commit | cee5341d47fcd1cb79bbb71e430f502285fef8db (patch) | |
tree | 3cb0ae54d53e9e514839b8c828ea6cbda34566a7 /drivers/net/wireless/ath/ath9k | |
parent | bf047fcdaca3481fd6ce7d54011d2a774b8b7900 (diff) |
ath9k_htc: Init BTCOEX inside htc_drv_gpio.c
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath9k')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/htc.h | 1 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/htc_drv_gpio.c | 32 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/htc_drv_init.c | 32 |
3 files changed, 34 insertions, 31 deletions
diff --git a/drivers/net/wireless/ath/ath9k/htc.h b/drivers/net/wireless/ath/ath9k/htc.h index 71e877eb6dd..8046be66fa8 100644 --- a/drivers/net/wireless/ath/ath9k/htc.h +++ b/drivers/net/wireless/ath/ath9k/htc.h | |||
@@ -400,6 +400,7 @@ struct ath_btcoex { | |||
400 | u32 btscan_no_stomp; | 400 | u32 btscan_no_stomp; |
401 | }; | 401 | }; |
402 | 402 | ||
403 | void ath9k_htc_init_btcoex(struct ath9k_htc_priv *priv, char *product); | ||
403 | void ath9k_htc_start_btcoex(struct ath9k_htc_priv *priv); | 404 | void ath9k_htc_start_btcoex(struct ath9k_htc_priv *priv); |
404 | void ath9k_htc_stop_btcoex(struct ath9k_htc_priv *priv); | 405 | void ath9k_htc_stop_btcoex(struct ath9k_htc_priv *priv); |
405 | void ath_htc_init_btcoex_work(struct ath9k_htc_priv *priv); | 406 | void ath_htc_init_btcoex_work(struct ath9k_htc_priv *priv); |
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_gpio.c b/drivers/net/wireless/ath/ath9k/htc_drv_gpio.c index 82f02f769b5..2c61d363b00 100644 --- a/drivers/net/wireless/ath/ath9k/htc_drv_gpio.c +++ b/drivers/net/wireless/ath/ath9k/htc_drv_gpio.c | |||
@@ -20,6 +20,8 @@ | |||
20 | /* BTCOEX */ | 20 | /* BTCOEX */ |
21 | /******************/ | 21 | /******************/ |
22 | 22 | ||
23 | #define ATH_HTC_BTCOEX_PRODUCT_ID "wb193" | ||
24 | |||
23 | /* | 25 | /* |
24 | * Detects if there is any priority bt traffic | 26 | * Detects if there is any priority bt traffic |
25 | */ | 27 | */ |
@@ -184,6 +186,36 @@ void ath9k_htc_stop_btcoex(struct ath9k_htc_priv *priv) | |||
184 | } | 186 | } |
185 | } | 187 | } |
186 | 188 | ||
189 | void ath9k_htc_init_btcoex(struct ath9k_htc_priv *priv, char *product) | ||
190 | { | ||
191 | struct ath_hw *ah = priv->ah; | ||
192 | int qnum; | ||
193 | |||
194 | if (product && strncmp(product, ATH_HTC_BTCOEX_PRODUCT_ID, 5) == 0) { | ||
195 | ah->btcoex_hw.scheme = ATH_BTCOEX_CFG_3WIRE; | ||
196 | if (ath9k_hw_get_btcoex_scheme(ah) == ATH_BTCOEX_CFG_NONE) | ||
197 | return; | ||
198 | } | ||
199 | |||
200 | switch (ath9k_hw_get_btcoex_scheme(priv->ah)) { | ||
201 | case ATH_BTCOEX_CFG_NONE: | ||
202 | break; | ||
203 | case ATH_BTCOEX_CFG_3WIRE: | ||
204 | priv->ah->btcoex_hw.btactive_gpio = 7; | ||
205 | priv->ah->btcoex_hw.btpriority_gpio = 6; | ||
206 | priv->ah->btcoex_hw.wlanactive_gpio = 8; | ||
207 | priv->btcoex.bt_stomp_type = ATH_BTCOEX_STOMP_LOW; | ||
208 | ath9k_hw_btcoex_init_3wire(priv->ah); | ||
209 | ath_htc_init_btcoex_work(priv); | ||
210 | qnum = priv->hwq_map[WME_AC_BE]; | ||
211 | ath9k_hw_init_btcoex_hw(priv->ah, qnum); | ||
212 | break; | ||
213 | default: | ||
214 | WARN_ON(1); | ||
215 | break; | ||
216 | } | ||
217 | } | ||
218 | |||
187 | /*******/ | 219 | /*******/ |
188 | /* LED */ | 220 | /* LED */ |
189 | /*******/ | 221 | /*******/ |
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_init.c b/drivers/net/wireless/ath/ath9k/htc_drv_init.c index fc7519c9339..de5ee15ee63 100644 --- a/drivers/net/wireless/ath/ath9k/htc_drv_init.c +++ b/drivers/net/wireless/ath/ath9k/htc_drv_init.c | |||
@@ -41,8 +41,6 @@ MODULE_PARM_DESC(nohwcrypt, "Disable hardware encryption"); | |||
41 | .max_power = 20, \ | 41 | .max_power = 20, \ |
42 | } | 42 | } |
43 | 43 | ||
44 | #define ATH_HTC_BTCOEX_PRODUCT_ID "wb193" | ||
45 | |||
46 | static struct ieee80211_channel ath9k_2ghz_channels[] = { | 44 | static struct ieee80211_channel ath9k_2ghz_channels[] = { |
47 | CHAN2G(2412, 0), /* Channel 1 */ | 45 | CHAN2G(2412, 0), /* Channel 1 */ |
48 | CHAN2G(2417, 1), /* Channel 2 */ | 46 | CHAN2G(2417, 1), /* Channel 2 */ |
@@ -603,29 +601,6 @@ static void ath9k_init_misc(struct ath9k_htc_priv *priv) | |||
603 | priv->ah->opmode = NL80211_IFTYPE_STATION; | 601 | priv->ah->opmode = NL80211_IFTYPE_STATION; |
604 | } | 602 | } |
605 | 603 | ||
606 | static void ath9k_init_btcoex(struct ath9k_htc_priv *priv) | ||
607 | { | ||
608 | int qnum; | ||
609 | |||
610 | switch (ath9k_hw_get_btcoex_scheme(priv->ah)) { | ||
611 | case ATH_BTCOEX_CFG_NONE: | ||
612 | break; | ||
613 | case ATH_BTCOEX_CFG_3WIRE: | ||
614 | priv->ah->btcoex_hw.btactive_gpio = 7; | ||
615 | priv->ah->btcoex_hw.btpriority_gpio = 6; | ||
616 | priv->ah->btcoex_hw.wlanactive_gpio = 8; | ||
617 | priv->btcoex.bt_stomp_type = ATH_BTCOEX_STOMP_LOW; | ||
618 | ath9k_hw_btcoex_init_3wire(priv->ah); | ||
619 | ath_htc_init_btcoex_work(priv); | ||
620 | qnum = priv->hwq_map[WME_AC_BE]; | ||
621 | ath9k_hw_init_btcoex_hw(priv->ah, qnum); | ||
622 | break; | ||
623 | default: | ||
624 | WARN_ON(1); | ||
625 | break; | ||
626 | } | ||
627 | } | ||
628 | |||
629 | static int ath9k_init_priv(struct ath9k_htc_priv *priv, | 604 | static int ath9k_init_priv(struct ath9k_htc_priv *priv, |
630 | u16 devid, char *product, | 605 | u16 devid, char *product, |
631 | u32 drv_info) | 606 | u32 drv_info) |
@@ -698,12 +673,7 @@ static int ath9k_init_priv(struct ath9k_htc_priv *priv, | |||
698 | ath9k_cmn_init_crypto(ah); | 673 | ath9k_cmn_init_crypto(ah); |
699 | ath9k_init_channels_rates(priv); | 674 | ath9k_init_channels_rates(priv); |
700 | ath9k_init_misc(priv); | 675 | ath9k_init_misc(priv); |
701 | 676 | ath9k_htc_init_btcoex(priv, product); | |
702 | if (product && strncmp(product, ATH_HTC_BTCOEX_PRODUCT_ID, 5) == 0) { | ||
703 | ah->btcoex_hw.scheme = ATH_BTCOEX_CFG_3WIRE; | ||
704 | if (ath9k_hw_get_btcoex_scheme(ah) != ATH_BTCOEX_CFG_NONE) | ||
705 | ath9k_init_btcoex(priv); | ||
706 | } | ||
707 | 677 | ||
708 | return 0; | 678 | return 0; |
709 | 679 | ||