aboutsummaryrefslogtreecommitdiff
path: root/drivers/staging/rtl8723bs/hal/HalBtc8723b2Ant.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/staging/rtl8723bs/hal/HalBtc8723b2Ant.c')
-rw-r--r--drivers/staging/rtl8723bs/hal/HalBtc8723b2Ant.c32
1 files changed, 13 insertions, 19 deletions
diff --git a/drivers/staging/rtl8723bs/hal/HalBtc8723b2Ant.c b/drivers/staging/rtl8723bs/hal/HalBtc8723b2Ant.c
index d32dbf94858f..6da6940c9043 100644
--- a/drivers/staging/rtl8723bs/hal/HalBtc8723b2Ant.c
+++ b/drivers/staging/rtl8723bs/hal/HalBtc8723b2Ant.c
@@ -185,7 +185,7 @@ static void halbtc8723b2ant_QueryBtInfo(struct btc_coexist *pBtCoexist)
pCoexSta->bC2hBtInfoReqSent = true;
- H2C_Parameter[0] |= BIT0; /* trigger */
+ H2C_Parameter[0] |= BIT(0); /* trigger */
pBtCoexist->fBtcFillH2c(pBtCoexist, 0x61, 1, H2C_Parameter);
}
@@ -294,9 +294,8 @@ static u8 halbtc8723b2ant_ActionAlgorithm(struct btc_coexist *pBtCoexist)
pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_HS_OPERATION, &bBtHsOn);
- if (!pBtLinkInfo->bBtLinkExist) {
+ if (!pBtLinkInfo->bBtLinkExist)
return algorithm;
- }
if (pBtLinkInfo->bScoExist)
numOfDiffProfile++;
@@ -510,7 +509,7 @@ static void halbtc8723b2ant_SetSwPenaltyTxRateAdaptive(
H2C_Parameter[0] = 0x6; /* opCode, 0x6 = Retry_Penalty */
if (bLowPenaltyRa) {
- H2C_Parameter[1] |= BIT0;
+ H2C_Parameter[1] |= BIT(0);
H2C_Parameter[2] = 0x00; /* normal rate except MCS7/6/5, OFDM54/48/36 */
H2C_Parameter[3] = 0xf7; /* MCS7 or OFDM54 */
H2C_Parameter[4] = 0xf8; /* MCS6 or OFDM48 */
@@ -553,7 +552,6 @@ static void halbtc8723b2ant_SetSwFullTimeDacSwing(
halbtc8723b2ant_SetDacSwingReg(pBtCoexist, 0x18);
}
-
static void halbtc8723b2ant_DacSwing(
struct btc_coexist *pBtCoexist,
bool bForceExec,
@@ -601,7 +599,6 @@ static void halbtc8723b2ant_SetAgcTable(
pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0xc78, 0xa4200001);
}
-
/* RF Gain */
pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0xef, 0xfffff, 0x02000);
if (bAgcTableEn) {
@@ -749,7 +746,7 @@ static void halbtc8723b2ant_SetFwIgnoreWlanAct(
u8 H2C_Parameter[1] = {0};
if (bEnable)
- H2C_Parameter[0] |= BIT0; /* function enable */
+ H2C_Parameter[0] |= BIT(0); /* function enable */
pBtCoexist->fBtcFillH2c(pBtCoexist, 0x63, 1, H2C_Parameter);
}
@@ -878,8 +875,8 @@ static void halbtc8723b2ant_SetAntPath(
if (bInitHwCfg) {
/* 0x4c[23]= 0, 0x4c[24]= 1 Antenna control by WL/BT */
u4Tmp = pBtCoexist->fBtcRead4Byte(pBtCoexist, 0x4c);
- u4Tmp &= ~BIT23;
- u4Tmp |= BIT24;
+ u4Tmp &= ~BIT(23);
+ u4Tmp |= BIT(24);
pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x4c, u4Tmp);
}
@@ -896,8 +893,8 @@ static void halbtc8723b2ant_SetAntPath(
if (bInitHwCfg) {
/* 0x4c[23]= 0, 0x4c[24]= 1 Antenna control by WL/BT */
u4Tmp = pBtCoexist->fBtcRead4Byte(pBtCoexist, 0x4c);
- u4Tmp |= BIT23;
- u4Tmp &= ~BIT24;
+ u4Tmp |= BIT(23);
+ u4Tmp &= ~BIT(24);
pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x4c, u4Tmp);
}
@@ -1638,7 +1635,6 @@ static void halbtc8723b2ant_ActionSco(struct btc_coexist *pBtCoexist)
}
}
-
static void halbtc8723b2ant_ActionHid(struct btc_coexist *pBtCoexist)
{
u8 wifiRssiState, btRssiState;
@@ -1886,7 +1882,6 @@ static void halbtc8723b2ant_ActionPanEdr(struct btc_coexist *pBtCoexist)
}
}
-
/* PAN(HS) only */
static void halbtc8723b2ant_ActionPanHs(struct btc_coexist *pBtCoexist)
{
@@ -2211,7 +2206,7 @@ static void halbtc8723b2ant_RunCoexistMechanism(struct btc_coexist *pBtCoexist)
}
algorithm = halbtc8723b2ant_ActionAlgorithm(pBtCoexist);
- if (pCoexSta->bC2hBtInquiryPage && (BT_8723B_2ANT_COEX_ALGO_PANHS != algorithm)) {
+ if (pCoexSta->bC2hBtInquiryPage && (algorithm != BT_8723B_2ANT_COEX_ALGO_PANHS)) {
halbtc8723b2ant_ActionBtInquiry(pBtCoexist);
return;
} else {
@@ -2230,7 +2225,6 @@ static void halbtc8723b2ant_RunCoexistMechanism(struct btc_coexist *pBtCoexist)
pCoexDm->bAutoTdmaAdjust = false;
}
-
switch (pCoexDm->curAlgorithm) {
case BT_8723B_2ANT_COEX_ALGO_SCO:
halbtc8723b2ant_ActionSco(pBtCoexist);
@@ -2337,7 +2331,7 @@ void EXhalbtc8723b2ant_PowerOnSetting(struct btc_coexist *pBtCoexist)
/* enable BB, REG_SYS_FUNC_EN such that we can write 0x948 correctly. */
u2Tmp = pBtCoexist->fBtcRead2Byte(pBtCoexist, 0x2);
- pBtCoexist->fBtcWrite2Byte(pBtCoexist, 0x2, u2Tmp | BIT0 | BIT1);
+ pBtCoexist->fBtcWrite2Byte(pBtCoexist, 0x2, u2Tmp | BIT(0) | BIT(1));
/* set GRAN_BT = 1 */
pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x765, 0x18);
@@ -2490,7 +2484,7 @@ void EXhalbtc8723b2ant_BtInfoNotify(
return;
}
- if (BT_INFO_SRC_8723B_2ANT_WIFI_FW != rspSource) {
+ if (rspSource != BT_INFO_SRC_8723B_2ANT_WIFI_FW) {
pCoexSta->btRetryCnt = pCoexSta->btInfoC2h[rspSource][2] & 0xf; /* [3:0] */
pCoexSta->btRssi = pCoexSta->btInfoC2h[rspSource][3] * 2 + 10;
@@ -2506,7 +2500,7 @@ void EXhalbtc8723b2ant_BtInfoNotify(
/* Here we need to resend some wifi info to BT */
/* because bt is reset and loss of the info. */
- if ((pCoexSta->btInfoExt & BIT1)) {
+ if ((pCoexSta->btInfoExt & BIT(1))) {
pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_CONNECTED, &bWifiConnected);
if (bWifiConnected)
@@ -2515,7 +2509,7 @@ void EXhalbtc8723b2ant_BtInfoNotify(
EXhalbtc8723b2ant_MediaStatusNotify(pBtCoexist, BTC_MEDIA_DISCONNECT);
}
- if ((pCoexSta->btInfoExt & BIT3)) {
+ if ((pCoexSta->btInfoExt & BIT(3))) {
halbtc8723b2ant_IgnoreWlanAct(pBtCoexist, FORCE_EXEC, false);
} else {
/* BT already NOT ignore Wlan active, do nothing here. */