Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1503881

[PATCH 07/37] staging:r8188eu: remove is2t argument if the phy_iq_calibrate function

From Ivan Safonov <insafonov@gmail.com>
Newsgroups linux.kernel
Subject [PATCH 07/37] staging:r8188eu: remove is2t argument if the phy_iq_calibrate function
Date 2016-10-19 17:20 +0200
Message-ID <su0OT-308-71@gated-at.bofh.it> (permalink)
References <su0Fb-2Wq-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


is2t argument of this function is constant.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
---
 drivers/staging/rtl8188eu/hal/phy.c | 101 +++---------------------------------
 1 file changed, 6 insertions(+), 95 deletions(-)

diff --git a/drivers/staging/rtl8188eu/hal/phy.c b/drivers/staging/rtl8188eu/hal/phy.c
index c344882..6c6becf 100644
--- a/drivers/staging/rtl8188eu/hal/phy.c
+++ b/drivers/staging/rtl8188eu/hal/phy.c
@@ -687,41 +687,6 @@ static u8 phy_path_a_rx_iqk(struct adapter *adapt, bool configPathB)
 	return result;
 }
 
-static u8 phy_path_b_iqk(struct adapter *adapt)
-{
-	u32 regeac, regeb4, regebc, regec4, regecc;
-	u8 result = 0x00;
-	struct odm_dm_struct *dm_odm = &adapt->HalData->odmpriv;
-
-	/* One shot, path B LOK & IQK */
-	phy_set_bb_reg(adapt, rIQK_AGC_Cont, bMaskDWord, 0x00000002);
-	phy_set_bb_reg(adapt, rIQK_AGC_Cont, bMaskDWord, 0x00000000);
-
-	mdelay(IQK_DELAY_TIME_88E);
-
-	regeac = phy_query_bb_reg(adapt, rRx_Power_After_IQK_A_2, bMaskDWord);
-	regeb4 = phy_query_bb_reg(adapt, rTx_Power_Before_IQK_B, bMaskDWord);
-	regebc = phy_query_bb_reg(adapt, rTx_Power_After_IQK_B, bMaskDWord);
-	regec4 = phy_query_bb_reg(adapt, rRx_Power_Before_IQK_B_2, bMaskDWord);
-	regecc = phy_query_bb_reg(adapt, rRx_Power_After_IQK_B_2, bMaskDWord);
-
-	if (!(regeac & BIT(31)) &&
-	    (((regeb4 & 0x03FF0000)>>16) != 0x142) &&
-	    (((regebc & 0x03FF0000)>>16) != 0x42))
-		result |= 0x01;
-	else
-		return result;
-
-	if (!(regeac & BIT(30)) &&
-	    (((regec4 & 0x03FF0000)>>16) != 0x132) &&
-	    (((regecc & 0x03FF0000)>>16) != 0x36))
-		result |= 0x02;
-	else
-		ODM_RT_TRACE(dm_odm, ODM_COMP_CALIBRATION,
-			     ODM_DBG_LOUD,  ("Path B Rx IQK fail!!\n"));
-	return result;
-}
-
 static void patha_fill_iqk(struct adapter *adapt, bool iqkok, s32 result[][8],
 			   u8 final_candidate, bool txonly)
 {
@@ -839,14 +804,6 @@ static void mac_setting_calibration(struct adapter *adapt, u32 *mac_reg, u32 *ba
 	usb_write8(adapt, mac_reg[i], (u8)(backup[i]&(~BIT(5))));
 }
 
-static void path_a_standby(struct adapter *adapt)
-{
-
-	phy_set_bb_reg(adapt, rFPGA0_IQK, bMaskDWord, 0x0);
-	phy_set_bb_reg(adapt, 0x840, bMaskDWord, 0x00010000);
-	phy_set_bb_reg(adapt, rFPGA0_IQK, bMaskDWord, 0x80800000);
-}
-
 static void pi_mode_switch(struct adapter *adapt, bool pi_mode)
 {
 	u32 mode;
@@ -930,12 +887,11 @@ static bool simularity_compare(struct adapter *adapt, s32 resulta[][8],
 	}
 }
 
-static void phy_iq_calibrate(struct adapter *adapt, s32 result[][8],
-			     u8 t, bool is2t)
+static void phy_iq_calibrate(struct adapter *adapt, s32 result[][8], u8 t)
 {
 	struct odm_dm_struct *dm_odm = &adapt->HalData->odmpriv;
 	u32 i, retry_count = 2;
-	u8 path_a_ok, path_b_ok;
+	u8 path_a_ok;
 	u32 adda_reg[IQK_ADDA_REG_NUM] = {
 					  rFPGA0_XCD_SwitchControl, rBlue_Tooth,
 					  rRx_Wait_CCA, rTx_CCK_RFON,
@@ -968,7 +924,7 @@ static void phy_iq_calibrate(struct adapter *adapt, s32 result[][8],
 				    dm_odm->RFCalibrateInfo.IQK_BB_backup, IQK_BB_REG_NUM);
 	}
 
-	path_adda_on(adapt, adda_reg, true, is2t);
+	path_adda_on(adapt, adda_reg, true, 0);
 	if (t == 0)
 		dm_odm->RFCalibrateInfo.bRfPiEnable = (u8)phy_query_bb_reg(adapt, rFPGA0_XA_HSSIParameter1,
 									   BIT(8));
@@ -989,13 +945,6 @@ static void phy_iq_calibrate(struct adapter *adapt, s32 result[][8],
 	phy_set_bb_reg(adapt, rFPGA0_XA_RFInterfaceOE, BIT(10), 0x00);
 	phy_set_bb_reg(adapt, rFPGA0_XB_RFInterfaceOE, BIT(10), 0x00);
 
-	if (is2t) {
-		phy_set_bb_reg(adapt, rFPGA0_XA_LSSIParameter, bMaskDWord,
-			       0x00010000);
-		phy_set_bb_reg(adapt, rFPGA0_XB_LSSIParameter, bMaskDWord,
-			       0x00010000);
-	}
-
 	/* MAC settings */
 	mac_setting_calibration(adapt, iqk_mac_reg,
 				dm_odm->RFCalibrateInfo.IQK_MAC_backup);
@@ -1004,16 +953,13 @@ static void phy_iq_calibrate(struct adapter *adapt, s32 result[][8],
 	/* AP or IQK */
 	phy_set_bb_reg(adapt, rConfig_AntA, bMaskDWord, 0x0f600000);
 
-	if (is2t)
-		phy_set_bb_reg(adapt, rConfig_AntB, bMaskDWord, 0x0f600000);
-
 	/*  IQ calibration setting */
 	phy_set_bb_reg(adapt, rFPGA0_IQK, bMaskDWord, 0x80800000);
 	phy_set_bb_reg(adapt, rTx_IQK, bMaskDWord, 0x01007c00);
 	phy_set_bb_reg(adapt, rRx_IQK, bMaskDWord, 0x81004800);
 
 	for (i = 0; i < retry_count; i++) {
-		path_a_ok = phy_path_a_iqk(adapt, is2t);
+		path_a_ok = phy_path_a_iqk(adapt, 0);
 		if (path_a_ok == 0x01) {
 				result[t][0] = (phy_query_bb_reg(adapt, rTx_Power_Before_IQK_A,
 								 bMaskDWord)&0x3FF0000)>>16;
@@ -1024,7 +970,7 @@ static void phy_iq_calibrate(struct adapter *adapt, s32 result[][8],
 	}
 
 	for (i = 0; i < retry_count; i++) {
-		path_a_ok = phy_path_a_rx_iqk(adapt, is2t);
+		path_a_ok = phy_path_a_rx_iqk(adapt, 0);
 		if (path_a_ok == 0x03) {
 				result[t][2] = (phy_query_bb_reg(adapt, rRx_Power_Before_IQK_A_2,
 								 bMaskDWord)&0x3FF0000)>>16;
@@ -1042,38 +988,6 @@ static void phy_iq_calibrate(struct adapter *adapt, s32 result[][8],
 			     ("Path A IQK failed!!\n"));
 	}
 
-	if (is2t) {
-		path_a_standby(adapt);
-
-		/*  Turn Path B ADDA on */
-		path_adda_on(adapt, adda_reg, false, is2t);
-
-		for (i = 0; i < retry_count; i++) {
-			path_b_ok = phy_path_b_iqk(adapt);
-			if (path_b_ok == 0x03) {
-				result[t][4] = (phy_query_bb_reg(adapt, rTx_Power_Before_IQK_B,
-								 bMaskDWord)&0x3FF0000)>>16;
-				result[t][5] = (phy_query_bb_reg(adapt, rTx_Power_After_IQK_B,
-								 bMaskDWord)&0x3FF0000)>>16;
-				result[t][6] = (phy_query_bb_reg(adapt, rRx_Power_Before_IQK_B_2,
-								 bMaskDWord)&0x3FF0000)>>16;
-				result[t][7] = (phy_query_bb_reg(adapt, rRx_Power_After_IQK_B_2,
-								 bMaskDWord)&0x3FF0000)>>16;
-				break;
-			} else if (i == (retry_count - 1) && path_b_ok == 0x01) {	/* Tx IQK OK */
-				result[t][4] = (phy_query_bb_reg(adapt, rTx_Power_Before_IQK_B,
-								 bMaskDWord)&0x3FF0000)>>16;
-				result[t][5] = (phy_query_bb_reg(adapt, rTx_Power_After_IQK_B,
-								 bMaskDWord)&0x3FF0000)>>16;
-			}
-		}
-
-		if (0x00 == path_b_ok) {
-			ODM_RT_TRACE(dm_odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD,
-				     ("Path B IQK failed!!\n"));
-		}
-	}
-
 	/* Back to BB mode, load original value */
 	phy_set_bb_reg(adapt, rFPGA0_IQK, bMaskDWord, 0);
 
@@ -1099,9 +1013,6 @@ static void phy_iq_calibrate(struct adapter *adapt, s32 result[][8],
 		/*  Restore RX initial gain */
 		phy_set_bb_reg(adapt, rFPGA0_XA_LSSIParameter,
 			       bMaskDWord, 0x00032ed3);
-		if (is2t)
-			phy_set_bb_reg(adapt, rFPGA0_XB_LSSIParameter,
-				       bMaskDWord, 0x00032ed3);
 
 		/* load 0xe30 IQC default value */
 		phy_set_bb_reg(adapt, rTx_IQK_Tone_A, bMaskDWord, 0x01008c00);
@@ -1217,7 +1128,7 @@ void rtl88eu_phy_iq_calibrate(struct adapter *adapt, bool recovery)
 	is13simular = false;
 
 	for (i = 0; i < 3; i++) {
-		phy_iq_calibrate(adapt, result, i, 0);
+		phy_iq_calibrate(adapt, result, i);
 
 		if (i == 1) {
 			is12simular = simularity_compare(adapt, result, 0, 1);
-- 
2.7.3

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 01/37] staging:r8188eu: remove get_rxmem function Ivan Safonov <insafonov@gmail.com> - 2016-10-19 17:10 +0200
  [PATCH 25/37] staging:r8188eu: remove len member of recv_frame structure Ivan Safonov <insafonov@gmail.com> - 2016-10-19 17:10 +0200
  [PATCH 32/37] staging:r8188eu: remove SET_EARLYMODE_* definitions Ivan Safonov <insafonov@gmail.com> - 2016-10-19 17:10 +0200
  [PATCH 24/37] staging:r8188eu: remove rx_tail member of recv_frame structure Ivan Safonov <insafonov@gmail.com> - 2016-10-19 17:10 +0200
  [PATCH 13/37] staging:r8188eu: remove debug messages after memory allocation failed Ivan Safonov <insafonov@gmail.com> - 2016-10-19 17:20 +0200
    Re: [PATCH 13/37] staging:r8188eu: remove debug messages after  memory allocation failed Dan Carpenter <dan.carpenter@oracle.com> - 2016-10-25 11:20 +0200
  [PATCH 21/37] staging:r8188eu: change recvframe_pull_tail last argument type Ivan Safonov <insafonov@gmail.com> - 2016-10-19 17:20 +0200
  [PATCH 02/37] staging:r8188eu: remove device assignment after netdev_alloc_skb call Ivan Safonov <insafonov@gmail.com> - 2016-10-19 17:20 +0200
    Re: [PATCH 02/37] staging:r8188eu: remove device assignment after  netdev_alloc_skb call Andy Shevchenko <andriy.shevchenko@linux.intel.com> - 2016-10-19 19:00 +0200
      Re: [PATCH 02/37] staging:r8188eu: remove device assignment after  netdev_alloc_skb call Andy Shevchenko <andriy.shevchenko@linux.intel.com> - 2016-10-19 19:10 +0200
        Re: [PATCH 02/37] staging:r8188eu: remove device assignment after  netdev_alloc_skb call Ivan Safonov <insafonov@gmail.com> - 2016-10-20 14:20 +0200
          Re: [PATCH 02/37] staging:r8188eu: remove device assignment after  netdev_alloc_skb call Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-10-25 11:00 +0200
    Re: [PATCH 02/37] staging:r8188eu: remove device assignment after  netdev_alloc_skb call Dan Carpenter <dan.carpenter@oracle.com> - 2016-10-20 10:50 +0200
  [PATCH 37/37] staging:r8188eu: remove P2P_* enumerations. Ivan Safonov <insafonov@gmail.com> - 2016-10-19 17:20 +0200
  [PATCH 19/37] staging:r8188eu: remove rx_end member of recv_frame structure Ivan Safonov <insafonov@gmail.com> - 2016-10-19 17:20 +0200
  [PATCH 04/37] staging:r8188eu: remove WIFI_MP_* definitions and all corresponding code Ivan Safonov <insafonov@gmail.com> - 2016-10-19 17:20 +0200
  [PATCH 30/37] staging:r8188eu: remove eth_type member of rx_pkt_attrib structure Ivan Safonov <insafonov@gmail.com> - 2016-10-19 17:20 +0200
  [PATCH 16/37] staging:r8188eu: change recvframe_pull last argument type Ivan Safonov <insafonov@gmail.com> - 2016-10-19 17:20 +0200
  [PATCH 36/37] staging:r8188eu: remove unused structures from include/rtw_mlme.h Ivan Safonov <insafonov@gmail.com> - 2016-10-19 17:20 +0200
  [PATCH 03/37] staging:r8188eu: remove skb cloning after netdev_alloc_skb fail Ivan Safonov <insafonov@gmail.com> - 2016-10-19 17:20 +0200
    Re: [PATCH 03/37] staging:r8188eu: remove skb cloning after  netdev_alloc_skb fail Dan Carpenter <dan.carpenter@oracle.com> - 2016-10-20 10:50 +0200
  [PATCH 27/37] staging:r8188eu: remove recvframe_put function Ivan Safonov <insafonov@gmail.com> - 2016-10-19 17:20 +0200
  [PATCH 07/37] staging:r8188eu: remove is2t argument if the phy_iq_calibrate function Ivan Safonov <insafonov@gmail.com> - 2016-10-19 17:20 +0200
  [PATCH 11/37] staging:r8188eu: remove is_(multicast|broadcast)_mac_addr Ivan Safonov <insafonov@gmail.com> - 2016-10-19 17:20 +0200
  [PATCH 10/37] staging:r8188eu: remove type cast for first argument of memset Ivan Safonov <insafonov@gmail.com> - 2016-10-19 17:20 +0200
  [PATCH 14/37] staging:r8188eu: remove ieee80211_is_empty_essid function Ivan Safonov <insafonov@gmail.com> - 2016-10-19 17:30 +0200
  [PATCH 15/37] staging:r8188eu: remove rx_head member of recv_frame structure Ivan Safonov <insafonov@gmail.com> - 2016-10-19 17:30 +0200
  [PATCH 34/37] staging:r8188eu: remove update_bcn member of mlme_priv structure Ivan Safonov <insafonov@gmail.com> - 2016-10-19 17:30 +0200
  [PATCH 23/37] staging:r8188eu: update rx_tail and pkt->tail synchronously Ivan Safonov <insafonov@gmail.com> - 2016-10-19 17:30 +0200
  [PATCH 20/37] staging:r8188eu: change recvframe_put last argument type Ivan Safonov <insafonov@gmail.com> - 2016-10-19 17:30 +0200
  [PATCH 22/37] staging:r8188eu: change recvframe_pull_tail type to void Ivan Safonov <insafonov@gmail.com> - 2016-10-19 17:30 +0200
  [PATCH 31/37] staging:r8188eu: remove pscanned member of mlme_priv structure Ivan Safonov <insafonov@gmail.com> - 2016-10-19 17:30 +0200
  [PATCH 35/37] staging:r8188eu: remove clr_fwstate* functions Ivan Safonov <insafonov@gmail.com> - 2016-10-19 17:30 +0200
  [PATCH 29/37] staging:r8188eu: take out stripping of iv and icv space from wlanhdr_to_ethhdr function Ivan Safonov <insafonov@gmail.com> - 2016-10-19 17:30 +0200
    Re: [PATCH 29/37] staging:r8188eu: take out stripping of iv and icv  space from wlanhdr_to_ethhdr function Dan Carpenter <dan.carpenter@oracle.com> - 2016-10-20 11:20 +0200
  [PATCH 12/37] staging:r8188eu: remove ieee80211_get_hdrlen function Ivan Safonov <insafonov@gmail.com> - 2016-10-19 17:30 +0200
  [PATCH 26/37] staging:r8188eu: remove recvframe_pull function Ivan Safonov <insafonov@gmail.com> - 2016-10-19 17:30 +0200
  [PATCH 09/37] staging:r8188eu: remove is2t argument of phy_lc_calibrate function Ivan Safonov <insafonov@gmail.com> - 2016-10-19 17:30 +0200
  [PATCH 28/37] staging:r8188eu: remove recvframe_pull_tail function Ivan Safonov <insafonov@gmail.com> - 2016-10-19 17:30 +0200
  [PATCH 18/37] staging:r8188eu: remove rx_data member of recv_frame structure Ivan Safonov <insafonov@gmail.com> - 2016-10-19 17:30 +0200
  [PATCH 08/37] staging:r8188eu: refactor path_adda_on function Ivan Safonov <insafonov@gmail.com> - 2016-10-19 17:30 +0200
  Re: [PATCH 01/37] staging:r8188eu: remove get_rxmem function Dan Carpenter <dan.carpenter@oracle.com> - 2016-10-20 11:20 +0200
    Re: [PATCH 01/37] staging:r8188eu: remove get_rxmem function Ivan Safonov <insafonov@gmail.com> - 2016-10-20 16:00 +0200

csiph-web