Lines Matching +full:gain +full:- +full:offset
1 // SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
19 RTW8922A_FW_BASENAME "-" __stringify(RTW8922A_FW_FORMAT_MAX) ".bin"
218 [RTW89_EFUSE_BLOCK_SYS] = {.offset = 0x00000, .size = 0x310},
219 [RTW89_EFUSE_BLOCK_RF] = {.offset = 0x10000, .size = 0x240},
220 [RTW89_EFUSE_BLOCK_HCI_DIG_PCIE_SDIO] = {.offset = 0x20000, .size = 0x4800},
221 [RTW89_EFUSE_BLOCK_HCI_DIG_USB] = {.offset = 0x30000, .size = 0x890},
222 [RTW89_EFUSE_BLOCK_HCI_PHY_PCIE] = {.offset = 0x40000, .size = 0x200},
223 [RTW89_EFUSE_BLOCK_HCI_PHY_USB3] = {.offset = 0x50000, .size = 0x80},
224 [RTW89_EFUSE_BLOCK_HCI_PHY_USB2] = {.offset = 0x60000, .size = 0x0},
225 [RTW89_EFUSE_BLOCK_ADIE] = {.offset = 0x70000, .size = 0x10},
260 struct rtw89_hal *hal = &rtwdev->hal; in rtw8922a_pwr_on_func()
365 if (hal->cv != CHIP_CAV) { in rtw8922a_pwr_on_func()
385 set_bit(RTW89_FLAG_DMAC_FUNC, rtwdev->flags); in rtw8922a_pwr_on_func()
396 set_bit(RTW89_FLAG_CMAC0_FUNC, rtwdev->flags); in rtw8922a_pwr_on_func()
401 if (!test_bit(RTW89_FLAG_PROBE_DONE, rtwdev->flags)) in rtw8922a_pwr_on_func()
499 struct rtw8922a_tssi_offset *ofst[] = {&map->path_a_tssi, &map->path_b_tssi}; in rtw8922a_efuse_parsing_tssi()
500 u8 *bw40_1s_tssi_6g_ofst[] = {map->bw40_1s_tssi_6g_a, map->bw40_1s_tssi_6g_b}; in rtw8922a_efuse_parsing_tssi()
501 struct rtw89_tssi_info *tssi = &rtwdev->tssi; in rtw8922a_efuse_parsing_tssi()
504 tssi->thermal[RF_PATH_A] = map->path_a_therm; in rtw8922a_efuse_parsing_tssi()
505 tssi->thermal[RF_PATH_B] = map->path_b_therm; in rtw8922a_efuse_parsing_tssi()
508 memcpy(tssi->tssi_cck[i], ofst[i]->cck_tssi, in rtw8922a_efuse_parsing_tssi()
509 sizeof(ofst[i]->cck_tssi)); in rtw8922a_efuse_parsing_tssi()
514 i, j, tssi->tssi_cck[i][j]); in rtw8922a_efuse_parsing_tssi()
516 memcpy(tssi->tssi_mcs[i], ofst[i]->bw40_tssi, in rtw8922a_efuse_parsing_tssi()
517 sizeof(ofst[i]->bw40_tssi)); in rtw8922a_efuse_parsing_tssi()
518 memcpy(tssi->tssi_mcs[i] + TSSI_MCS_2G_CH_GROUP_NUM, in rtw8922a_efuse_parsing_tssi()
519 ofst[i]->bw40_1s_tssi_5g, sizeof(ofst[i]->bw40_1s_tssi_5g)); in rtw8922a_efuse_parsing_tssi()
520 memcpy(tssi->tssi_6g_mcs[i], bw40_1s_tssi_6g_ofst[i], in rtw8922a_efuse_parsing_tssi()
521 sizeof(tssi->tssi_6g_mcs[i])); in rtw8922a_efuse_parsing_tssi()
526 i, j, tssi->tssi_mcs[i][j]); in rtw8922a_efuse_parsing_tssi()
533 struct rtw89_phy_efuse_gain *gain = &rtwdev->efuse_gain; in rtw8922a_efuse_parsing_gain_offset() local
538 gain->offset[RF_PATH_A][RTW89_GAIN_OFFSET_2G_CCK] = map->rx_gain_a._2g_cck; in rtw8922a_efuse_parsing_gain_offset()
539 gain->offset[RF_PATH_B][RTW89_GAIN_OFFSET_2G_CCK] = map->rx_gain_b._2g_cck; in rtw8922a_efuse_parsing_gain_offset()
540 gain->offset[RF_PATH_A][RTW89_GAIN_OFFSET_2G_OFDM] = map->rx_gain_a._2g_ofdm; in rtw8922a_efuse_parsing_gain_offset()
541 gain->offset[RF_PATH_B][RTW89_GAIN_OFFSET_2G_OFDM] = map->rx_gain_b._2g_ofdm; in rtw8922a_efuse_parsing_gain_offset()
542 gain->offset[RF_PATH_A][RTW89_GAIN_OFFSET_5G_LOW] = map->rx_gain_a._5g_low; in rtw8922a_efuse_parsing_gain_offset()
543 gain->offset[RF_PATH_B][RTW89_GAIN_OFFSET_5G_LOW] = map->rx_gain_b._5g_low; in rtw8922a_efuse_parsing_gain_offset()
544 gain->offset[RF_PATH_A][RTW89_GAIN_OFFSET_5G_MID] = map->rx_gain_a._5g_mid; in rtw8922a_efuse_parsing_gain_offset()
545 gain->offset[RF_PATH_B][RTW89_GAIN_OFFSET_5G_MID] = map->rx_gain_b._5g_mid; in rtw8922a_efuse_parsing_gain_offset()
546 gain->offset[RF_PATH_A][RTW89_GAIN_OFFSET_5G_HIGH] = map->rx_gain_a._5g_high; in rtw8922a_efuse_parsing_gain_offset()
547 gain->offset[RF_PATH_B][RTW89_GAIN_OFFSET_5G_HIGH] = map->rx_gain_b._5g_high; in rtw8922a_efuse_parsing_gain_offset()
548 gain->offset[RF_PATH_A][RTW89_GAIN_OFFSET_6G_L0] = map->rx_gain_6g_a._6g_l0; in rtw8922a_efuse_parsing_gain_offset()
549 gain->offset[RF_PATH_B][RTW89_GAIN_OFFSET_6G_L0] = map->rx_gain_6g_b._6g_l0; in rtw8922a_efuse_parsing_gain_offset()
550 gain->offset[RF_PATH_A][RTW89_GAIN_OFFSET_6G_L1] = map->rx_gain_6g_a._6g_l1; in rtw8922a_efuse_parsing_gain_offset()
551 gain->offset[RF_PATH_B][RTW89_GAIN_OFFSET_6G_L1] = map->rx_gain_6g_b._6g_l1; in rtw8922a_efuse_parsing_gain_offset()
552 gain->offset[RF_PATH_A][RTW89_GAIN_OFFSET_6G_M0] = map->rx_gain_6g_a._6g_m0; in rtw8922a_efuse_parsing_gain_offset()
553 gain->offset[RF_PATH_B][RTW89_GAIN_OFFSET_6G_M0] = map->rx_gain_6g_b._6g_m0; in rtw8922a_efuse_parsing_gain_offset()
554 gain->offset[RF_PATH_A][RTW89_GAIN_OFFSET_6G_M1] = map->rx_gain_6g_a._6g_m1; in rtw8922a_efuse_parsing_gain_offset()
555 gain->offset[RF_PATH_B][RTW89_GAIN_OFFSET_6G_M1] = map->rx_gain_6g_b._6g_m1; in rtw8922a_efuse_parsing_gain_offset()
556 gain->offset[RF_PATH_A][RTW89_GAIN_OFFSET_6G_H0] = map->rx_gain_6g_a._6g_h0; in rtw8922a_efuse_parsing_gain_offset()
557 gain->offset[RF_PATH_B][RTW89_GAIN_OFFSET_6G_H0] = map->rx_gain_6g_b._6g_h0; in rtw8922a_efuse_parsing_gain_offset()
558 gain->offset[RF_PATH_A][RTW89_GAIN_OFFSET_6G_H1] = map->rx_gain_6g_a._6g_h1; in rtw8922a_efuse_parsing_gain_offset()
559 gain->offset[RF_PATH_B][RTW89_GAIN_OFFSET_6G_H1] = map->rx_gain_6g_b._6g_h1; in rtw8922a_efuse_parsing_gain_offset()
560 gain->offset[RF_PATH_A][RTW89_GAIN_OFFSET_6G_UH0] = map->rx_gain_6g_a._6g_uh0; in rtw8922a_efuse_parsing_gain_offset()
561 gain->offset[RF_PATH_B][RTW89_GAIN_OFFSET_6G_UH0] = map->rx_gain_6g_b._6g_uh0; in rtw8922a_efuse_parsing_gain_offset()
562 gain->offset[RF_PATH_A][RTW89_GAIN_OFFSET_6G_UH1] = map->rx_gain_6g_a._6g_uh1; in rtw8922a_efuse_parsing_gain_offset()
563 gain->offset[RF_PATH_B][RTW89_GAIN_OFFSET_6G_UH1] = map->rx_gain_6g_b._6g_uh1; in rtw8922a_efuse_parsing_gain_offset()
567 t = gain->offset[i][j]; in rtw8922a_efuse_parsing_gain_offset()
573 /* transform: sign-bit + U(7,2) to S(8,2) */ in rtw8922a_efuse_parsing_gain_offset()
575 gain->offset[i][j] = (t ^ 0x7f) + 1; in rtw8922a_efuse_parsing_gain_offset()
578 gain->offset_valid = !all_0xff && !all_0x00; in rtw8922a_efuse_parsing_gain_offset()
583 struct rtw89_efuse *efuse = &rtwdev->efuse; in rtw8922a_read_efuse_mac_addr()
589 efuse->addr[i] = val & 0xff; in rtw8922a_read_efuse_mac_addr()
590 efuse->addr[i + 1] = val >> 8; in rtw8922a_read_efuse_mac_addr()
596 struct rtw89_efuse *efuse = &rtwdev->efuse; in rtw8922a_read_efuse_pci_sdio()
598 if (rtwdev->hci.type == RTW89_HCI_TYPE_PCIE) in rtw8922a_read_efuse_pci_sdio()
601 ether_addr_copy(efuse->addr, log_map + 0x001A); in rtw8922a_read_efuse_pci_sdio()
616 struct rtw89_efuse *efuse = &rtwdev->efuse; in rtw8922a_read_efuse_rf()
618 efuse->rfe_type = map->rfe_type; in rtw8922a_read_efuse_rf()
619 efuse->xtal_cap = map->xtal_k; in rtw8922a_read_efuse_rf()
620 efuse->country_code[0] = map->country_code[0]; in rtw8922a_read_efuse_rf()
621 efuse->country_code[1] = map->country_code[1]; in rtw8922a_read_efuse_rf()
625 rtw89_info(rtwdev, "chip rfe_type is %d\n", efuse->rfe_type); in rtw8922a_read_efuse_rf()
652 struct rtw89_power_trim_info *info = &rtwdev->pwr_trim; in rtw8922a_phycap_parsing_thermal_trim()
653 u32 addr = rtwdev->chip->phycap_addr; in rtw8922a_phycap_parsing_thermal_trim()
660 pg_th = phycap_map[thm_trim_addr[i] - addr]; in rtw8922a_phycap_parsing_thermal_trim()
662 info->thermal_trim[i] = 0; in rtw8922a_phycap_parsing_thermal_trim()
670 val *= -1; in rtw8922a_phycap_parsing_thermal_trim()
672 info->thermal_trim[i] = val; in rtw8922a_phycap_parsing_thermal_trim()
679 info->pg_thermal_trim = pg; in rtw8922a_phycap_parsing_thermal_trim()
687 struct rtw89_power_trim_info *info = &rtwdev->pwr_trim; in rtw8922a_phycap_parsing_pa_bias_trim()
688 u32 addr = rtwdev->chip->phycap_addr; in rtw8922a_phycap_parsing_pa_bias_trim()
692 val = phycap_map[check_pa_pad_trim_addr - addr]; in rtw8922a_phycap_parsing_pa_bias_trim()
694 info->pg_pa_bias_trim = true; in rtw8922a_phycap_parsing_pa_bias_trim()
697 info->pa_bias_trim[i] = phycap_map[pabias_trim_addr[i] - addr]; in rtw8922a_phycap_parsing_pa_bias_trim()
701 i, info->pa_bias_trim[i]); in rtw8922a_phycap_parsing_pa_bias_trim()
707 struct rtw89_power_trim_info *info = &rtwdev->pwr_trim; in rtw8922a_pa_bias_trim()
711 if (!info->pg_pa_bias_trim) { in rtw8922a_pa_bias_trim()
719 pabias_2g = FIELD_GET(GENMASK(3, 0), info->pa_bias_trim[i]); in rtw8922a_pa_bias_trim()
720 pabias_5g = FIELD_GET(GENMASK(7, 4), info->pa_bias_trim[i]); in rtw8922a_pa_bias_trim()
735 struct rtw89_power_trim_info *info = &rtwdev->pwr_trim; in rtw8922a_phycap_parsing_pad_bias_trim()
736 u32 addr = rtwdev->chip->phycap_addr; in rtw8922a_phycap_parsing_pad_bias_trim()
740 info->pad_bias_trim[i] = phycap_map[pad_bias_trim_addr[i] - addr]; in rtw8922a_phycap_parsing_pad_bias_trim()
744 i, info->pad_bias_trim[i]); in rtw8922a_phycap_parsing_pad_bias_trim()
750 struct rtw89_power_trim_info *info = &rtwdev->pwr_trim; in rtw8922a_pad_bias_trim()
754 if (!info->pg_pa_bias_trim) { in rtw8922a_pad_bias_trim()
761 pad_bias_2g = u8_get_bits(info->pad_bias_trim[i], GENMASK(3, 0)); in rtw8922a_pad_bias_trim()
762 pad_bias_5g = u8_get_bits(info->pad_bias_trim[i], GENMASK(7, 4)); in rtw8922a_pad_bias_trim()
800 switch (chan->band_width) { in rtw8922a_set_channel_mac()
814 switch (chan->band_width) { in rtw8922a_set_channel_mac()
843 switch (chan->band_type) { in rtw8922a_set_channel_mac()
852 rtw89_warn(rtwdev, "Invalid band_type:%d\n", chan->band_type); in rtw8922a_set_channel_mac()
860 switch (chan->band_width) { in rtw8922a_set_channel_mac()
896 return -EINVAL; in rtw8922a_ctrl_sco_cck()
898 ch_element = primary_ch - 1; in rtw8922a_ctrl_sco_cck()
980 const struct rtw89_phy_bb_gain_info_be *gain = &rtwdev->bb_gain.be; in rtw8922a_set_rpl_gain() local
981 u8 gain_band = rtw89_subband_to_gain_band_be(chan->subband_type); in rtw8922a_set_rpl_gain()
994 val = gain->rpl_ofst_160[gain_band][path][i]; in rtw8922a_set_rpl_gain()
1001 val = gain->rpl_ofst_80[gain_band][path][i]; in rtw8922a_set_rpl_gain()
1008 val = gain->rpl_ofst_40[gain_band][path][i]; in rtw8922a_set_rpl_gain()
1015 val = gain->rpl_ofst_20[gain_band][path][i]; in rtw8922a_set_rpl_gain()
1025 const struct rtw89_phy_bb_gain_info_be *gain = &rtwdev->bb_gain.be; in rtw8922a_set_lna_tia_gain() local
1026 u8 gain_band = rtw89_subband_to_gain_band_be(chan->subband_type); in rtw8922a_set_lna_tia_gain()
1033 bw_type = chan->band_width <= RTW89_CHANNEL_WIDTH_40 ? in rtw8922a_set_lna_tia_gain()
1037 if (chan->band_type == RTW89_BAND_2G) { in rtw8922a_set_lna_tia_gain()
1044 val = gain->lna_gain[gain_band][bw_type][path][i]; in rtw8922a_set_lna_tia_gain()
1049 if (chan->band_type == RTW89_BAND_2G) { in rtw8922a_set_lna_tia_gain()
1056 val = gain->tia_gain[gain_band][bw_type][path][i]; in rtw8922a_set_lna_tia_gain()
1074 struct rtw89_phy_efuse_gain *gain = &rtwdev->efuse_gain; in rtw8922a_set_rx_gain_normal_cck() local
1075 s8 value = -gain->offset[path][RTW89_GAIN_OFFSET_2G_CCK]; /* S(8,2) */ in rtw8922a_set_rx_gain_normal_cck()
1080 (0x4 - fraction) << 1); in rtw8922a_set_rx_gain_normal_cck()
1082 (0x4 - fraction) << 1); in rtw8922a_set_rx_gain_normal_cck()
1106 struct rtw89_phy_efuse_gain *gain = &rtwdev->efuse_gain; in rtw8922a_set_rx_gain_normal_ofdm() local
1111 gain_band = rtw89_subband_to_gain_offset_band_of_ofdm(chan->subband_type); in rtw8922a_set_rx_gain_normal_ofdm()
1112 value = gain->offset[path][gain_band]; in rtw8922a_set_rx_gain_normal_ofdm()
1115 value *= -4; in rtw8922a_set_rx_gain_normal_ofdm()
1117 value -= v1; in rtw8922a_set_rx_gain_normal_ofdm()
1119 value -= v2; in rtw8922a_set_rx_gain_normal_ofdm()
1135 struct rtw89_phy_efuse_gain *gain = &rtwdev->efuse_gain; in rtw8922a_set_rx_gain_normal() local
1137 if (!gain->offset_valid) in rtw8922a_set_rx_gain_normal()
1140 if (chan->band_type == RTW89_BAND_2G) in rtw8922a_set_rx_gain_normal()
1175 u16 central_freq = chan->freq; in rtw8922a_ctrl_ch()
1176 u8 central_ch = chan->channel; in rtw8922a_ctrl_ch()
1177 u8 band = chan->band_type; in rtw8922a_ctrl_ch()
1204 chan_idx = rtw89_encode_chan_idx(rtwdev, chan->primary_channel, band); in rtw8922a_ctrl_ch()
1297 freq_diff = (spur_freq - chan->freq) * 1000000; in rtw8922a_set_csi_tone_idx()
1339 rtw89_phy_write32_idx(rtwdev, nbi->notch1_en.addr, in rtw8922a_set_nbi_tone_idx()
1340 nbi->notch1_en.mask, 0, phy_idx); in rtw8922a_set_nbi_tone_idx()
1341 rtw89_phy_write32_idx(rtwdev, nbi->notch2_en.addr, in rtw8922a_set_nbi_tone_idx()
1342 nbi->notch2_en.mask, 0, phy_idx); in rtw8922a_set_nbi_tone_idx()
1346 fc = chan->freq; in rtw8922a_set_nbi_tone_idx()
1347 if (chan->band_width == RTW89_CHANNEL_WIDTH_160) { in rtw8922a_set_nbi_tone_idx()
1348 fc = (spur_freq > fc) ? fc + 40 : fc - 40; in rtw8922a_set_nbi_tone_idx()
1350 chan->channel < chan->primary_channel) || in rtw8922a_set_nbi_tone_idx()
1352 chan->channel > chan->primary_channel)) in rtw8922a_set_nbi_tone_idx()
1356 freq_diff = (spur_freq - fc) * 1000000; in rtw8922a_set_nbi_tone_idx()
1360 if (chan->band_width == RTW89_CHANNEL_WIDTH_20) { in rtw8922a_set_nbi_tone_idx()
1363 u16 tone_para = (chan->band_width == RTW89_CHANNEL_WIDTH_40) ? in rtw8922a_set_nbi_tone_idx()
1371 if (chan->band_width == RTW89_CHANNEL_WIDTH_160 && notch2_chk) { in rtw8922a_set_nbi_tone_idx()
1372 rtw89_phy_write32_idx(rtwdev, nbi->notch2_idx.addr, in rtw8922a_set_nbi_tone_idx()
1373 nbi->notch2_idx.mask, nbi_tone_idx, phy_idx); in rtw8922a_set_nbi_tone_idx()
1374 rtw89_phy_write32_idx(rtwdev, nbi->notch2_frac_idx.addr, in rtw8922a_set_nbi_tone_idx()
1375 nbi->notch2_frac_idx.mask, nbi_frac_tone_idx, in rtw8922a_set_nbi_tone_idx()
1377 rtw89_phy_write32_idx(rtwdev, nbi->notch2_en.addr, in rtw8922a_set_nbi_tone_idx()
1378 nbi->notch2_en.mask, 0, phy_idx); in rtw8922a_set_nbi_tone_idx()
1379 rtw89_phy_write32_idx(rtwdev, nbi->notch2_en.addr, in rtw8922a_set_nbi_tone_idx()
1380 nbi->notch2_en.mask, 1, phy_idx); in rtw8922a_set_nbi_tone_idx()
1381 rtw89_phy_write32_idx(rtwdev, nbi->notch1_en.addr, in rtw8922a_set_nbi_tone_idx()
1382 nbi->notch1_en.mask, 0, phy_idx); in rtw8922a_set_nbi_tone_idx()
1384 rtw89_phy_write32_idx(rtwdev, nbi->notch1_idx.addr, in rtw8922a_set_nbi_tone_idx()
1385 nbi->notch1_idx.mask, nbi_tone_idx, phy_idx); in rtw8922a_set_nbi_tone_idx()
1386 rtw89_phy_write32_idx(rtwdev, nbi->notch1_frac_idx.addr, in rtw8922a_set_nbi_tone_idx()
1387 nbi->notch1_frac_idx.mask, nbi_frac_tone_idx, in rtw8922a_set_nbi_tone_idx()
1389 rtw89_phy_write32_idx(rtwdev, nbi->notch1_en.addr, in rtw8922a_set_nbi_tone_idx()
1390 nbi->notch1_en.mask, 0, phy_idx); in rtw8922a_set_nbi_tone_idx()
1391 rtw89_phy_write32_idx(rtwdev, nbi->notch1_en.addr, in rtw8922a_set_nbi_tone_idx()
1392 nbi->notch1_en.mask, 1, phy_idx); in rtw8922a_set_nbi_tone_idx()
1393 rtw89_phy_write32_idx(rtwdev, nbi->notch2_en.addr, in rtw8922a_set_nbi_tone_idx()
1394 nbi->notch2_en.mask, 0, phy_idx); in rtw8922a_set_nbi_tone_idx()
1474 rtw89_bbmcu_write32(rtwdev, reg->addr, reg->data, phy_idx); in rtw8922a_bbmcu_cr_init()
1567 if (phy_idx == RTW89_PHY_1 && !rtwdev->dbcc_en) in rtw8922a_ctrl_tx_path_tmac()
1592 ret = -EINVAL; in rtw8922a_ctrl_tx_path_tmac()
1635 return -EINVAL; in rtw8922a_cfg_rx_nss_limit()
1645 if (rtwdev->mlo_dbcc_mode == MLO_1_PLUS_1_1RF) { in rtw8922a_tssi_reset()
1686 return -EINVAL; in rtw8922a_ctrl_rx_path_tmac()
1731 bool enable = chan->band_type != RTW89_BAND_2G; in rtw8922a_digital_pwr_comp()
1734 if (rtwdev->mlo_dbcc_mode == MLO_1_PLUS_1_1RF) { in rtw8922a_digital_pwr_comp()
1758 return -EOPNOTSUPP; in rtw8922a_ctrl_mlo()
1762 rtw8922a_ctrl_afe_dac(rtwdev, chan->band_width, RF_PATH_A); in rtw8922a_ctrl_mlo()
1763 rtw8922a_ctrl_afe_dac(rtwdev, chan->band_width, RF_PATH_B); in rtw8922a_ctrl_mlo()
1800 if (rtwdev->dbcc_en) { in rtw8922a_bb_sethw()
1805 rtw8922a_ctrl_mlo(rtwdev, rtwdev->mlo_dbcc_mode); in rtw8922a_bb_sethw()
1828 bool cck_en = chan->band_type == RTW89_BAND_2G; in rtw8922a_set_channel_bb()
1829 u8 pri_sb = chan->pri_sb_idx; in rtw8922a_set_channel_bb()
1832 rtw8922a_ctrl_sco_cck(rtwdev, chan->primary_channel, in rtw8922a_set_channel_bb()
1833 chan->band_width, phy_idx); in rtw8922a_set_channel_bb()
1836 rtw8922a_ctrl_bw(rtwdev, pri_sb, chan->band_width, phy_idx); in rtw8922a_set_channel_bb()
1847 if (!rtwdev->dbcc_en) in rtw8922a_pre_set_channel_bb()
1870 if (!rtwdev->dbcc_en) in rtw8922a_post_set_channel_bb()
1932 if (rtwdev->mlo_dbcc_mode == MLO_1_PLUS_1_1RF) { in rtw8922a_adc_en()
1977 rtw8922a_hal_reset(rtwdev, phy_idx, mac_idx, chan->band_type, &p->tx_en, enter); in rtw8922a_set_channel_help()
1980 rtw8922a_post_set_channel_bb(rtwdev, rtwdev->mlo_dbcc_mode, phy_idx); in rtw8922a_set_channel_help()
1987 struct rtw89_rfk_mcc_info *rfk_mcc = &rtwdev->rfk_mcc; in rtw8922a_rfk_init()
1989 rtwdev->is_tssi_mode[RF_PATH_A] = false; in rtw8922a_rfk_init()
1990 rtwdev->is_tssi_mode[RF_PATH_B] = false; in rtw8922a_rfk_init()
2025 enum rtw89_chanctx_idx chanctx_idx = rtwvif->chanctx_idx; in rtw8922a_rfk_channel()
2027 enum rtw89_phy_idx phy_idx = rtwvif->phy_idx; in rtw8922a_rfk_channel()
2088 const struct rtw89_rfe_parms *rfe_parms = rtwdev->rfe_parms; in rtw8922a_set_tx_shape()
2089 const struct rtw89_tx_shape *tx_shape = &rfe_parms->tx_shape; in rtw8922a_set_tx_shape()
2093 band = chan->band_type; in rtw8922a_set_tx_shape()
2095 tx_shape_idx = (*tx_shape->lmt)[band][RTW89_RS_OFDM][regd]; in rtw8922a_set_tx_shape()
2184 enum rtw89_band band = chan->band_type; in rtw8922a_bb_cfg_txrx_path()
2185 struct rtw89_hal *hal = &rtwdev->hal; in rtw8922a_bb_cfg_txrx_path()
2189 if (hal->antenna_tx == RF_A) in rtw8922a_bb_cfg_txrx_path()
2191 else if (hal->antenna_tx == RF_B) in rtw8922a_bb_cfg_txrx_path()
2195 if (rtwdev->dbcc_en) in rtw8922a_bb_cfg_txrx_path()
2202 if (rtwdev->dbcc_en) in rtw8922a_bb_cfg_txrx_path()
2209 struct rtw89_power_trim_info *info = &rtwdev->pwr_trim; in rtw8922a_get_thermal()
2223 th += (s8)info->thermal_trim[rf_path]; in rtw8922a_get_thermal()
2230 union rtw89_btc_module_info *md = &rtwdev->btc.mdinfo; in rtw8922a_btc_set_rfe()
2231 struct rtw89_btc_module_v7 *module = &md->md_v7; in rtw8922a_btc_set_rfe()
2233 module->rfe_type = rtwdev->efuse.rfe_type; in rtw8922a_btc_set_rfe()
2234 module->kt_ver = rtwdev->hal.cv; in rtw8922a_btc_set_rfe()
2235 module->bt_solo = 0; in rtw8922a_btc_set_rfe()
2236 module->switch_type = BTC_SWITCH_INTERNAL; in rtw8922a_btc_set_rfe()
2237 module->wa_type = 0; in rtw8922a_btc_set_rfe()
2239 module->ant.type = BTC_ANT_SHARED; in rtw8922a_btc_set_rfe()
2240 module->ant.num = 2; in rtw8922a_btc_set_rfe()
2241 module->ant.isolation = 10; in rtw8922a_btc_set_rfe()
2242 module->ant.diversity = 0; in rtw8922a_btc_set_rfe()
2243 module->ant.single_pos = RF_PATH_A; in rtw8922a_btc_set_rfe()
2244 module->ant.btg_pos = RF_PATH_B; in rtw8922a_btc_set_rfe()
2246 if (module->kt_ver <= 1) in rtw8922a_btc_set_rfe()
2247 module->wa_type |= BTC_WA_HFP_ZB; in rtw8922a_btc_set_rfe()
2249 rtwdev->btc.cx.other.type = BTC_3CX_NONE; in rtw8922a_btc_set_rfe()
2251 if (module->rfe_type == 0) { in rtw8922a_btc_set_rfe()
2252 rtwdev->btc.dm.error.map.rfe_type0 = true; in rtw8922a_btc_set_rfe()
2256 module->ant.num = (module->rfe_type % 2) ? 2 : 3; in rtw8922a_btc_set_rfe()
2258 if (module->kt_ver == 0) in rtw8922a_btc_set_rfe()
2259 module->ant.num = 2; in rtw8922a_btc_set_rfe()
2261 if (module->ant.num == 3) { in rtw8922a_btc_set_rfe()
2262 module->ant.type = BTC_ANT_DEDICATED; in rtw8922a_btc_set_rfe()
2263 module->bt_pos = BTC_BT_ALONE; in rtw8922a_btc_set_rfe()
2265 module->ant.type = BTC_ANT_SHARED; in rtw8922a_btc_set_rfe()
2266 module->bt_pos = BTC_BT_BTG; in rtw8922a_btc_set_rfe()
2268 rtwdev->btc.btg_pos = module->ant.btg_pos; in rtw8922a_btc_set_rfe()
2269 rtwdev->btc.ant_type = module->ant.type; in rtw8922a_btc_set_rfe()
2281 struct rtw89_btc *btc = &rtwdev->btc; in rtw8922a_btc_init_cfg()
2282 struct rtw89_btc_ant_info_v7 *ant = &btc->mdinfo.md_v7.ant; in rtw8922a_btc_init_cfg()
2286 /* for 1-Ant && 1-ss case: only 1-path */ in rtw8922a_btc_init_cfg()
2287 if (ant->num == 1) { in rtw8922a_btc_init_cfg()
2288 path_min = ant->single_pos; in rtw8922a_btc_init_cfg()
2298 /* set DEBUG_LUT_RFMODE_MASK = 1 to start trx-mask-setup */ in rtw8922a_btc_init_cfg()
2301 /* if GNT_WL=0 && BT=SS_group --> WL Tx/Rx = THRU */ in rtw8922a_btc_init_cfg()
2304 /* if GNT_WL=0 && BT=Rx_group --> WL-Rx = THRU + WL-Tx = MASK */ in rtw8922a_btc_init_cfg()
2307 /* if GNT_WL = 0 && BT = Tx_group --> in rtw8922a_btc_init_cfg()
2308 * Shared-Ant && BTG-path:WL mask(0x55f), others:WL THRU(0x5ff) in rtw8922a_btc_init_cfg()
2310 if (btc->ant_type == BTC_ANT_SHARED && btc->btg_pos == path) in rtw8922a_btc_init_cfg()
2318 /* set WL PTA Hi-Pri: Ack-Tx, beacon-tx, Trig-frame-Tx, Null-Tx*/ in rtw8922a_btc_init_cfg()
2326 /* ZB coex table init for HFP PTA req-cmd bit-4 define issue COEX-900*/ in rtw8922a_btc_init_cfg()
2332 btc->cx.wl.status.map.init_ok = true; in rtw8922a_btc_init_cfg()
2375 return clamp_t(s8, val, -100, 0) + 100; in rtw8922a_btc_get_bt_rssi()
2379 {255, 0, 0, 7}, /* 0 -> original */
2380 {255, 2, 0, 7}, /* 1 -> for BT-connected ACI issue && BTG co-rx */
2381 {255, 0, 0, 7}, /* 2 ->reserved for shared-antenna */
2382 {255, 0, 0, 7}, /* 3- >reserved for shared-antenna */
2383 {255, 0, 0, 7}, /* 4 ->reserved for shared-antenna */
2384 {255, 1, 0, 7}, /* the below id is for non-shared-antenna free-run */
2391 {255, 0, 0, 7}, /* 0 -> original */
2392 {255, 2, 0, 7}, /* 1 -> reserved for shared-antenna */
2393 {255, 0, 0, 7}, /* 2 ->reserved for shared-antenna */
2394 {255, 0, 0, 7}, /* 3- >reserved for shared-antenna */
2395 {255, 0, 0, 7}, /* 4 ->reserved for shared-antenna */
2396 {255, 1, 0, 7}, /* the below id is for non-shared-antenna free-run */
2471 u8 chan_idx = phy_ppdu->chan_idx; in rtw8922a_fill_freq_with_ppdu()
2479 status->freq = ieee80211_channel_to_frequency(ch, band); in rtw8922a_fill_freq_with_ppdu()
2480 status->band = band; in rtw8922a_fill_freq_with_ppdu()
2488 u8 *rx_power = phy_ppdu->rssi; in rtw8922a_query_ppdu()
2490 status->signal = in rtw8922a_query_ppdu()
2492 for (path = 0; path < rtwdev->chip->rf_path_num; path++) { in rtw8922a_query_ppdu()
2493 status->chains |= BIT(path); in rtw8922a_query_ppdu()
2494 status->chain_signal[path] = RTW89_RSSI_RAW_TO_DBM(rx_power[path]); in rtw8922a_query_ppdu()
2496 if (phy_ppdu->valid) in rtw8922a_query_ppdu()
2505 u8 *rssi = phy_ppdu->rssi; in rtw8922a_convert_rpl_to_rssi()
2510 if (phy_ppdu->bw_idx < ARRAY_SIZE(bw_compensate)) in rtw8922a_convert_rpl_to_rssi()
2511 compensate = bw_compensate[phy_ppdu->bw_idx]; in rtw8922a_convert_rpl_to_rssi()
2514 if (!(phy_ppdu->rx_path_en & BIT(i))) { in rtw8922a_convert_rpl_to_rssi()
2516 phy_ppdu->rpl_path[i] = 0; in rtw8922a_convert_rpl_to_rssi()
2517 phy_ppdu->rpl_fd[i] = 0; in rtw8922a_convert_rpl_to_rssi()
2519 if (phy_ppdu->rate >= RTW89_HW_RATE_OFDM6) { in rtw8922a_convert_rpl_to_rssi()
2520 rpl_tmp = phy_ppdu->rpl_fd[i]; in rtw8922a_convert_rpl_to_rssi()
2524 phy_ppdu->rpl_path[i] = rpl_tmp; in rtw8922a_convert_rpl_to_rssi()
2526 rssi[i] = phy_ppdu->rpl_path[i]; in rtw8922a_convert_rpl_to_rssi()
2529 phy_ppdu->rssi_avg = phy_ppdu->rpl_avg; in rtw8922a_convert_rpl_to_rssi()