aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSujith Manoharan <c_manoha@qca.qualcomm.com>2015-03-01 01:23:48 -0500
committerKalle Valo <kvalo@codeaurora.org>2015-03-03 08:46:57 -0500
commitc7266e99b1b0242496557b19a978d748e12a580b (patch)
tree1cef60e935d86550486f91c780a7d42381a83c45
parent30b818989100830273c03439e363ff420c78e964 (diff)
ath9k: Handle timers for MCI
Make sure that the btcoex timers are started/stopped properly for both 3-wire and MCI schemes. Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
-rw-r--r--drivers/net/wireless/ath/ath9k/gpio.c52
1 files changed, 31 insertions, 21 deletions
diff --git a/drivers/net/wireless/ath/ath9k/gpio.c b/drivers/net/wireless/ath/ath9k/gpio.c
index b4a0612f943b..6e22d8085810 100644
--- a/drivers/net/wireless/ath/ath9k/gpio.c
+++ b/drivers/net/wireless/ath/ath9k/gpio.c
@@ -298,6 +298,10 @@ void ath9k_btcoex_timer_resume(struct ath_softc *sc)
298 struct ath_btcoex *btcoex = &sc->btcoex; 298 struct ath_btcoex *btcoex = &sc->btcoex;
299 struct ath_hw *ah = sc->sc_ah; 299 struct ath_hw *ah = sc->sc_ah;
300 300
301 if (ath9k_hw_get_btcoex_scheme(ah) != ATH_BTCOEX_CFG_3WIRE &&
302 ath9k_hw_get_btcoex_scheme(ah) != ATH_BTCOEX_CFG_MCI)
303 return;
304
301 ath_dbg(ath9k_hw_common(ah), BTCOEX, "Starting btcoex timers\n"); 305 ath_dbg(ath9k_hw_common(ah), BTCOEX, "Starting btcoex timers\n");
302 306
303 /* make sure duty cycle timer is also stopped when resuming */ 307 /* make sure duty cycle timer is also stopped when resuming */
@@ -311,13 +315,19 @@ void ath9k_btcoex_timer_resume(struct ath_softc *sc)
311 mod_timer(&btcoex->period_timer, jiffies); 315 mod_timer(&btcoex->period_timer, jiffies);
312} 316}
313 317
314
315/* 318/*
316 * Pause btcoex timer and bt duty cycle timer 319 * Pause btcoex timer and bt duty cycle timer
317 */ 320 */
318void ath9k_btcoex_timer_pause(struct ath_softc *sc) 321void ath9k_btcoex_timer_pause(struct ath_softc *sc)
319{ 322{
320 struct ath_btcoex *btcoex = &sc->btcoex; 323 struct ath_btcoex *btcoex = &sc->btcoex;
324 struct ath_hw *ah = sc->sc_ah;
325
326 if (ath9k_hw_get_btcoex_scheme(ah) != ATH_BTCOEX_CFG_3WIRE &&
327 ath9k_hw_get_btcoex_scheme(ah) != ATH_BTCOEX_CFG_MCI)
328 return;
329
330 ath_dbg(ath9k_hw_common(ah), BTCOEX, "Stopping btcoex timers\n");
321 331
322 del_timer_sync(&btcoex->period_timer); 332 del_timer_sync(&btcoex->period_timer);
323 del_timer_sync(&btcoex->no_stomp_timer); 333 del_timer_sync(&btcoex->no_stomp_timer);
@@ -355,33 +365,33 @@ void ath9k_start_btcoex(struct ath_softc *sc)
355{ 365{
356 struct ath_hw *ah = sc->sc_ah; 366 struct ath_hw *ah = sc->sc_ah;
357 367
358 if ((ath9k_hw_get_btcoex_scheme(ah) != ATH_BTCOEX_CFG_NONE) && 368 if (ah->btcoex_hw.enabled ||
359 !ah->btcoex_hw.enabled) { 369 ath9k_hw_get_btcoex_scheme(ah) == ATH_BTCOEX_CFG_NONE)
360 if (!(sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_MCI)) 370 return;
361 ath9k_hw_btcoex_set_weight(ah, AR_BT_COEX_WGHT,
362 AR_STOMP_LOW_WLAN_WGHT, 0);
363 else
364 ath9k_hw_btcoex_set_weight(ah, 0, 0,
365 ATH_BTCOEX_STOMP_NONE);
366 ath9k_hw_btcoex_enable(ah);
367 371
368 if (ath9k_hw_get_btcoex_scheme(ah) == ATH_BTCOEX_CFG_3WIRE) 372 if (!(ah->caps.hw_caps & ATH9K_HW_CAP_MCI))
369 ath9k_btcoex_timer_resume(sc); 373 ath9k_hw_btcoex_set_weight(ah, AR_BT_COEX_WGHT,
370 } 374 AR_STOMP_LOW_WLAN_WGHT, 0);
375 else
376 ath9k_hw_btcoex_set_weight(ah, 0, 0,
377 ATH_BTCOEX_STOMP_NONE);
378 ath9k_hw_btcoex_enable(ah);
379 ath9k_btcoex_timer_resume(sc);
371} 380}
372 381
373void ath9k_stop_btcoex(struct ath_softc *sc) 382void ath9k_stop_btcoex(struct ath_softc *sc)
374{ 383{
375 struct ath_hw *ah = sc->sc_ah; 384 struct ath_hw *ah = sc->sc_ah;
376 385
377 if (ah->btcoex_hw.enabled && 386 if (!ah->btcoex_hw.enabled ||
378 ath9k_hw_get_btcoex_scheme(ah) != ATH_BTCOEX_CFG_NONE) { 387 ath9k_hw_get_btcoex_scheme(ah) == ATH_BTCOEX_CFG_NONE)
379 if (ath9k_hw_get_btcoex_scheme(ah) == ATH_BTCOEX_CFG_3WIRE) 388 return;
380 ath9k_btcoex_timer_pause(sc); 389
381 ath9k_hw_btcoex_disable(ah); 390 ath9k_btcoex_timer_pause(sc);
382 if (AR_SREV_9462(ah) || AR_SREV_9565(ah)) 391 ath9k_hw_btcoex_disable(ah);
383 ath_mci_flush_profile(&sc->btcoex.mci); 392
384 } 393 if (ah->caps.hw_caps & ATH9K_HW_CAP_MCI)
394 ath_mci_flush_profile(&sc->btcoex.mci);
385} 395}
386 396
387void ath9k_deinit_btcoex(struct ath_softc *sc) 397void ath9k_deinit_btcoex(struct ath_softc *sc)