From: Ping-Ke Shih <pkshih@realtek.com>
To: <linux-wireless@vger.kernel.org>
Cc: <ku920601@realtek.com>, <damon.chen@realtek.com>,
<phhuang@realtek.com>, <kevin_yang@realtek.com>
Subject: [PATCH rtw-next 04/11] wifi: rtw89: 8922d: set CFR clip threshold while setting channel
Date: Thu, 12 Nov 2026 14:05:53 +0800 [thread overview]
Message-ID: <20261112060600.71784-5-pkshih@realtek.com> (raw)
In-Reply-To: <20261112060600.71784-1-pkshih@realtek.com>
Set thresholds to let CFR circuit to clip TX peak amplitudes per band.
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
---
drivers/net/wireless/realtek/rtw89/reg.h | 3 +++
drivers/net/wireless/realtek/rtw89/rtw8922d.c | 18 ++++++++++++++++++
2 files changed, 21 insertions(+)
diff --git a/drivers/net/wireless/realtek/rtw89/reg.h b/drivers/net/wireless/realtek/rtw89/reg.h
index edbfc9514a08..4bee9f66038c 100644
--- a/drivers/net/wireless/realtek/rtw89/reg.h
+++ b/drivers/net/wireless/realtek/rtw89/reg.h
@@ -10967,6 +10967,9 @@
#define R_OFDM_RPL_BIAS_P1_BE4 0x2460C
#define B_OFDM_RPL_BIAS_P1_BE4 GENMASK(11, 2)
#define R_TX_CFR_MANUAL_EN_BE4 0x2483C
+#define B_TX_CFR_CLIP_TH0_BE4 GENMASK(19, 15)
+#define B_TX_CFR_CLIP_TH1_BE4 GENMASK(24, 20)
+#define B_TX_CFR_CLIP_TH2_BE4 GENMASK(29, 25)
#define B_TX_CFR_MANUAL_EN_BE4_M BIT(30)
#define R_PCOEFF0_BE4 0x24880
#define B_PCOEFF01_BE4 GENMASK(23, 0)
diff --git a/drivers/net/wireless/realtek/rtw89/rtw8922d.c b/drivers/net/wireless/realtek/rtw89/rtw8922d.c
index b874bac9bfee..ca7491bb9045 100644
--- a/drivers/net/wireless/realtek/rtw89/rtw8922d.c
+++ b/drivers/net/wireless/realtek/rtw89/rtw8922d.c
@@ -1969,6 +1969,23 @@ static void rtw8922d_ctrl_bw(struct rtw89_dev *rtwdev, u8 pri_sb, u8 bw,
}
}
+static void rtw8922d_cfr_clip_th(struct rtw89_dev *rtwdev,
+ const struct rtw89_chan *chan,
+ enum rtw89_phy_idx phy_idx)
+{
+ static const u32 clip_th0[RTW89_BAND_NUM] = {0x8, 0x8, 0x8};
+ static const u32 clip_th1[RTW89_BAND_NUM] = {0x18, 0x14, 0x14};
+ static const u32 clip_th2[RTW89_BAND_NUM] = {0x8, 0x8, 0x8};
+ u8 band = chan->band_type;
+
+ rtw89_phy_write32_idx(rtwdev, R_TX_CFR_MANUAL_EN_BE4, B_TX_CFR_CLIP_TH0_BE4,
+ clip_th0[band], phy_idx);
+ rtw89_phy_write32_idx(rtwdev, R_TX_CFR_MANUAL_EN_BE4, B_TX_CFR_CLIP_TH1_BE4,
+ clip_th1[band], phy_idx);
+ rtw89_phy_write32_idx(rtwdev, R_TX_CFR_MANUAL_EN_BE4, B_TX_CFR_CLIP_TH2_BE4,
+ clip_th2[band], phy_idx);
+}
+
static const u16 spur_nbi_a[] = {6400};
static const u16 spur_csi[] = {6400};
@@ -2551,6 +2568,7 @@ static void rtw8922d_set_channel_bb(struct rtw89_dev *rtwdev,
rtw8922d_ctrl_ch(rtwdev, chan, phy_idx);
rtw8922d_ctrl_bw(rtwdev, pri_sb, chan->band_width, phy_idx);
+ rtw8922d_cfr_clip_th(rtwdev, chan, phy_idx);
rtw89_phy_bb_wrap_set_rfsi_bandedge_ch(rtwdev, chan, phy_idx);
if (cck_en)
--
2.53.0
next prev parent reply other threads:[~2026-11-12 6:06 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-12 6:05 [PATCH rtw-next 00/11] wifi: rtw89: correct no 2GHz band condition, update RTL8922D settings Ping-Ke Shih
2026-11-12 6:05 ` [PATCH rtw-next 01/11] wifi: rtw89: coex: add a notify entry for dynamic MLO RF-path switch Ping-Ke Shih
2026-11-12 6:05 ` [PATCH rtw-next 02/11] wifi: rtw89: pci: reclaim TXBD before fully draining Ping-Ke Shih
2026-11-12 6:05 ` [PATCH rtw-next 03/11] wifi: rtw89: 8922d: use efuse bias for CCK RX gain Ping-Ke Shih
2026-11-12 6:05 ` Ping-Ke Shih [this message]
2026-11-12 6:05 ` [PATCH rtw-next 05/11] wifi: rtw89: 8922d: correct thermal trim range to -16~+16 programmed in efuse Ping-Ke Shih
2026-11-12 6:05 ` [PATCH rtw-next 06/11] wifi: rtw89: introduce bitmap of supported bands to deal with quirks Ping-Ke Shih
2026-11-12 6:05 ` [PATCH rtw-next 07/11] wifi: rtw89: get default channel based on supported bands Ping-Ke Shih
2026-11-12 6:05 ` [PATCH rtw-next 08/11] wifi: rtw89: fix band assignment in rtw89_core_update_rx_freq_from_ie() Ping-Ke Shih
2026-11-12 6:05 ` [PATCH rtw-next 09/11] wifi: rtw89: Update sequence for MLO link switch Ping-Ke Shih
2026-11-12 6:05 ` [PATCH rtw-next 10/11] wifi: rtw89: 8922d: enable dynamic antenna gain Ping-Ke Shih
2026-11-12 6:06 ` [PATCH rtw-next 11/11] wifi: rtw89: phy: fix antenna gain unit in debug output Ping-Ke Shih
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=20261112060600.71784-5-pkshih@realtek.com \
--to=pkshih@realtek.com \
--cc=damon.chen@realtek.com \
--cc=kevin_yang@realtek.com \
--cc=ku920601@realtek.com \
--cc=linux-wireless@vger.kernel.org \
--cc=phhuang@realtek.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