diff mbox series

rtlwifi: rtl8192ce: remove duplicated function '_rtl92ce_phy_set_rf_sleep'

Message ID 20220306090846.28523-1-jiconglu58@gmail.com
State New
Headers show
Series rtlwifi: rtl8192ce: remove duplicated function '_rtl92ce_phy_set_rf_sleep' | expand

Commit Message

Lu jicong March 6, 2022, 9:08 a.m. UTC
This function exists in phy_common.c as '_rtl92c_phy_set_rf_sleep'.
Switch to the one in common file.

Signed-off-by: Lu Jicong <jiconglu58@gmail.com>
---
 .../wireless/realtek/rtlwifi/rtl8192ce/phy.c  | 32 +------------------
 1 file changed, 1 insertion(+), 31 deletions(-)

Comments

Ping-Ke Shih March 8, 2022, 12:13 a.m. UTC | #1
> -----Original Message-----
> From: Lu Jicong <jiconglu58@gmail.com>
> Sent: Sunday, March 6, 2022 5:09 PM
> To: Pkshih <pkshih@realtek.com>; kvalo@kernel.org; davem@davemloft.net; kuba@kernel.org
> Cc: linux-wireless@vger.kernel.org; netdev@vger.kernel.org; linux-kernel@vger.kernel.org; Lu Jicong
> <jiconglu58@gmail.com>
> Subject: [PATCH] rtlwifi: rtl8192ce: remove duplicated function '_rtl92ce_phy_set_rf_sleep'
> 
> This function exists in phy_common.c as '_rtl92c_phy_set_rf_sleep'.
> Switch to the one in common file.
> 
> Signed-off-by: Lu Jicong <jiconglu58@gmail.com>

Acked-by: Ping-Ke Shih <pkshih@realtek.com>
Kalle Valo March 10, 2022, 4:18 p.m. UTC | #2
Lu Jicong <jiconglu58@gmail.com> wrote:

> This function exists in phy_common.c as '_rtl92c_phy_set_rf_sleep'.
> Switch to the one in common file.
> 
> Signed-off-by: Lu Jicong <jiconglu58@gmail.com>
> Acked-by: Ping-Ke Shih <pkshih@realtek.com>

Patch applied to wireless-next.git, thanks.

cb459950edcf rtlwifi: rtl8192ce: remove duplicated function '_rtl92ce_phy_set_rf_sleep'
diff mbox series

Patch

diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192ce/phy.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192ce/phy.c
index 04735da11168..da54e51badd3 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192ce/phy.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192ce/phy.c
@@ -396,36 +396,6 @@  void _rtl92ce_phy_lc_calibrate(struct ieee80211_hw *hw, bool is2t)
 	}
 }
 
-static void _rtl92ce_phy_set_rf_sleep(struct ieee80211_hw *hw)
-{
-	u32 u4b_tmp;
-	u8 delay = 5;
-	struct rtl_priv *rtlpriv = rtl_priv(hw);
-
-	rtl_write_byte(rtlpriv, REG_TXPAUSE, 0xFF);
-	rtl_set_rfreg(hw, RF90_PATH_A, 0x00, RFREG_OFFSET_MASK, 0x00);
-	rtl_write_byte(rtlpriv, REG_APSD_CTRL, 0x40);
-	u4b_tmp = rtl_get_rfreg(hw, RF90_PATH_A, 0, RFREG_OFFSET_MASK);
-	while (u4b_tmp != 0 && delay > 0) {
-		rtl_write_byte(rtlpriv, REG_APSD_CTRL, 0x0);
-		rtl_set_rfreg(hw, RF90_PATH_A, 0x00, RFREG_OFFSET_MASK, 0x00);
-		rtl_write_byte(rtlpriv, REG_APSD_CTRL, 0x40);
-		u4b_tmp = rtl_get_rfreg(hw, RF90_PATH_A, 0, RFREG_OFFSET_MASK);
-		delay--;
-	}
-	if (delay == 0) {
-		rtl_write_byte(rtlpriv, REG_APSD_CTRL, 0x00);
-		rtl_write_byte(rtlpriv, REG_SYS_FUNC_EN, 0xE2);
-		rtl_write_byte(rtlpriv, REG_SYS_FUNC_EN, 0xE3);
-		rtl_write_byte(rtlpriv, REG_TXPAUSE, 0x00);
-		rtl_dbg(rtlpriv, COMP_POWER, DBG_TRACE,
-			"Switch RF timeout !!!\n");
-		return;
-	}
-	rtl_write_byte(rtlpriv, REG_SYS_FUNC_EN, 0xE2);
-	rtl_write_byte(rtlpriv, REG_SPS0_CTRL, 0x22);
-}
-
 static bool _rtl92ce_phy_set_rf_power_state(struct ieee80211_hw *hw,
 					    enum rf_pwrstate rfpwr_state)
 {
@@ -519,7 +489,7 @@  static bool _rtl92ce_phy_set_rf_power_state(struct ieee80211_hw *hw,
 				jiffies_to_msecs(jiffies -
 						 ppsc->last_awake_jiffies));
 			ppsc->last_sleep_jiffies = jiffies;
-			_rtl92ce_phy_set_rf_sleep(hw);
+			_rtl92c_phy_set_rf_sleep(hw);
 			break;
 		}
 	default: