OSDN Git Service

rtlwifi: btcoex: add settings before the hardware is ready
authorYan-Hsuan Chuang <yhchuang@realtek.com>
Mon, 5 Jun 2017 15:29:55 +0000 (10:29 -0500)
committerKalle Valo <kvalo@codeaurora.org>
Tue, 13 Jun 2017 07:02:28 +0000 (10:02 +0300)
When the hardware is turned on and in the initialization stage, the PTA
circuit is unstable. Hence we need to force some hardware settings to
make sure the PTA circuit work correctly, otherwise it may affect the
user's experience.

Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Ping-Ke Shih <pkshih@realtek.com>
Cc: Birming Chiu <birming@realtek.com>
Cc: Shaofu <shaofu@realtek.com>
Cc: Steven Ting <steventing@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8723b2ant.h
drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.c
drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.h

index ae3e450..bc1e304 100644 (file)
@@ -198,5 +198,6 @@ void ex_btc8723b2ant_periodical(struct btc_coexist *btcoexist);
 void ex_btc8723b2ant_display_coex_info(struct btc_coexist *btcoexist);
 void ex_btc8723b2ant_pnp_notify(struct btc_coexist *btcoexist, u8 pnp_state);
 void ex_btc8723b2ant_pre_load_firmware(struct btc_coexist *btcoexist);
+void ex_btc8723b2ant_power_on_setting(struct btc_coexist *btcoexist);
 
 #endif
index 5e6e14f..8b015e6 100644 (file)
@@ -690,6 +690,21 @@ bool exhalbtc_initlize_variables(struct rtl_priv *adapter)
        return true;
 }
 
+void exhalbtc_power_on_setting(struct btc_coexist *btcoexist)
+{
+       if (!halbtc_is_bt_coexist_available(btcoexist))
+               return;
+
+       btcoexist->statistics.cnt_power_on++;
+
+       if (IS_HARDWARE_TYPE_8723B(btcoexist->adapter)) {
+               if (btcoexist->board_info.btdm_ant_num == 2)
+                       ex_btc8723b2ant_power_on_setting(btcoexist);
+               else if (btcoexist->board_info.btdm_ant_num == 1)
+                       ex_btc8723b1ant_power_on_setting(btcoexist);
+       }
+}
+
 void exhalbtc_pre_load_firmware(struct btc_coexist *btcoexist)
 {
        if (!halbtc_is_bt_coexist_available(btcoexist))
index eca0e5a..9b0a6e9 100644 (file)
@@ -487,6 +487,7 @@ struct btc_statistics {
        u32 cnt_stack_operation_notify;
        u32 cnt_dbg_ctrl;
        u32 cnt_pre_load_firmware;
+       u32 cnt_power_on;
 };
 
 struct btc_bt_link_info {