linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Martin Kaiser <martin@kaiser.cx>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-staging@lists.linux.dev, kernel-janitors@vger.kernel.org,
	linux-kernel@vger.kernel.org, Martin Kaiser <martin@kaiser.cx>
Subject: [PATCH v2 14/18] staging: rtl8188eu: simplify rtl88eu_phy_iq_calibrate
Date: Mon, 26 Jul 2021 21:53:54 +0200	[thread overview]
Message-ID: <20210726195354.28548-1-martin@kaiser.cx> (raw)
In-Reply-To: <20210725155902.32433-14-martin@kaiser.cx>

The boolean is2t variable in rtl88eu_phy_iq_calibrate is always false.
Remove some code that's unused in this case.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
---
v2:
 - fixed two -Wunused-but-set-variable warnings
   reported by kernel test robot <lkp@intel.com>

 drivers/staging/rtl8188eu/hal/phy.c | 65 ++---------------------------
 1 file changed, 3 insertions(+), 62 deletions(-)

diff --git a/drivers/staging/rtl8188eu/hal/phy.c b/drivers/staging/rtl8188eu/hal/phy.c
index 256f87b9d630..fcac885b6581 100644
--- a/drivers/staging/rtl8188eu/hal/phy.c
+++ b/drivers/staging/rtl8188eu/hal/phy.c
@@ -703,53 +703,6 @@ static void patha_fill_iqk(struct adapter *adapt, bool iqkok, s32 result[][8],
 	}
 }
 
-static void pathb_fill_iqk(struct adapter *adapt, bool iqkok, s32 result[][8],
-			   u8 final_candidate, bool txonly)
-{
-	u32 oldval_1, x, tx1_a, reg;
-	s32 y, tx1_c;
-
-	if (final_candidate == 0xFF) {
-		return;
-	} else if (iqkok) {
-		oldval_1 = (phy_query_bb_reg(adapt, rOFDM0_XBTxIQImbalance, bMaskDWord) >> 22) & 0x3FF;
-
-		x = result[final_candidate][4];
-		if ((x & 0x00000200) != 0)
-			x = x | 0xFFFFFC00;
-		tx1_a = (x * oldval_1) >> 8;
-		phy_set_bb_reg(adapt, rOFDM0_XBTxIQImbalance, 0x3FF, tx1_a);
-
-		phy_set_bb_reg(adapt, rOFDM0_ECCAThreshold, BIT(27),
-			       ((x * oldval_1 >> 7) & 0x1));
-
-		y = result[final_candidate][5];
-		if ((y & 0x00000200) != 0)
-			y = y | 0xFFFFFC00;
-
-		tx1_c = (y * oldval_1) >> 8;
-
-		phy_set_bb_reg(adapt, rOFDM0_XDTxAFE, 0xF0000000,
-			       ((tx1_c & 0x3C0) >> 6));
-		phy_set_bb_reg(adapt, rOFDM0_XBTxIQImbalance, 0x003F0000,
-			       (tx1_c & 0x3F));
-		phy_set_bb_reg(adapt, rOFDM0_ECCAThreshold, BIT(25),
-			       ((y * oldval_1 >> 7) & 0x1));
-
-		if (txonly)
-			return;
-
-		reg = result[final_candidate][6];
-		phy_set_bb_reg(adapt, rOFDM0_XBRxIQImbalance, 0x3FF, reg);
-
-		reg = result[final_candidate][7] & 0x3F;
-		phy_set_bb_reg(adapt, rOFDM0_XBRxIQImbalance, 0xFC00, reg);
-
-		reg = (result[final_candidate][7] >> 6) & 0xF;
-		phy_set_bb_reg(adapt, rOFDM0_AGCRSSITable, 0x0000F000, reg);
-	}
-}
-
 static void save_adda_registers(struct adapter *adapt, const u32 *addareg,
 				u32 *backup, u32 register_num)
 {
@@ -1150,8 +1103,8 @@ void rtl88eu_phy_iq_calibrate(struct adapter *adapt, bool recovery)
 	struct odm_dm_struct *dm_odm = &adapt->HalData->odmpriv;
 	s32 result[4][8];
 	u8 i, final;
-	bool pathaok, pathbok;
-	s32 reg_e94, reg_e9c, reg_ea4, reg_eb4, reg_ebc, reg_ec4;
+	bool pathaok;
+	s32 reg_e94, reg_e9c, reg_ea4, reg_eb4, reg_ebc;
 	bool is12simular, is13simular, is23simular;
 	u32 iqk_bb_reg_92c[IQK_BB_REG_NUM] = {
 		rOFDM0_XARxIQImbalance, rOFDM0_XBRxIQImbalance,
@@ -1159,9 +1112,6 @@ void rtl88eu_phy_iq_calibrate(struct adapter *adapt, bool recovery)
 		rOFDM0_XATxIQImbalance, rOFDM0_XBTxIQImbalance,
 		rOFDM0_XCTxAFE, rOFDM0_XDTxAFE,
 		rOFDM0_RxIQExtAnta};
-	bool is2t;
-
-	is2t = false;
 
 	if (!(dm_odm->SupportAbility & ODM_RF_CALIBRATION))
 		return;
@@ -1178,13 +1128,12 @@ void rtl88eu_phy_iq_calibrate(struct adapter *adapt, bool recovery)
 
 	final = 0xff;
 	pathaok = false;
-	pathbok = false;
 	is12simular = false;
 	is23simular = false;
 	is13simular = false;
 
 	for (i = 0; i < 3; i++) {
-		phy_iq_calibrate(adapt, result, i, is2t);
+		phy_iq_calibrate(adapt, result, i, false);
 
 		if (i == 1) {
 			is12simular = simularity_compare(adapt, result, 0, 1);
@@ -1214,7 +1163,6 @@ void rtl88eu_phy_iq_calibrate(struct adapter *adapt, bool recovery)
 		reg_ea4 = result[i][2];
 		reg_eb4 = result[i][4];
 		reg_ebc = result[i][5];
-		reg_ec4 = result[i][6];
 	}
 
 	if (final != 0xff) {
@@ -1227,9 +1175,7 @@ void rtl88eu_phy_iq_calibrate(struct adapter *adapt, bool recovery)
 		dm_odm->RFCalibrateInfo.RegE9C = reg_e9c;
 		dm_odm->RFCalibrateInfo.RegEB4 = reg_eb4;
 		dm_odm->RFCalibrateInfo.RegEBC = reg_ebc;
-		reg_ec4 = result[final][6];
 		pathaok = true;
-		pathbok = true;
 	} else {
 		dm_odm->RFCalibrateInfo.RegE94 = 0x100;
 		dm_odm->RFCalibrateInfo.RegEB4 = 0x100;
@@ -1239,11 +1185,6 @@ void rtl88eu_phy_iq_calibrate(struct adapter *adapt, bool recovery)
 	if (reg_e94 != 0)
 		patha_fill_iqk(adapt, pathaok, result, final,
 			       (reg_ea4 == 0));
-	if (is2t) {
-		if (reg_eb4 != 0)
-			pathb_fill_iqk(adapt, pathbok, result, final,
-				       (reg_ec4 == 0));
-	}
 
 	if (final < 4) {
 		for (i = 0; i < IQK_Matrix_REG_NUM; i++)
-- 
2.20.1


  parent reply	other threads:[~2021-07-26 19:54 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-25 15:58 [PATCH 01/18] staging: rtl8188eu: remove unused defines Martin Kaiser
2021-07-25 15:58 ` [PATCH 02/18] staging: rtl8188eu: remove HW_VAR_MEDIA_STATUS1 Martin Kaiser
2021-07-25 15:58 ` [PATCH 03/18] staging: rtl8188eu: remove HW_VAR_TXPAUSE Martin Kaiser
2021-07-25 15:58 ` [PATCH 04/18] staging: rtl8188eu: simplify Hal_EfuseParseMACAddr_8188EU Martin Kaiser
2021-07-25 15:58 ` [PATCH 05/18] staging: rtl8188eu: remove an unused enum Martin Kaiser
2021-07-25 15:58 ` [PATCH 06/18] staging: rtl8188eu: remove another " Martin Kaiser
2021-07-25 15:58 ` [PATCH 07/18] staging: rtl8188eu: remove a bunch of unused defines Martin Kaiser
2021-07-25 15:58 ` [PATCH 08/18] staging: rtl8188eu: remove yet another unused enum Martin Kaiser
2021-07-25 15:58 ` [PATCH 09/18] staging: rtl8188eu: remove unused _HAL_INTF_C_ define Martin Kaiser
2021-07-25 16:32   ` Christophe JAILLET
2021-07-25 16:38     ` Greg Kroah-Hartman
2021-07-25 16:45       ` Christophe JAILLET
2021-07-25 15:58 ` [PATCH 10/18] staging: rtl8188eu: remove write-only power struct component Martin Kaiser
2021-07-25 15:58 ` [PATCH 11/18] staging: rtl8188eu: remove two write-only hal components Martin Kaiser
2021-07-25 15:58 ` [PATCH 12/18] staging: rtl8188eu: remove unused IntrMask Martin Kaiser
2021-07-25 15:58 ` [PATCH 13/18] staging: rtl8188eu: remove write-only HwRxPageSize Martin Kaiser
2021-07-25 15:58 ` [PATCH 14/18] staging: rtl8188eu: simplify rtl88eu_phy_iq_calibrate Martin Kaiser
2021-07-25 18:47   ` kernel test robot
2021-07-25 21:03   ` kernel test robot
2021-07-26 19:53   ` Martin Kaiser [this message]
2021-07-25 15:58 ` [PATCH 15/18] staging: rtl8188eu: simplify phy_iq_calibrate Martin Kaiser
2021-07-25 15:59 ` [PATCH 16/18] staging: rtl8188eu: simplify path_adda_on Martin Kaiser
2021-07-25 15:59 ` [PATCH 17/18] staging: rtl8188eu: simplify phy_lc_calibrate Martin Kaiser
2021-07-25 15:59 ` [PATCH 18/18] staging: rtl8188eu: remove unused IQKMatrixRegSetting array 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=20210726195354.28548-1-martin@kaiser.cx \
    --to=martin@kaiser.cx \
    --cc=gregkh@linuxfoundation.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --subject='Re: [PATCH v2 14/18] staging: rtl8188eu: simplify rtl88eu_phy_iq_calibrate' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).