From: Martin Kaiser <martin@kaiser.cx>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Larry Finger <Larry.Finger@lwfinger.net>,
Phillip Potter <phil@philpotter.co.uk>,
Michael Straube <straube.linux@gmail.com>,
linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org,
Martin Kaiser <martin@kaiser.cx>
Subject: [PATCH 2/4] staging: r8188eu: remove dead code for tx power tracking
Date: Thu, 3 Feb 2022 21:32:15 +0100 [thread overview]
Message-ID: <20220203203217.252156-3-martin@kaiser.cx> (raw)
In-Reply-To: <20220203203217.252156-1-martin@kaiser.cx>
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@kaiser.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
next prev parent reply other threads:[~2022-02-03 20:33 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-03 20:32 [PATCH 0/4] staging: r8188eu: remove unused code for RF_PATH_B Martin Kaiser
2022-02-03 20:32 ` [PATCH 1/4] staging: r8188eu: remove constant parameter of phy_LCCalibrate_8188E Martin Kaiser
2022-02-03 20:32 ` Martin Kaiser [this message]
2022-02-03 20:32 ` [PATCH 3/4] staging: r8188eu: remove constant parameter of odm_ConfigRFReg_8188E Martin Kaiser
2022-02-03 20:32 ` [PATCH 4/4] staging: r8188eu: remove constant variable eRFPath Martin Kaiser
2022-02-04 9:09 ` [PATCH v2 0/4] staging: r8188eu: remove unused code for RF_PATH_B Martin Kaiser
2022-02-04 9:09 ` [PATCH v2 1/4] staging: r8188eu: remove constant parameter of phy_LCCalibrate_8188E Martin Kaiser
2022-02-04 9:09 ` [PATCH v2 2/4] staging: r8188eu: remove dead code for tx power tracking Martin Kaiser
2022-02-04 9:09 ` [PATCH v2 3/4] staging: r8188eu: remove constant parameter of odm_ConfigRFReg_8188E Martin Kaiser
2022-02-04 9:09 ` [PATCH v2 4/4] staging: r8188eu: remove constant variable eRFPath Martin Kaiser
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220203203217.252156-3-martin@kaiser.cx \
--to=martin@kaiser.cx \
--cc=Larry.Finger@lwfinger.net \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=phil@philpotter.co.uk \
--cc=straube.linux@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®