Commit 6dcf041e authored by Yan-Hsuan Chuang's avatar Yan-Hsuan Chuang Committed by Kalle Valo

rtlwifi: btcoex: 23b 2ant: before firmware ready settings

Before firmware is ready, set GNT_BT to high to let bt transmit
Signed-off-by: default avatarYan-Hsuan Chuang <yhchuang@realtek.com>
Signed-off-by: default avatarLarry Finger <Larry.Finger@lwfinger.net>
Cc: Pkshih <pkshih@realtek.com>
Cc: Birming Chiu <birming@realtek.com>
Cc: Shaofu <shaofu@realtek.com>
Cc: Steven Ting <steventing@realtek.com>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent 4e6becc0
...@@ -3700,6 +3700,44 @@ void ex_btc8723b2ant_power_on_setting(struct btc_coexist *btcoexist) ...@@ -3700,6 +3700,44 @@ void ex_btc8723b2ant_power_on_setting(struct btc_coexist *btcoexist)
} }
} }
void ex_btc8723b2ant_pre_load_firmware(struct btc_coexist *btcoexist)
{
struct btc_board_info *board_info = &btcoexist->board_info;
u8 u8tmp = 0x4; /* Set BIT2 by default since it's 2ant case */
/**
* S0 or S1 setting and Local register setting(By this fw can get
* ant number, S0/S1, ... info)
*
* Local setting bit define
* BIT0: "0" : no antenna inverse; "1" : antenna inverse
* BIT1: "0" : internal switch; "1" : external switch
* BIT2: "0" : one antenna; "1" : two antennas
*
* NOTE: here default all internal switch and 1-antenna ==> BIT1=0 and
* BIT2 = 0
*/
if (btcoexist->chip_interface == BTC_INTF_USB) {
/* fixed at S0 for USB interface */
u8tmp |= 0x1; /* antenna inverse */
btcoexist->btc_write_local_reg_1byte(btcoexist, 0xfe08, u8tmp);
} else {
/* for PCIE and SDIO interface, we check efuse 0xc3[6] */
if (board_info->single_ant_path == 0) {
} else if (board_info->single_ant_path == 1) {
/* set to S0 */
u8tmp |= 0x1; /* antenna inverse */
}
if (btcoexist->chip_interface == BTC_INTF_PCI)
btcoexist->btc_write_local_reg_1byte(btcoexist, 0x384,
u8tmp);
else if (btcoexist->chip_interface == BTC_INTF_SDIO)
btcoexist->btc_write_local_reg_1byte(btcoexist, 0x60,
u8tmp);
}
}
void ex_btc8723b2ant_init_coex_dm(struct btc_coexist *btcoexist) void ex_btc8723b2ant_init_coex_dm(struct btc_coexist *btcoexist)
{ {
struct rtl_priv *rtlpriv = btcoexist->adapter; struct rtl_priv *rtlpriv = btcoexist->adapter;
......
...@@ -369,6 +369,7 @@ typedef void (*bfp_btc_w2)(void *btc_context, u32 reg_addr, u16 data); ...@@ -369,6 +369,7 @@ typedef void (*bfp_btc_w2)(void *btc_context, u32 reg_addr, u16 data);
typedef void (*bfp_btc_w4)(void *btc_context, u32 reg_addr, u32 data); typedef void (*bfp_btc_w4)(void *btc_context, u32 reg_addr, u32 data);
typedef void (*bfp_btc_local_reg_w1)(void *btc_context, u32 reg_addr, u8 data);
typedef void (*bfp_btc_wr_1byte_bit_mask)(void *btc_context, u32 reg_addr, typedef void (*bfp_btc_wr_1byte_bit_mask)(void *btc_context, u32 reg_addr,
u8 bit_mask, u8 data); u8 bit_mask, u8 data);
...@@ -496,6 +497,7 @@ struct btc_coexist { ...@@ -496,6 +497,7 @@ struct btc_coexist {
bfp_btc_w2 btc_write_2byte; bfp_btc_w2 btc_write_2byte;
bfp_btc_r4 btc_read_4byte; bfp_btc_r4 btc_read_4byte;
bfp_btc_w4 btc_write_4byte; bfp_btc_w4 btc_write_4byte;
bfp_btc_local_reg_w1 btc_write_local_reg_1byte;
bfp_btc_set_bb_reg btc_set_bb_reg; bfp_btc_set_bb_reg btc_set_bb_reg;
bfp_btc_get_bb_reg btc_get_bb_reg; bfp_btc_get_bb_reg btc_get_bb_reg;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment