]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
wifi: rtw89: 8922d: support new digital power compensation format
authorPing-Ke Shih <pkshih@realtek.com>
Wed, 20 May 2026 12:38:19 +0000 (20:38 +0800)
committerPing-Ke Shih <pkshih@realtek.com>
Wed, 27 May 2026 08:28:17 +0000 (16:28 +0800)
The new format shared the base set (7 elements). As there are total 40
sets, save 7 * 39 elements.

Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/20260520123823.1792954-4-pkshih@realtek.com
drivers/net/wireless/realtek/rtw89/rtw8922d.c

index 35014b5144fec23bc3aee83fc294769638c76b17..795efed6e6834bdbb5aa2b0c189840ce53db8925 100644 (file)
@@ -2181,6 +2181,12 @@ static void rtw8922d_set_digital_pwr_comp(struct rtw89_dev *rtwdev,
                        __le32 vals[DIGITAL_PWR_COMP_VALS_NUM];
                } sets[2][RTW89_TX_COMP_BAND_NR][BB_PATH_NUM_8922D];
        } *pwr_comp_v0;
+       const struct {
+               __le32 base[DIGITAL_PWR_COMP_BASE_NUM];
+               struct {
+                       __le32 vals[DIGITAL_PWR_COMP_VALS_NUM];
+               } sets[2][RTW89_TX_COMP_BAND_NR][BB_PATH_NUM_8922D];
+       } *pwr_comp;
        struct rtw89_fw_elm_info *elm_info = &rtwdev->fw.elm_info;
        const struct rtw89_fw_element_hdr *txcomp_elm = elm_info->tx_comp;
        const __le32 (*comp_base)[DIGITAL_PWR_COMP_BASE_NUM];
@@ -2188,7 +2194,11 @@ static void rtw8922d_set_digital_pwr_comp(struct rtw89_dev *rtwdev,
        u32 addr, val;
        u32 i;
 
-       if (sizeof(*pwr_comp_v0) == le32_to_cpu(txcomp_elm->size)) {
+       if (sizeof(*pwr_comp) == le32_to_cpu(txcomp_elm->size)) {
+               pwr_comp = (const void *)txcomp_elm->u.common.contents;
+               comp_base = &pwr_comp->base;
+               comp_vals = &pwr_comp->sets[nss][chan->tx_comp_band][path].vals;
+       } else if (sizeof(*pwr_comp_v0) == le32_to_cpu(txcomp_elm->size)) {
                pwr_comp_v0 = (const void *)txcomp_elm->u.common.contents;
                comp_base = &pwr_comp_v0->sets[nss][chan->tx_comp_band][path].base;
                comp_vals = &pwr_comp_v0->sets[nss][chan->tx_comp_band][path].vals;