ath9k: Move BTCOEX init/deinit functions to gpio.c
authorSujith Manoharan <c_manoha@qca.qualcomm.com>
Wed, 22 Feb 2012 07:10:21 +0000 (12:40 +0530)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 27 Feb 2012 19:06:33 +0000 (14:06 -0500)
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/ath/ath9k/ath9k.h
drivers/net/wireless/ath/ath9k/gpio.c
drivers/net/wireless/ath/ath9k/init.c

index 171ccf7c972ff1cc228dca2019122ff6e79bdc0c..aa609832e06fe82b9ff6787ba00c986071819802 100644 (file)
@@ -454,6 +454,8 @@ struct ath_btcoex {
        struct ath_mci_profile mci;
 };
 
+int ath9k_init_btcoex(struct ath_softc *sc);
+void ath9k_deinit_btcoex(struct ath_softc *sc);
 int ath_init_btcoex_timer(struct ath_softc *sc);
 void ath9k_btcoex_timer_resume(struct ath_softc *sc);
 void ath9k_btcoex_timer_pause(struct ath_softc *sc);
index 597c84e31adb3b30a69ea7beb4f91b9890a2a662..ef23624518b502ca4c0ff52ffed0cae4e32bcf8a 100644 (file)
@@ -317,3 +317,54 @@ void ath9k_btcoex_timer_pause(struct ath_softc *sc)
 
        btcoex->hw_timer_enabled = false;
 }
+
+void ath9k_deinit_btcoex(struct ath_softc *sc)
+{
+        if ((sc->btcoex.no_stomp_timer) &&
+           ath9k_hw_get_btcoex_scheme(sc->sc_ah) == ATH_BTCOEX_CFG_3WIRE)
+               ath_gen_timer_free(sc->sc_ah, sc->btcoex.no_stomp_timer);
+
+       if (ath9k_hw_get_btcoex_scheme(sc->sc_ah) == ATH_BTCOEX_CFG_MCI)
+               ath_mci_cleanup(sc);
+}
+
+int ath9k_init_btcoex(struct ath_softc *sc)
+{
+       struct ath_txq *txq;
+       struct ath_hw *ah = sc->sc_ah;
+       int r;
+
+       switch (ath9k_hw_get_btcoex_scheme(sc->sc_ah)) {
+       case ATH_BTCOEX_CFG_NONE:
+               break;
+       case ATH_BTCOEX_CFG_2WIRE:
+               ath9k_hw_btcoex_init_2wire(sc->sc_ah);
+               break;
+       case ATH_BTCOEX_CFG_3WIRE:
+               ath9k_hw_btcoex_init_3wire(sc->sc_ah);
+               r = ath_init_btcoex_timer(sc);
+               if (r)
+                       return -1;
+               txq = sc->tx.txq_map[WME_AC_BE];
+               ath9k_hw_init_btcoex_hw(sc->sc_ah, txq->axq_qnum);
+               sc->btcoex.bt_stomp_type = ATH_BTCOEX_STOMP_LOW;
+               break;
+       case ATH_BTCOEX_CFG_MCI:
+               sc->btcoex.bt_stomp_type = ATH_BTCOEX_STOMP_LOW;
+               sc->btcoex.duty_cycle = ATH_BTCOEX_DEF_DUTY_CYCLE;
+               INIT_LIST_HEAD(&sc->btcoex.mci.info);
+
+               r = ath_mci_setup(sc);
+               if (r)
+                       return r;
+
+               ath9k_hw_btcoex_init_mci(ah);
+
+               break;
+       default:
+               WARN_ON(1);
+               break;
+       }
+
+       return 0;
+}
index a944fc95f69f9b020402b1c6c1795e740f39753b..d8b05961f7e35e22dfea73e480f0e195e48e40c1 100644 (file)
@@ -419,47 +419,6 @@ fail:
        return error;
 }
 
-static int ath9k_init_btcoex(struct ath_softc *sc)
-{
-       struct ath_txq *txq;
-       struct ath_hw *ah = sc->sc_ah;
-       int r;
-
-       switch (ath9k_hw_get_btcoex_scheme(sc->sc_ah)) {
-       case ATH_BTCOEX_CFG_NONE:
-               break;
-       case ATH_BTCOEX_CFG_2WIRE:
-               ath9k_hw_btcoex_init_2wire(sc->sc_ah);
-               break;
-       case ATH_BTCOEX_CFG_3WIRE:
-               ath9k_hw_btcoex_init_3wire(sc->sc_ah);
-               r = ath_init_btcoex_timer(sc);
-               if (r)
-                       return -1;
-               txq = sc->tx.txq_map[WME_AC_BE];
-               ath9k_hw_init_btcoex_hw(sc->sc_ah, txq->axq_qnum);
-               sc->btcoex.bt_stomp_type = ATH_BTCOEX_STOMP_LOW;
-               break;
-       case ATH_BTCOEX_CFG_MCI:
-               sc->btcoex.bt_stomp_type = ATH_BTCOEX_STOMP_LOW;
-               sc->btcoex.duty_cycle = ATH_BTCOEX_DEF_DUTY_CYCLE;
-               INIT_LIST_HEAD(&sc->btcoex.mci.info);
-
-               r = ath_mci_setup(sc);
-               if (r)
-                       return r;
-
-               ath9k_hw_btcoex_init_mci(ah);
-
-               break;
-       default:
-               WARN_ON(1);
-               break;
-       }
-
-       return 0;
-}
-
 static int ath9k_init_queues(struct ath_softc *sc)
 {
        int i = 0;
@@ -861,12 +820,7 @@ static void ath9k_deinit_softc(struct ath_softc *sc)
        if (sc->sbands[IEEE80211_BAND_5GHZ].channels)
                kfree(sc->sbands[IEEE80211_BAND_5GHZ].channels);
 
-        if ((sc->btcoex.no_stomp_timer) &&
-           ath9k_hw_get_btcoex_scheme(sc->sc_ah) == ATH_BTCOEX_CFG_3WIRE)
-               ath_gen_timer_free(sc->sc_ah, sc->btcoex.no_stomp_timer);
-
-       if (ath9k_hw_get_btcoex_scheme(sc->sc_ah) == ATH_BTCOEX_CFG_MCI)
-               ath_mci_cleanup(sc);
+       ath9k_deinit_btcoex(sc);
 
        for (i = 0; i < ATH9K_NUM_TX_QUEUES; i++)
                if (ATH_TXQ_SETUP(sc, i))