diff mbox series

[v2,08/13] rtw89: Skip useless dig gain and igi related settings for 8852C

Message ID 20220408001353.17188-9-pkshih@realtek.com
State New
Headers show
Series rtw89: refine interrupt masks for SER, and add H2C for new chip | expand

Commit Message

Ping-Ke Shih April 8, 2022, 12:13 a.m. UTC
From: Johnson Lin <johnson.lin@realtek.com>

Separated DIG RX gain, IGI configurations from not supportted HW using
"support_igi" capability flag.

Signed-off-by: Johnson Lin <johnson.lin@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
---
 drivers/net/wireless/realtek/rtw89/phy.c      | 9 +++++++--
 drivers/net/wireless/realtek/rtw89/rtw8852c.c | 1 +
 2 files changed, 8 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/drivers/net/wireless/realtek/rtw89/phy.c b/drivers/net/wireless/realtek/rtw89/phy.c
index 193afb1f53f5a..be9c0cf9e4696 100644
--- a/drivers/net/wireless/realtek/rtw89/phy.c
+++ b/drivers/net/wireless/realtek/rtw89/phy.c
@@ -2930,6 +2930,9 @@  static void rtw89_phy_dig_update_gain_para(struct rtw89_dev *rtwdev)
 	u32 tmp;
 	u8 i;
 
+	if (!rtwdev->hal.support_igi)
+		return;
+
 	tmp = rtw89_phy_read32_mask(rtwdev, R_PATH0_IB_PKPW,
 				    B_PATH0_IB_PKPW_MSK);
 	dig->ib_pkpwr = sign_extend32(tmp >> DIG_GAIN_SHIFT, U8_MAX_BIT);
@@ -3184,6 +3187,9 @@  static void rtw89_phy_dig_config_igi(struct rtw89_dev *rtwdev)
 {
 	struct rtw89_dig_info *dig = &rtwdev->dig;
 
+	if (!rtwdev->hal.support_igi)
+		return;
+
 	if (dig->force_gaincode_idx_en) {
 		rtw89_phy_dig_set_igi_cr(rtwdev, dig->force_gaincode);
 		rtw89_debug(rtwdev, RTW89_DBG_DIG,
@@ -3309,8 +3315,7 @@  void rtw89_phy_dig(struct rtw89_dev *rtwdev)
 		    dig->igi_rssi, dig->dyn_igi_max, dig->dyn_igi_min,
 		    dig->igi_fa_rssi);
 
-	if (rtwdev->hal.support_igi)
-		rtw89_phy_dig_config_igi(rtwdev);
+	rtw89_phy_dig_config_igi(rtwdev);
 
 	rtw89_phy_dig_dyn_pd_th(rtwdev, dig->igi_fa_rssi, dig->dyn_pd_th_en);
 
diff --git a/drivers/net/wireless/realtek/rtw89/rtw8852c.c b/drivers/net/wireless/realtek/rtw89/rtw8852c.c
index 9689fc5a63723..ca254339ea7a9 100644
--- a/drivers/net/wireless/realtek/rtw89/rtw8852c.c
+++ b/drivers/net/wireless/realtek/rtw89/rtw8852c.c
@@ -598,6 +598,7 @@  const struct rtw89_chip_info rtw8852c_chip_info = {
 	.rf_base_addr		= {0xe000, 0xf000},
 	.pwr_on_seq		= NULL,
 	.pwr_off_seq		= NULL,
+	.dig_table		= NULL,
 	.hw_sec_hdr		= true,
 	.sec_ctrl_efuse_size	= 4,
 	.physical_efuse_size	= 1216,