]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
wifi: rtw89: phy: fix incorrect power limit by mac_id
authorPo-Hao Huang <phhuang@realtek.com>
Wed, 14 Jan 2026 01:39:49 +0000 (09:39 +0800)
committerPing-Ke Shih <pkshih@realtek.com>
Thu, 22 Jan 2026 01:43:08 +0000 (09:43 +0800)
Modify the power register range based on chip ability. When not set, the
default value is random. This fixes incorrect power limit on some ICs.

Signed-off-by: Po-Hao Huang <phhuang@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/20260114013950.19704-12-pkshih@realtek.com
drivers/net/wireless/realtek/rtw89/phy_be.c

index 2dbc194eb3299a08cf33feabe99a3ea6175f1347..08fd24a55d852b6b52cf8ab6c0ef7a4b6df61e68 100644 (file)
@@ -455,7 +455,8 @@ void rtw89_phy_bb_wrap_pwr_by_macid_init(struct rtw89_dev *rtwdev)
 {
        const struct rtw89_phy_gen_def *phy = rtwdev->chip->phy_def;
        const struct rtw89_bb_wrap_regs *bb_wrap = phy->bb_wrap;
-       u32 macid_idx, cr, base_macid_lmt, max_macid = 32;
+       u32 max_macid = rtwdev->chip->support_macid_num;
+       u32 macid_idx, cr, base_macid_lmt;
 
        base_macid_lmt = bb_wrap->pwr_macid_lmt;
 
@@ -470,8 +471,9 @@ void rtw89_phy_bb_wrap_tx_path_by_macid_init(struct rtw89_dev *rtwdev)
 {
        const struct rtw89_phy_gen_def *phy = rtwdev->chip->phy_def;
        const struct rtw89_bb_wrap_regs *bb_wrap = phy->bb_wrap;
+       u32 max_macid = rtwdev->chip->support_macid_num;
        u32 cr = bb_wrap->pwr_macid_path;
-       int i, max_macid = 32;
+       int i;
 
        for (i = 0; i < max_macid; i++, cr += 4)
                rtw89_write_bb_wrap_flush(rtwdev, cr, 0);