[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220203203217.252156-3-martin@kaiser.cx>
Date: Thu, 3 Feb 2022 21:32:15 +0100
From: Martin Kaiser <martin@...ser.cx>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: Larry Finger <Larry.Finger@...inger.net>,
Phillip Potter <phil@...lpotter.co.uk>,
Michael Straube <straube.linux@...il.com>,
linux-staging@...ts.linux.dev, linux-kernel@...r.kernel.org,
Martin Kaiser <martin@...ser.cx>
Subject: [PATCH 2/4] staging: r8188eu: remove dead code for tx power tracking
The odm_TXPowerTrackingCallback_ThermalMeter_8188E contains code
for OFDM paths A and B. It seems that path B is not used, is2t is
always false. Remove resulting dead code.
Signed-off-by: Martin Kaiser <martin@...ser.cx>
---
drivers/staging/r8188eu/hal/HalPhyRf_8188e.c | 52 +-------------------
1 file changed, 2 insertions(+), 50 deletions(-)
diff --git a/drivers/staging/r8188eu/hal/HalPhyRf_8188e.c b/drivers/staging/r8188eu/hal/HalPhyRf_8188e.c
index db87eaafb72f..8bdd02271203 100644
--- a/drivers/staging/r8188eu/hal/HalPhyRf_8188e.c
+++ b/drivers/staging/r8188eu/hal/HalPhyRf_8188e.c
@@ -102,12 +102,11 @@ odm_TXPowerTrackingCallback_ThermalMeter_8188E(
u8 ThermalValue = 0, delta, delta_LCK, delta_IQK, offset;
u8 ThermalValue_AVG_count = 0;
u32 ThermalValue_AVG = 0;
- s32 ele_A = 0, ele_D, TempCCk, X, value32;
+ s32 ele_A = 0, ele_D, TempCCk, X;
s32 Y, ele_C = 0;
s8 OFDM_index[2], CCK_index = 0;
s8 OFDM_index_old[2] = {0, 0}, CCK_index_old = 0;
u32 i = 0, j = 0;
- bool is2t = false;
u8 OFDM_min_index = 6, rf; /* OFDM BB Swing should be less than +3.0dB, which is required by Arthur */
s8 OFDM_index_mapping[2][index_mapping_NUM_88E] = {
@@ -139,10 +138,7 @@ odm_TXPowerTrackingCallback_ThermalMeter_8188E(
ThermalValue = (u8)rtl8188e_PHY_QueryRFReg(Adapter, RF_PATH_A, RF_T_METER_88E, 0xfc00); /* 0x42: RF Reg[15:10] 88E */
- if (is2t)
- rf = 2;
- else
- rf = 1;
+ rf = 1;
if (ThermalValue) {
/* Query OFDM path A default setting */
@@ -155,17 +151,6 @@ odm_TXPowerTrackingCallback_ThermalMeter_8188E(
}
}
- /* Query OFDM path B default setting */
- if (is2t) {
- ele_D = rtl8188e_PHY_QueryBBReg(Adapter, rOFDM0_XBTxIQImbalance, bMaskDWord) & bMaskOFDM_D;
- for (i = 0; i < OFDM_TABLE_SIZE_92D; i++) { /* find the index */
- if (ele_D == (OFDMSwingTable[i] & bMaskOFDM_D)) {
- OFDM_index_old[1] = (u8)i;
- break;
- }
- }
- }
-
/* Query CCK default setting From 0xa24 */
TempCCk = dm_odm->RFCalibrateInfo.RegA24;
@@ -309,39 +294,6 @@ odm_TXPowerTrackingCallback_ThermalMeter_8188E(
/* 2012/04/23 MH According to Luke's suggestion, we can not write BB digital */
/* to increase TX power. Otherwise, EVM will be bad. */
}
-
- if (is2t) {
- ele_D = (OFDMSwingTable[(u8)OFDM_index[1]] & 0xFFC00000) >> 22;
-
- /* new element A = element D x X */
- X = dm_odm->RFCalibrateInfo.IQKMatrixRegSetting.Value[0][4];
- Y = dm_odm->RFCalibrateInfo.IQKMatrixRegSetting.Value[0][5];
-
- if (X != 0) {
- if ((X & 0x00000200) != 0) /* consider minus */
- X = X | 0xFFFFFC00;
- ele_A = ((X * ele_D) >> 8) & 0x000003FF;
-
- /* new element C = element D x Y */
- if ((Y & 0x00000200) != 0)
- Y = Y | 0xFFFFFC00;
- ele_C = ((Y * ele_D) >> 8) & 0x00003FF;
-
- /* wtite new elements A, C, D to regC88 and regC9C, element B is always 0 */
- value32 = (ele_D << 22) | ((ele_C & 0x3F) << 16) | ele_A;
- rtl8188e_PHY_SetBBReg(Adapter, rOFDM0_XBTxIQImbalance, bMaskDWord, value32);
-
- value32 = (ele_C & 0x000003C0) >> 6;
- rtl8188e_PHY_SetBBReg(Adapter, rOFDM0_XDTxAFE, bMaskH4Bits, value32);
-
- value32 = ((X * ele_D) >> 7) & 0x01;
- rtl8188e_PHY_SetBBReg(Adapter, rOFDM0_ECCAThreshold, BIT(28), value32);
- } else {
- rtl8188e_PHY_SetBBReg(Adapter, rOFDM0_XBTxIQImbalance, bMaskDWord, OFDMSwingTable[(u8)OFDM_index[1]]);
- rtl8188e_PHY_SetBBReg(Adapter, rOFDM0_XDTxAFE, bMaskH4Bits, 0x00);
- rtl8188e_PHY_SetBBReg(Adapter, rOFDM0_ECCAThreshold, BIT(28), 0x00);
- }
- }
}
}
--
2.30.2
Powered by blists - more mailing lists