aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath9k/gpio.c
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2011-12-17 16:47:56 +0100
committerJohn W. Linville <linville@tuxdriver.com>2011-12-19 14:46:55 -0500
commit8a30930563521c9dba73c93b5631be1d0993f78f (patch)
tree859d5bd92689fc934aa6c7eea98f1d37891fb293 /drivers/net/wireless/ath/ath9k/gpio.c
parentb43: N-PHY: reorder functions: random cleanups (diff)
downloadlinux-dev-8a30930563521c9dba73c93b5631be1d0993f78f.tar.xz
linux-dev-8a30930563521c9dba73c93b5631be1d0993f78f.zip
ath9k_hw: make bluetooth coexistence support optional at compile time
Many systems (e.g. embedded systems) do not have wifi modules connected to bluetooth modules, so bluetooth coexistence is irrelevant there. With the addition of MCI support, ath9k picked up quite a bit of extra code that can be compiled out this way. This patch redefines ATH9K_HW_CAP_MCI and adds an inline wrapper for querying the bluetooth coexistence scheme, allowing the compiler to eliminate code that uses it, with only very little use of #ifdef. On MIPS this reduces the total size for the modules by about 20k. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/gpio.c')
-rw-r--r--drivers/net/wireless/ath/ath9k/gpio.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath/ath9k/gpio.c b/drivers/net/wireless/ath/ath9k/gpio.c
index 7834d70a190d..597c84e31adb 100644
--- a/drivers/net/wireless/ath/ath9k/gpio.c
+++ b/drivers/net/wireless/ath/ath9k/gpio.c
@@ -249,6 +249,9 @@ int ath_init_btcoex_timer(struct ath_softc *sc)
{
struct ath_btcoex *btcoex = &sc->btcoex;
+ if (ath9k_hw_get_btcoex_scheme(sc->sc_ah) == ATH_BTCOEX_CFG_NONE)
+ return 0;
+
btcoex->btcoex_period = ATH_BTCOEX_DEF_BT_PERIOD * 1000;
btcoex->btcoex_no_stomp = (100 - ATH_BTCOEX_DEF_DUTY_CYCLE) *
btcoex->btcoex_period / 100;
@@ -281,6 +284,9 @@ void ath9k_btcoex_timer_resume(struct ath_softc *sc)
ath_dbg(ath9k_hw_common(ah), BTCOEX, "Starting btcoex timers\n");
+ if (ath9k_hw_get_btcoex_scheme(ah) == ATH_BTCOEX_CFG_NONE)
+ return;
+
/* make sure duty cycle timer is also stopped when resuming */
if (btcoex->hw_timer_enabled)
ath9k_gen_timer_stop(sc->sc_ah, btcoex->no_stomp_timer);
@@ -301,6 +307,9 @@ void ath9k_btcoex_timer_pause(struct ath_softc *sc)
struct ath_btcoex *btcoex = &sc->btcoex;
struct ath_hw *ah = sc->sc_ah;
+ if (ath9k_hw_get_btcoex_scheme(ah) == ATH_BTCOEX_CFG_NONE)
+ return;
+
del_timer_sync(&btcoex->period_timer);
if (btcoex->hw_timer_enabled)