aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath9k/gpio.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/gpio.c')
-rw-r--r--drivers/net/wireless/ath/ath9k/gpio.c58
1 files changed, 34 insertions, 24 deletions
diff --git a/drivers/net/wireless/ath/ath9k/gpio.c b/drivers/net/wireless/ath/ath9k/gpio.c
index 45f24220b16e..bf7d29ec1a87 100644
--- a/drivers/net/wireless/ath/ath9k/gpio.c
+++ b/drivers/net/wireless/ath/ath9k/gpio.c
@@ -44,25 +44,6 @@ void ath_init_leds(struct ath_softc *sc)
44 if (AR_SREV_9100(sc->sc_ah)) 44 if (AR_SREV_9100(sc->sc_ah))
45 return; 45 return;
46 46
47 if (sc->sc_ah->led_pin < 0) {
48 if (AR_SREV_9287(sc->sc_ah))
49 sc->sc_ah->led_pin = ATH_LED_PIN_9287;
50 else if (AR_SREV_9485(sc->sc_ah))
51 sc->sc_ah->led_pin = ATH_LED_PIN_9485;
52 else if (AR_SREV_9300(sc->sc_ah))
53 sc->sc_ah->led_pin = ATH_LED_PIN_9300;
54 else if (AR_SREV_9462(sc->sc_ah) || AR_SREV_9565(sc->sc_ah))
55 sc->sc_ah->led_pin = ATH_LED_PIN_9462;
56 else
57 sc->sc_ah->led_pin = ATH_LED_PIN_DEF;
58 }
59
60 /* Configure gpio 1 for output */
61 ath9k_hw_cfg_output(sc->sc_ah, sc->sc_ah->led_pin,
62 AR_GPIO_OUTPUT_MUX_AS_OUTPUT);
63 /* LED off, active low */
64 ath9k_hw_set_gpio(sc->sc_ah, sc->sc_ah->led_pin, 1);
65
66 if (!led_blink) 47 if (!led_blink)
67 sc->led_cdev.default_trigger = 48 sc->led_cdev.default_trigger =
68 ieee80211_get_radio_led_name(sc->hw); 49 ieee80211_get_radio_led_name(sc->hw);
@@ -78,6 +59,31 @@ void ath_init_leds(struct ath_softc *sc)
78 59
79 sc->led_registered = true; 60 sc->led_registered = true;
80} 61}
62
63void ath_fill_led_pin(struct ath_softc *sc)
64{
65 struct ath_hw *ah = sc->sc_ah;
66
67 if (AR_SREV_9100(ah) || (ah->led_pin >= 0))
68 return;
69
70 if (AR_SREV_9287(ah))
71 ah->led_pin = ATH_LED_PIN_9287;
72 else if (AR_SREV_9485(sc->sc_ah))
73 ah->led_pin = ATH_LED_PIN_9485;
74 else if (AR_SREV_9300(sc->sc_ah))
75 ah->led_pin = ATH_LED_PIN_9300;
76 else if (AR_SREV_9462(sc->sc_ah) || AR_SREV_9565(sc->sc_ah))
77 ah->led_pin = ATH_LED_PIN_9462;
78 else
79 ah->led_pin = ATH_LED_PIN_DEF;
80
81 /* Configure gpio 1 for output */
82 ath9k_hw_cfg_output(ah, ah->led_pin, AR_GPIO_OUTPUT_MUX_AS_OUTPUT);
83
84 /* LED off, active low */
85 ath9k_hw_set_gpio(ah, ah->led_pin, 1);
86}
81#endif 87#endif
82 88
83/*******************/ 89/*******************/
@@ -314,8 +320,10 @@ void ath9k_btcoex_timer_resume(struct ath_softc *sc)
314 ath_dbg(ath9k_hw_common(ah), BTCOEX, "Starting btcoex timers\n"); 320 ath_dbg(ath9k_hw_common(ah), BTCOEX, "Starting btcoex timers\n");
315 321
316 /* make sure duty cycle timer is also stopped when resuming */ 322 /* make sure duty cycle timer is also stopped when resuming */
317 if (btcoex->hw_timer_enabled) 323 if (btcoex->hw_timer_enabled) {
318 ath9k_gen_timer_stop(sc->sc_ah, btcoex->no_stomp_timer); 324 ath9k_gen_timer_stop(sc->sc_ah, btcoex->no_stomp_timer);
325 btcoex->hw_timer_enabled = false;
326 }
319 327
320 btcoex->bt_priority_cnt = 0; 328 btcoex->bt_priority_cnt = 0;
321 btcoex->bt_priority_time = jiffies; 329 btcoex->bt_priority_time = jiffies;
@@ -336,18 +344,20 @@ void ath9k_btcoex_timer_pause(struct ath_softc *sc)
336 344
337 del_timer_sync(&btcoex->period_timer); 345 del_timer_sync(&btcoex->period_timer);
338 346
339 if (btcoex->hw_timer_enabled) 347 if (btcoex->hw_timer_enabled) {
340 ath9k_gen_timer_stop(ah, btcoex->no_stomp_timer); 348 ath9k_gen_timer_stop(ah, btcoex->no_stomp_timer);
341 349 btcoex->hw_timer_enabled = false;
342 btcoex->hw_timer_enabled = false; 350 }
343} 351}
344 352
345void ath9k_btcoex_stop_gen_timer(struct ath_softc *sc) 353void ath9k_btcoex_stop_gen_timer(struct ath_softc *sc)
346{ 354{
347 struct ath_btcoex *btcoex = &sc->btcoex; 355 struct ath_btcoex *btcoex = &sc->btcoex;
348 356
349 if (btcoex->hw_timer_enabled) 357 if (btcoex->hw_timer_enabled) {
350 ath9k_gen_timer_stop(sc->sc_ah, btcoex->no_stomp_timer); 358 ath9k_gen_timer_stop(sc->sc_ah, btcoex->no_stomp_timer);
359 btcoex->hw_timer_enabled = false;
360 }
351} 361}
352 362
353u16 ath9k_btcoex_aggr_limit(struct ath_softc *sc, u32 max_4ms_framelen) 363u16 ath9k_btcoex_aggr_limit(struct ath_softc *sc, u32 max_4ms_framelen)