wifi: rtw89: 8922d: support new digital power compensation format

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
This commit is contained in:
Ping-Ke Shih 2026-05-20 20:38:19 +08:00
parent 57efc7b096
commit c77a155c96

View 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;