aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath9k/gpio.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2011-05-05 17:09:28 -0400
committerDavid S. Miller <davem@davemloft.net>2011-05-05 17:09:28 -0400
commit90864fbc7639d7a2300c67a18c9fb9fbcf7d51d2 (patch)
tree6951c8d0e529dbfc7c4cec75d4cec63350e39b7c /drivers/net/wireless/ath/ath9k/gpio.c
parent228e548e602061b08ee8e8966f567c12aa079682 (diff)
parenta70171dce9cd44cb06c7d299eba9fa87a8933045 (diff)
Merge branch 'for-davem' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/gpio.c')
-rw-r--r--drivers/net/wireless/ath/ath9k/gpio.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/drivers/net/wireless/ath/ath9k/gpio.c b/drivers/net/wireless/ath/ath9k/gpio.c
index 44a0a886124d..0349b3a1cc58 100644
--- a/drivers/net/wireless/ath/ath9k/gpio.c
+++ b/drivers/net/wireless/ath/ath9k/gpio.c
@@ -46,6 +46,8 @@ void ath_init_leds(struct ath_softc *sc)
46 sc->sc_ah->led_pin = ATH_LED_PIN_9287; 46 sc->sc_ah->led_pin = ATH_LED_PIN_9287;
47 else if (AR_SREV_9485(sc->sc_ah)) 47 else if (AR_SREV_9485(sc->sc_ah))
48 sc->sc_ah->led_pin = ATH_LED_PIN_9485; 48 sc->sc_ah->led_pin = ATH_LED_PIN_9485;
49 else if (AR_SREV_9300(sc->sc_ah))
50 sc->sc_ah->led_pin = ATH_LED_PIN_9300;
49 else 51 else
50 sc->sc_ah->led_pin = ATH_LED_PIN_DEF; 52 sc->sc_ah->led_pin = ATH_LED_PIN_DEF;
51 } 53 }
@@ -138,10 +140,10 @@ static void ath_detect_bt_priority(struct ath_softc *sc)
138 140
139static void ath9k_gen_timer_start(struct ath_hw *ah, 141static void ath9k_gen_timer_start(struct ath_hw *ah,
140 struct ath_gen_timer *timer, 142 struct ath_gen_timer *timer,
141 u32 timer_next, 143 u32 trig_timeout,
142 u32 timer_period) 144 u32 timer_period)
143{ 145{
144 ath9k_hw_gen_timer_start(ah, timer, timer_next, timer_period); 146 ath9k_hw_gen_timer_start(ah, timer, trig_timeout, timer_period);
145 147
146 if ((ah->imask & ATH9K_INT_GENTIMER) == 0) { 148 if ((ah->imask & ATH9K_INT_GENTIMER) == 0) {
147 ath9k_hw_disable_interrupts(ah); 149 ath9k_hw_disable_interrupts(ah);
@@ -174,17 +176,17 @@ static void ath_btcoex_period_timer(unsigned long data)
174 struct ath_softc *sc = (struct ath_softc *) data; 176 struct ath_softc *sc = (struct ath_softc *) data;
175 struct ath_hw *ah = sc->sc_ah; 177 struct ath_hw *ah = sc->sc_ah;
176 struct ath_btcoex *btcoex = &sc->btcoex; 178 struct ath_btcoex *btcoex = &sc->btcoex;
177 struct ath_common *common = ath9k_hw_common(ah);
178 u32 timer_period; 179 u32 timer_period;
179 bool is_btscan; 180 bool is_btscan;
180 181
182 ath9k_ps_wakeup(sc);
181 ath_detect_bt_priority(sc); 183 ath_detect_bt_priority(sc);
182 184
183 is_btscan = sc->sc_flags & SC_OP_BT_SCAN; 185 is_btscan = sc->sc_flags & SC_OP_BT_SCAN;
184 186
185 spin_lock_bh(&btcoex->btcoex_lock); 187 spin_lock_bh(&btcoex->btcoex_lock);
186 188
187 ath9k_cmn_btcoex_bt_stomp(common, is_btscan ? ATH_BTCOEX_STOMP_ALL : 189 ath9k_hw_btcoex_bt_stomp(ah, is_btscan ? ATH_BTCOEX_STOMP_ALL :
188 btcoex->bt_stomp_type); 190 btcoex->bt_stomp_type);
189 191
190 spin_unlock_bh(&btcoex->btcoex_lock); 192 spin_unlock_bh(&btcoex->btcoex_lock);
@@ -195,11 +197,12 @@ static void ath_btcoex_period_timer(unsigned long data)
195 197
196 timer_period = is_btscan ? btcoex->btscan_no_stomp : 198 timer_period = is_btscan ? btcoex->btscan_no_stomp :
197 btcoex->btcoex_no_stomp; 199 btcoex->btcoex_no_stomp;
198 ath9k_gen_timer_start(ah, btcoex->no_stomp_timer, 0, 200 ath9k_gen_timer_start(ah, btcoex->no_stomp_timer, timer_period,
199 timer_period * 10); 201 timer_period * 10);
200 btcoex->hw_timer_enabled = true; 202 btcoex->hw_timer_enabled = true;
201 } 203 }
202 204
205 ath9k_ps_restore(sc);
203 mod_timer(&btcoex->period_timer, jiffies + 206 mod_timer(&btcoex->period_timer, jiffies +
204 msecs_to_jiffies(ATH_BTCOEX_DEF_BT_PERIOD)); 207 msecs_to_jiffies(ATH_BTCOEX_DEF_BT_PERIOD));
205} 208}
@@ -219,14 +222,16 @@ static void ath_btcoex_no_stomp_timer(void *arg)
219 ath_dbg(common, ATH_DBG_BTCOEX, 222 ath_dbg(common, ATH_DBG_BTCOEX,
220 "no stomp timer running\n"); 223 "no stomp timer running\n");
221 224
225 ath9k_ps_wakeup(sc);
222 spin_lock_bh(&btcoex->btcoex_lock); 226 spin_lock_bh(&btcoex->btcoex_lock);
223 227
224 if (btcoex->bt_stomp_type == ATH_BTCOEX_STOMP_LOW || is_btscan) 228 if (btcoex->bt_stomp_type == ATH_BTCOEX_STOMP_LOW || is_btscan)
225 ath9k_cmn_btcoex_bt_stomp(common, ATH_BTCOEX_STOMP_NONE); 229 ath9k_hw_btcoex_bt_stomp(ah, ATH_BTCOEX_STOMP_NONE);
226 else if (btcoex->bt_stomp_type == ATH_BTCOEX_STOMP_ALL) 230 else if (btcoex->bt_stomp_type == ATH_BTCOEX_STOMP_ALL)
227 ath9k_cmn_btcoex_bt_stomp(common, ATH_BTCOEX_STOMP_LOW); 231 ath9k_hw_btcoex_bt_stomp(ah, ATH_BTCOEX_STOMP_LOW);
228 232
229 spin_unlock_bh(&btcoex->btcoex_lock); 233 spin_unlock_bh(&btcoex->btcoex_lock);
234 ath9k_ps_restore(sc);
230} 235}
231 236
232int ath_init_btcoex_timer(struct ath_softc *sc) 237int ath_init_btcoex_timer(struct ath_softc *sc)