Lines Matching refs:ah

59 void ath9k_hw_init_btcoex_hw(struct ath_hw *ah, int qnum)  in ath9k_hw_init_btcoex_hw()  argument
61 struct ath_btcoex_hw *btcoex_hw = &ah->btcoex_hw; in ath9k_hw_init_btcoex_hw()
79 if (AR_SREV_9300_20_OR_LATER(ah)) in ath9k_hw_init_btcoex_hw()
82 if (AR_SREV_SOC(ah)) { in ath9k_hw_init_btcoex_hw()
114 static void ath9k_hw_btcoex_pin_init(struct ath_hw *ah, u8 wlanactive_gpio, in ath9k_hw_btcoex_pin_init() argument
117 struct ath_btcoex_hw *btcoex_hw = &ah->btcoex_hw; in ath9k_hw_btcoex_pin_init()
118 struct ath9k_platform_data *pdata = ah->dev->platform_data; in ath9k_hw_btcoex_pin_init()
137 void ath9k_hw_btcoex_init_scheme(struct ath_hw *ah) in ath9k_hw_btcoex_init_scheme() argument
139 struct ath_common *common = ath9k_hw_common(ah); in ath9k_hw_btcoex_init_scheme()
140 struct ath_btcoex_hw *btcoex_hw = &ah->btcoex_hw; in ath9k_hw_btcoex_init_scheme()
150 if (ah->caps.hw_caps & ATH9K_HW_CAP_MCI) { in ath9k_hw_btcoex_init_scheme()
152 } else if (AR_SREV_9300_20_OR_LATER(ah)) { in ath9k_hw_btcoex_init_scheme()
155 ath9k_hw_btcoex_pin_init(ah, ATH_WLANACTIVE_GPIO_9300, in ath9k_hw_btcoex_init_scheme()
158 } else if (AR_SREV_9280_20_OR_LATER(ah)) { in ath9k_hw_btcoex_init_scheme()
159 if (AR_SREV_9285(ah)) in ath9k_hw_btcoex_init_scheme()
164 ath9k_hw_btcoex_pin_init(ah, ATH_WLANACTIVE_GPIO_9280, in ath9k_hw_btcoex_init_scheme()
171 void ath9k_hw_btcoex_init_2wire(struct ath_hw *ah) in ath9k_hw_btcoex_init_2wire() argument
173 struct ath_btcoex_hw *btcoex_hw = &ah->btcoex_hw; in ath9k_hw_btcoex_init_2wire()
176 REG_CLR_BIT(ah, AR_GPIO_INPUT_EN_VAL, in ath9k_hw_btcoex_init_2wire()
180 REG_SET_BIT(ah, AR_GPIO_INPUT_EN_VAL, in ath9k_hw_btcoex_init_2wire()
184 if (!AR_SREV_SOC(ah)) in ath9k_hw_btcoex_init_2wire()
185 REG_RMW_FIELD(ah, AR_GPIO_INPUT_MUX1, in ath9k_hw_btcoex_init_2wire()
190 ath9k_hw_gpio_request_in(ah, btcoex_hw->btactive_gpio, in ath9k_hw_btcoex_init_2wire()
195 void ath9k_hw_btcoex_init_3wire(struct ath_hw *ah) in ath9k_hw_btcoex_init_3wire() argument
197 struct ath_btcoex_hw *btcoex_hw = &ah->btcoex_hw; in ath9k_hw_btcoex_init_3wire()
200 REG_SET_BIT(ah, AR_GPIO_INPUT_EN_VAL, in ath9k_hw_btcoex_init_3wire()
206 if (!AR_SREV_SOC(ah)) { in ath9k_hw_btcoex_init_3wire()
207 REG_RMW_FIELD(ah, AR_GPIO_INPUT_MUX1, in ath9k_hw_btcoex_init_3wire()
210 REG_RMW_FIELD(ah, AR_GPIO_INPUT_MUX1, in ath9k_hw_btcoex_init_3wire()
216 ath9k_hw_gpio_request_in(ah, btcoex_hw->btactive_gpio, in ath9k_hw_btcoex_init_3wire()
218 ath9k_hw_gpio_request_in(ah, btcoex_hw->btpriority_gpio, in ath9k_hw_btcoex_init_3wire()
223 void ath9k_hw_btcoex_deinit(struct ath_hw *ah) in ath9k_hw_btcoex_deinit() argument
225 struct ath_btcoex_hw *btcoex_hw = &ah->btcoex_hw; in ath9k_hw_btcoex_deinit()
227 ath9k_hw_gpio_free(ah, btcoex_hw->btactive_gpio); in ath9k_hw_btcoex_deinit()
228 ath9k_hw_gpio_free(ah, btcoex_hw->btpriority_gpio); in ath9k_hw_btcoex_deinit()
229 ath9k_hw_gpio_free(ah, btcoex_hw->wlanactive_gpio); in ath9k_hw_btcoex_deinit()
233 void ath9k_hw_btcoex_init_mci(struct ath_hw *ah) in ath9k_hw_btcoex_init_mci() argument
235 ah->btcoex_hw.mci.ready = false; in ath9k_hw_btcoex_init_mci()
236 ah->btcoex_hw.mci.bt_state = 0; in ath9k_hw_btcoex_init_mci()
237 ah->btcoex_hw.mci.bt_ver_major = 3; in ath9k_hw_btcoex_init_mci()
238 ah->btcoex_hw.mci.bt_ver_minor = 0; in ath9k_hw_btcoex_init_mci()
239 ah->btcoex_hw.mci.bt_version_known = false; in ath9k_hw_btcoex_init_mci()
240 ah->btcoex_hw.mci.update_2g5g = true; in ath9k_hw_btcoex_init_mci()
241 ah->btcoex_hw.mci.is_2g = true; in ath9k_hw_btcoex_init_mci()
242 ah->btcoex_hw.mci.wlan_channels_update = false; in ath9k_hw_btcoex_init_mci()
243 ah->btcoex_hw.mci.wlan_channels[0] = 0x00000000; in ath9k_hw_btcoex_init_mci()
244 ah->btcoex_hw.mci.wlan_channels[1] = 0xffffffff; in ath9k_hw_btcoex_init_mci()
245 ah->btcoex_hw.mci.wlan_channels[2] = 0xffffffff; in ath9k_hw_btcoex_init_mci()
246 ah->btcoex_hw.mci.wlan_channels[3] = 0x7fffffff; in ath9k_hw_btcoex_init_mci()
247 ah->btcoex_hw.mci.query_bt = true; in ath9k_hw_btcoex_init_mci()
248 ah->btcoex_hw.mci.unhalt_bt_gpm = true; in ath9k_hw_btcoex_init_mci()
249 ah->btcoex_hw.mci.halted_bt_gpm = false; in ath9k_hw_btcoex_init_mci()
250 ah->btcoex_hw.mci.need_flush_btinfo = false; in ath9k_hw_btcoex_init_mci()
251 ah->btcoex_hw.mci.wlan_cal_seq = 0; in ath9k_hw_btcoex_init_mci()
252 ah->btcoex_hw.mci.wlan_cal_done = 0; in ath9k_hw_btcoex_init_mci()
253 ah->btcoex_hw.mci.config = (AR_SREV_9462(ah)) ? 0x2201 : 0xa4c1; in ath9k_hw_btcoex_init_mci()
257 static void ath9k_hw_btcoex_enable_2wire(struct ath_hw *ah) in ath9k_hw_btcoex_enable_2wire() argument
259 struct ath_btcoex_hw *btcoex_hw = &ah->btcoex_hw; in ath9k_hw_btcoex_enable_2wire()
262 ath9k_hw_gpio_request_out(ah, btcoex_hw->wlanactive_gpio, in ath9k_hw_btcoex_enable_2wire()
271 void ath9k_hw_btcoex_set_weight(struct ath_hw *ah, in ath9k_hw_btcoex_set_weight() argument
276 struct ath_btcoex_hw *btcoex_hw = &ah->btcoex_hw; in ath9k_hw_btcoex_set_weight()
277 struct ath9k_hw_mci *mci_hw = &ah->btcoex_hw.mci; in ath9k_hw_btcoex_set_weight()
283 if (!AR_SREV_9300_20_OR_LATER(ah)) { in ath9k_hw_btcoex_set_weight()
290 if (AR_SREV_9462(ah) || AR_SREV_9565(ah)) { in ath9k_hw_btcoex_set_weight()
320 static void ath9k_hw_btcoex_enable_3wire(struct ath_hw *ah) in ath9k_hw_btcoex_enable_3wire() argument
322 struct ath_btcoex_hw *btcoex = &ah->btcoex_hw; in ath9k_hw_btcoex_enable_3wire()
330 if (AR_SREV_SOC(ah)) in ath9k_hw_btcoex_enable_3wire()
331 REG_CLR_BIT(ah, AR_BT_COEX_MODE2, AR_BT_PHY_ERR_BT_COLL_ENABLE); in ath9k_hw_btcoex_enable_3wire()
333 REG_WRITE(ah, AR_BT_COEX_MODE, btcoex->bt_coex_mode); in ath9k_hw_btcoex_enable_3wire()
334 REG_WRITE(ah, AR_BT_COEX_MODE2, btcoex->bt_coex_mode2); in ath9k_hw_btcoex_enable_3wire()
336 if (AR_SREV_SOC(ah)) in ath9k_hw_btcoex_enable_3wire()
337 REG_WRITE(ah, AR_BT_COEX_MODE3, btcoex->bt_coex_mode3); in ath9k_hw_btcoex_enable_3wire()
339 if (AR_SREV_9300_20_OR_LATER(ah)) { in ath9k_hw_btcoex_enable_3wire()
340 REG_WRITE(ah, AR_BT_COEX_WL_WEIGHTS0, btcoex->wlan_weight[0]); in ath9k_hw_btcoex_enable_3wire()
341 REG_WRITE(ah, AR_BT_COEX_WL_WEIGHTS1, btcoex->wlan_weight[1]); in ath9k_hw_btcoex_enable_3wire()
343 REG_WRITE(ah, AR_BT_COEX_BT_WEIGHTS(i), in ath9k_hw_btcoex_enable_3wire()
346 REG_WRITE(ah, AR_BT_COEX_WEIGHT, btcoex->bt_coex_weights); in ath9k_hw_btcoex_enable_3wire()
348 if (AR_SREV_9271(ah)) { in ath9k_hw_btcoex_enable_3wire()
349 val = REG_READ(ah, 0x50040); in ath9k_hw_btcoex_enable_3wire()
351 REG_WRITE(ah, 0x50040, val); in ath9k_hw_btcoex_enable_3wire()
354 REG_RMW_FIELD(ah, AR_QUIET1, AR_QUIET1_QUIET_ACK_CTS_ENABLE, 1); in ath9k_hw_btcoex_enable_3wire()
355 REG_RMW_FIELD(ah, AR_PCU_MISC, AR_PCU_BT_ANT_PREVENT_RX, 0); in ath9k_hw_btcoex_enable_3wire()
357 ath9k_hw_gpio_request_out(ah, btcoex->wlanactive_gpio, in ath9k_hw_btcoex_enable_3wire()
362 static void ath9k_hw_btcoex_enable_mci(struct ath_hw *ah) in ath9k_hw_btcoex_enable_mci() argument
364 struct ath_btcoex_hw *btcoex = &ah->btcoex_hw; in ath9k_hw_btcoex_enable_mci()
368 REG_WRITE(ah, AR_MCI_COEX_WL_WEIGHTS(i), in ath9k_hw_btcoex_enable_mci()
371 REG_RMW_FIELD(ah, AR_QUIET1, AR_QUIET1_QUIET_ACK_CTS_ENABLE, 1); in ath9k_hw_btcoex_enable_mci()
375 static void ath9k_hw_btcoex_disable_mci(struct ath_hw *ah) in ath9k_hw_btcoex_disable_mci() argument
377 struct ath_btcoex_hw *btcoex_hw = &ah->btcoex_hw; in ath9k_hw_btcoex_disable_mci()
380 ath9k_hw_btcoex_bt_stomp(ah, ATH_BTCOEX_STOMP_NONE); in ath9k_hw_btcoex_disable_mci()
383 REG_WRITE(ah, AR_MCI_COEX_WL_WEIGHTS(i), in ath9k_hw_btcoex_disable_mci()
387 void ath9k_hw_btcoex_enable(struct ath_hw *ah) in ath9k_hw_btcoex_enable() argument
389 struct ath_btcoex_hw *btcoex_hw = &ah->btcoex_hw; in ath9k_hw_btcoex_enable()
391 switch (ath9k_hw_get_btcoex_scheme(ah)) { in ath9k_hw_btcoex_enable()
395 ath9k_hw_btcoex_enable_2wire(ah); in ath9k_hw_btcoex_enable()
398 ath9k_hw_btcoex_enable_3wire(ah); in ath9k_hw_btcoex_enable()
401 ath9k_hw_btcoex_enable_mci(ah); in ath9k_hw_btcoex_enable()
405 if (ath9k_hw_get_btcoex_scheme(ah) != ATH_BTCOEX_CFG_MCI && in ath9k_hw_btcoex_enable()
406 !AR_SREV_SOC(ah)) { in ath9k_hw_btcoex_enable()
407 REG_RMW(ah, AR_GPIO_PDPU, in ath9k_hw_btcoex_enable()
412 ah->btcoex_hw.enabled = true; in ath9k_hw_btcoex_enable()
416 void ath9k_hw_btcoex_disable(struct ath_hw *ah) in ath9k_hw_btcoex_disable() argument
418 struct ath_btcoex_hw *btcoex_hw = &ah->btcoex_hw; in ath9k_hw_btcoex_disable()
423 if (ath9k_hw_get_btcoex_scheme(ah) == ATH_BTCOEX_CFG_MCI) { in ath9k_hw_btcoex_disable()
424 ath9k_hw_btcoex_disable_mci(ah); in ath9k_hw_btcoex_disable()
428 if (!AR_SREV_9300_20_OR_LATER(ah)) in ath9k_hw_btcoex_disable()
429 ath9k_hw_set_gpio(ah, btcoex_hw->wlanactive_gpio, 0); in ath9k_hw_btcoex_disable()
431 ath9k_hw_gpio_request_out(ah, btcoex_hw->wlanactive_gpio, in ath9k_hw_btcoex_disable()
435 REG_WRITE(ah, AR_BT_COEX_MODE, AR_BT_QUIET | AR_BT_MODE); in ath9k_hw_btcoex_disable()
436 REG_WRITE(ah, AR_BT_COEX_MODE2, 0); in ath9k_hw_btcoex_disable()
438 if (AR_SREV_9300_20_OR_LATER(ah)) { in ath9k_hw_btcoex_disable()
439 REG_WRITE(ah, AR_BT_COEX_WL_WEIGHTS0, 0); in ath9k_hw_btcoex_disable()
440 REG_WRITE(ah, AR_BT_COEX_WL_WEIGHTS1, 0); in ath9k_hw_btcoex_disable()
442 REG_WRITE(ah, AR_BT_COEX_BT_WEIGHTS(i), 0); in ath9k_hw_btcoex_disable()
444 REG_WRITE(ah, AR_BT_COEX_WEIGHT, 0); in ath9k_hw_btcoex_disable()
453 void ath9k_hw_btcoex_bt_stomp(struct ath_hw *ah, in ath9k_hw_btcoex_bt_stomp() argument
456 if (AR_SREV_9300_20_OR_LATER(ah)) { in ath9k_hw_btcoex_bt_stomp()
457 ath9k_hw_btcoex_set_weight(ah, 0, 0, stomp_type); in ath9k_hw_btcoex_bt_stomp()
463 ath9k_hw_btcoex_set_weight(ah, AR_BT_COEX_WGHT, in ath9k_hw_btcoex_bt_stomp()
467 ath9k_hw_btcoex_set_weight(ah, AR_BT_COEX_WGHT, in ath9k_hw_btcoex_bt_stomp()
471 ath9k_hw_btcoex_set_weight(ah, AR_BT_COEX_WGHT, in ath9k_hw_btcoex_bt_stomp()
475 ath_dbg(ath9k_hw_common(ah), BTCOEX, "Invalid Stomptype\n"); in ath9k_hw_btcoex_bt_stomp()
481 void ath9k_hw_btcoex_set_concur_txprio(struct ath_hw *ah, u8 *stomp_txprio) in ath9k_hw_btcoex_set_concur_txprio() argument
483 struct ath_btcoex_hw *btcoex = &ah->btcoex_hw; in ath9k_hw_btcoex_set_concur_txprio()