Lines Matching +full:gain +full:- +full:offset

1 // SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
177 ether_addr_copy(efuse->addr, map->e.mac_addr); in rtw8852be_efuse_parsing()
178 efuse->rfe_type = map->rfe_type; in rtw8852be_efuse_parsing()
179 efuse->xtal_cap = map->xtal_k; in rtw8852be_efuse_parsing()
185 struct rtw89_tssi_info *tssi = &rtwdev->tssi; in rtw8852bx_efuse_parsing_tssi()
186 struct rtw8852bx_tssi_offset *ofst[] = {&map->path_a_tssi, &map->path_b_tssi}; in rtw8852bx_efuse_parsing_tssi()
189 tssi->thermal[RF_PATH_A] = map->path_a_therm; in rtw8852bx_efuse_parsing_tssi()
190 tssi->thermal[RF_PATH_B] = map->path_b_therm; in rtw8852bx_efuse_parsing_tssi()
193 memcpy(tssi->tssi_cck[i], ofst[i]->cck_tssi, in rtw8852bx_efuse_parsing_tssi()
194 sizeof(ofst[i]->cck_tssi)); in rtw8852bx_efuse_parsing_tssi()
199 i, j, tssi->tssi_cck[i][j]); in rtw8852bx_efuse_parsing_tssi()
201 memcpy(tssi->tssi_mcs[i], ofst[i]->bw40_tssi, in rtw8852bx_efuse_parsing_tssi()
202 sizeof(ofst[i]->bw40_tssi)); in rtw8852bx_efuse_parsing_tssi()
203 memcpy(tssi->tssi_mcs[i] + TSSI_MCS_2G_CH_GROUP_NUM, in rtw8852bx_efuse_parsing_tssi()
204 ofst[i]->bw40_1s_tssi_5g, sizeof(ofst[i]->bw40_1s_tssi_5g)); in rtw8852bx_efuse_parsing_tssi()
209 i, j, tssi->tssi_mcs[i][j]); in rtw8852bx_efuse_parsing_tssi()
226 struct rtw89_phy_efuse_gain *gain = &rtwdev->efuse_gain; in rtw8852bx_efuse_parsing_gain_offset() local
229 valid |= _decode_efuse_gain(map->rx_gain_2g_cck, in rtw8852bx_efuse_parsing_gain_offset()
230 &gain->offset[RF_PATH_A][RTW89_GAIN_OFFSET_2G_CCK], in rtw8852bx_efuse_parsing_gain_offset()
231 &gain->offset[RF_PATH_B][RTW89_GAIN_OFFSET_2G_CCK]); in rtw8852bx_efuse_parsing_gain_offset()
232 valid |= _decode_efuse_gain(map->rx_gain_2g_ofdm, in rtw8852bx_efuse_parsing_gain_offset()
233 &gain->offset[RF_PATH_A][RTW89_GAIN_OFFSET_2G_OFDM], in rtw8852bx_efuse_parsing_gain_offset()
234 &gain->offset[RF_PATH_B][RTW89_GAIN_OFFSET_2G_OFDM]); in rtw8852bx_efuse_parsing_gain_offset()
235 valid |= _decode_efuse_gain(map->rx_gain_5g_low, in rtw8852bx_efuse_parsing_gain_offset()
236 &gain->offset[RF_PATH_A][RTW89_GAIN_OFFSET_5G_LOW], in rtw8852bx_efuse_parsing_gain_offset()
237 &gain->offset[RF_PATH_B][RTW89_GAIN_OFFSET_5G_LOW]); in rtw8852bx_efuse_parsing_gain_offset()
238 valid |= _decode_efuse_gain(map->rx_gain_5g_mid, in rtw8852bx_efuse_parsing_gain_offset()
239 &gain->offset[RF_PATH_A][RTW89_GAIN_OFFSET_5G_MID], in rtw8852bx_efuse_parsing_gain_offset()
240 &gain->offset[RF_PATH_B][RTW89_GAIN_OFFSET_5G_MID]); in rtw8852bx_efuse_parsing_gain_offset()
241 valid |= _decode_efuse_gain(map->rx_gain_5g_high, in rtw8852bx_efuse_parsing_gain_offset()
242 &gain->offset[RF_PATH_A][RTW89_GAIN_OFFSET_5G_HIGH], in rtw8852bx_efuse_parsing_gain_offset()
243 &gain->offset[RF_PATH_B][RTW89_GAIN_OFFSET_5G_HIGH]); in rtw8852bx_efuse_parsing_gain_offset()
245 gain->offset_valid = valid; in rtw8852bx_efuse_parsing_gain_offset()
251 struct rtw89_efuse *efuse = &rtwdev->efuse; in __rtw8852bx_read_efuse()
256 efuse->country_code[0] = map->country_code[0]; in __rtw8852bx_read_efuse()
257 efuse->country_code[1] = map->country_code[1]; in __rtw8852bx_read_efuse()
261 switch (rtwdev->hci.type) { in __rtw8852bx_read_efuse()
266 return -EOPNOTSUPP; in __rtw8852bx_read_efuse()
269 rtw89_info(rtwdev, "chip rfe_type is %d\n", efuse->rfe_type); in __rtw8852bx_read_efuse()
278 u32 offset = PWR_K_CHK_OFFSET - rtwdev->chip->phycap_addr; in rtw8852bx_phycap_parsing_power_cal() local
280 if (phycap_map[offset] == PWR_K_CHK_VALUE) in rtw8852bx_phycap_parsing_power_cal()
281 rtwdev->efuse.power_k_valid = true; in rtw8852bx_phycap_parsing_power_cal()
286 struct rtw89_tssi_info *tssi = &rtwdev->tssi; in rtw8852bx_phycap_parsing_tssi()
288 u32 addr = rtwdev->chip->phycap_addr; in rtw8852bx_phycap_parsing_tssi()
296 ofst = tssi_trim_addr[i] - addr - j; in rtw8852bx_phycap_parsing_tssi()
297 tssi->tssi_trim[i][j] = phycap_map[ofst]; in rtw8852bx_phycap_parsing_tssi()
305 memset(tssi->tssi_trim, 0, sizeof(tssi->tssi_trim)); in rtw8852bx_phycap_parsing_tssi()
314 i, j, tssi->tssi_trim[i][j], in rtw8852bx_phycap_parsing_tssi()
315 tssi_trim_addr[i] - j); in rtw8852bx_phycap_parsing_tssi()
321 struct rtw89_power_trim_info *info = &rtwdev->pwr_trim; in rtw8852bx_phycap_parsing_thermal_trim()
323 u32 addr = rtwdev->chip->phycap_addr; in rtw8852bx_phycap_parsing_thermal_trim()
327 info->thermal_trim[i] = phycap_map[thm_trim_addr[i] - addr]; in rtw8852bx_phycap_parsing_thermal_trim()
331 i, info->thermal_trim[i]); in rtw8852bx_phycap_parsing_thermal_trim()
333 if (info->thermal_trim[i] != 0xff) in rtw8852bx_phycap_parsing_thermal_trim()
334 info->pg_thermal_trim = true; in rtw8852bx_phycap_parsing_thermal_trim()
345 struct rtw89_power_trim_info *info = &rtwdev->pwr_trim; in rtw8852bx_thermal_trim()
348 if (!info->pg_thermal_trim) { in rtw8852bx_thermal_trim()
356 val = __thm_setting(info->thermal_trim[i]); in rtw8852bx_thermal_trim()
369 struct rtw89_power_trim_info *info = &rtwdev->pwr_trim; in rtw8852bx_phycap_parsing_pa_bias_trim()
371 u32 addr = rtwdev->chip->phycap_addr; in rtw8852bx_phycap_parsing_pa_bias_trim()
375 info->pa_bias_trim[i] = phycap_map[pabias_trim_addr[i] - addr]; in rtw8852bx_phycap_parsing_pa_bias_trim()
379 i, info->pa_bias_trim[i]); in rtw8852bx_phycap_parsing_pa_bias_trim()
381 if (info->pa_bias_trim[i] != 0xff) in rtw8852bx_phycap_parsing_pa_bias_trim()
382 info->pg_pa_bias_trim = true; in rtw8852bx_phycap_parsing_pa_bias_trim()
388 struct rtw89_power_trim_info *info = &rtwdev->pwr_trim; in rtw8852bx_pa_bias_trim()
392 if (!info->pg_pa_bias_trim) { in rtw8852bx_pa_bias_trim()
400 pabias_2g = FIELD_GET(GENMASK(3, 0), info->pa_bias_trim[i]); in rtw8852bx_pa_bias_trim()
401 pabias_5g = FIELD_GET(GENMASK(7, 4), info->pa_bias_trim[i]); in rtw8852bx_pa_bias_trim()
418 struct rtw89_phy_efuse_gain *gain = &rtwdev->efuse_gain; in rtw8852bx_phycap_parsing_gain_comp() local
419 u32 phycap_addr = rtwdev->chip->phycap_addr; in rtw8852bx_phycap_parsing_gain_comp()
429 data = phycap_map[comp_addrs[path][i] - phycap_addr]; in rtw8852bx_phycap_parsing_gain_comp()
431 &gain->comp[path][i]); in rtw8852bx_phycap_parsing_gain_comp()
434 gain->comp_valid = valid; in rtw8852bx_phycap_parsing_gain_comp()
463 switch (chan->band_width) { in __rtw8852bx_set_channel_mac()
474 switch (chan->band_width) { in __rtw8852bx_set_channel_mac()
491 if (chan->channel > 14) { in __rtw8852bx_set_channel_mac()
514 u8 ch_element = primary_ch - 1; in rtw8852bx_ctrl_sco_cck()
584 const struct rtw89_phy_bb_gain_info *gain = &rtwdev->bb_gain.ax; in rtw8852bx_set_gain_error() local
598 val = gain->lna_gain[gain_band][path][i]; in rtw8852bx_set_gain_error()
609 val = gain->tia_gain[gain_band][path][i]; in rtw8852bx_set_gain_error()
624 linear = rtw89_db_2_linear(abs(ext_loss_a - ext_loss_b)) + 1; in rtw8852bt_ext_loss_avg_update()
642 struct rtw89_hal *hal = &rtwdev->hal; in rtw8852bx_set_gain_offset()
643 struct rtw89_phy_efuse_gain *efuse_gain = &rtwdev->efuse_gain; in rtw8852bx_set_gain_offset()
651 if (!efuse_gain->comp_valid) in rtw8852bx_set_gain_offset()
655 tmp = efuse_gain->comp[path][subband]; in rtw8852bx_set_gain_offset()
661 if (!efuse_gain->offset_valid) in rtw8852bx_set_gain_offset()
666 offset_a = -efuse_gain->offset[RF_PATH_A][gain_ofdm_band]; in rtw8852bx_set_gain_offset()
667 offset_b = -efuse_gain->offset[RF_PATH_B][gain_ofdm_band]; in rtw8852bx_set_gain_offset()
669 tmp = -((offset_a << 2) + (efuse_gain->offset_base[RTW89_PHY_0] >> 2)); in rtw8852bx_set_gain_offset()
673 tmp = -((offset_b << 2) + (efuse_gain->offset_base[RTW89_PHY_0] >> 2)); in rtw8852bx_set_gain_offset()
677 if (hal->antenna_rx == RF_B) { in rtw8852bx_set_gain_offset()
678 offset_ofdm = -efuse_gain->offset[RF_PATH_B][gain_ofdm_band]; in rtw8852bx_set_gain_offset()
679 offset_cck = -efuse_gain->offset[RF_PATH_B][0]; in rtw8852bx_set_gain_offset()
681 offset_ofdm = -efuse_gain->offset[RF_PATH_A][gain_ofdm_band]; in rtw8852bx_set_gain_offset()
682 offset_cck = -efuse_gain->offset[RF_PATH_A][0]; in rtw8852bx_set_gain_offset()
685 tmp = (offset_ofdm << 4) + efuse_gain->offset_base[RTW89_PHY_0]; in rtw8852bx_set_gain_offset()
689 tmp = (offset_ofdm << 4) + efuse_gain->rssi_base[RTW89_PHY_0]; in rtw8852bx_set_gain_offset()
694 tmp = (offset_cck << 3) + (efuse_gain->offset_base[RTW89_PHY_0] >> 1); in rtw8852bx_set_gain_offset()
700 ext_loss_a = (offset_a << 2) + (efuse_gain->offset_base[RTW89_PHY_0] >> 2); in rtw8852bx_set_gain_offset()
701 ext_loss_b = (offset_b << 2) + (efuse_gain->offset_base[RTW89_PHY_0] >> 2); in rtw8852bx_set_gain_offset()
704 if (rtwdev->chip->chip_id == RTL8852BT) in rtw8852bx_set_gain_offset()
711 const struct rtw89_phy_bb_gain_info *gain = &rtwdev->bb_gain.ax; in rtw8852bx_set_rxsc_rpl_comp() local
715 val = u32_encode_bits((gain->rpl_ofst_20[band][RF_PATH_A] + in rtw8852bx_set_rxsc_rpl_comp()
716 gain->rpl_ofst_20[band][RF_PATH_B]) >> 1, B_P0_RPL1_20_MASK) | in rtw8852bx_set_rxsc_rpl_comp()
717 u32_encode_bits((gain->rpl_ofst_40[band][RF_PATH_A][0] + in rtw8852bx_set_rxsc_rpl_comp()
718 gain->rpl_ofst_40[band][RF_PATH_B][0]) >> 1, B_P0_RPL1_40_MASK) | in rtw8852bx_set_rxsc_rpl_comp()
719 u32_encode_bits((gain->rpl_ofst_40[band][RF_PATH_A][1] + in rtw8852bx_set_rxsc_rpl_comp()
720 gain->rpl_ofst_40[band][RF_PATH_B][1]) >> 1, B_P0_RPL1_41_MASK); in rtw8852bx_set_rxsc_rpl_comp()
725 val = u32_encode_bits((gain->rpl_ofst_40[band][RF_PATH_A][2] + in rtw8852bx_set_rxsc_rpl_comp()
726 gain->rpl_ofst_40[band][RF_PATH_B][2]) >> 1, B_P0_RTL2_42_MASK) | in rtw8852bx_set_rxsc_rpl_comp()
727 u32_encode_bits((gain->rpl_ofst_80[band][RF_PATH_A][0] + in rtw8852bx_set_rxsc_rpl_comp()
728 gain->rpl_ofst_80[band][RF_PATH_B][0]) >> 1, B_P0_RTL2_80_MASK) | in rtw8852bx_set_rxsc_rpl_comp()
729 u32_encode_bits((gain->rpl_ofst_80[band][RF_PATH_A][1] + in rtw8852bx_set_rxsc_rpl_comp()
730 gain->rpl_ofst_80[band][RF_PATH_B][1]) >> 1, B_P0_RTL2_81_MASK) | in rtw8852bx_set_rxsc_rpl_comp()
731 u32_encode_bits((gain->rpl_ofst_80[band][RF_PATH_A][10] + in rtw8852bx_set_rxsc_rpl_comp()
732 gain->rpl_ofst_80[band][RF_PATH_B][10]) >> 1, B_P0_RTL2_8A_MASK); in rtw8852bx_set_rxsc_rpl_comp()
736 val = u32_encode_bits((gain->rpl_ofst_80[band][RF_PATH_A][2] + in rtw8852bx_set_rxsc_rpl_comp()
737 gain->rpl_ofst_80[band][RF_PATH_B][2]) >> 1, B_P0_RTL3_82_MASK) | in rtw8852bx_set_rxsc_rpl_comp()
738 u32_encode_bits((gain->rpl_ofst_80[band][RF_PATH_A][3] + in rtw8852bx_set_rxsc_rpl_comp()
739 gain->rpl_ofst_80[band][RF_PATH_B][3]) >> 1, B_P0_RTL3_83_MASK) | in rtw8852bx_set_rxsc_rpl_comp()
740 u32_encode_bits((gain->rpl_ofst_80[band][RF_PATH_A][4] + in rtw8852bx_set_rxsc_rpl_comp()
741 gain->rpl_ofst_80[band][RF_PATH_B][4]) >> 1, B_P0_RTL3_84_MASK) | in rtw8852bx_set_rxsc_rpl_comp()
742 u32_encode_bits((gain->rpl_ofst_80[band][RF_PATH_A][9] + in rtw8852bx_set_rxsc_rpl_comp()
743 gain->rpl_ofst_80[band][RF_PATH_B][9]) >> 1, B_P0_RTL3_89_MASK); in rtw8852bx_set_rxsc_rpl_comp()
752 u8 central_ch = chan->channel; in rtw8852bx_ctrl_ch()
753 u8 subband = chan->subband_type; in rtw8852bx_ctrl_ch()
777 if (chan->band_type == RTW89_BAND_6G) in rtw8852bx_ctrl_ch()
853 if (rtwdev->chip->chip_id != RTL8852BT) in rtw8852bt_adc_cfg()
874 if (rtwdev->efuse.rfe_type >= 51) in rtw8852bt_adc_cfg()
906 enum rtw89_core_chip_id chip_id = rtwdev->chip->chip_id; in rtw8852bx_ctrl_bw()
1030 u8 pri_ch = chan->pri_ch_idx; in rtw8852bx_5m_mask()
1034 switch (chan->band_width) { in rtw8852bx_5m_mask()
1106 struct rtw89_phy_efuse_gain *gain = &rtwdev->efuse_gain; in __rtw8852bx_bb_sethw() local
1114 gain->offset_base[RTW89_PHY_0] = in __rtw8852bx_bb_sethw()
1116 gain->rssi_base[RTW89_PHY_0] = in __rtw8852bx_bb_sethw()
1122 if (rtwdev->hw->conf.flags & IEEE80211_CONF_MONITOR) in rtw8852bx_bb_set_pop()
1129 u8 center_chan = chan->channel; in rtw8852bt_spur_freq()
1131 switch (chan->band_type) { in rtw8852bt_spur_freq()
1162 freq_diff = (spur_freq - chan->freq) * 1000000; in rtw8852bt_set_csi_tone_idx()
1175 enum rtw89_core_chip_id chip_id = rtwdev->chip->chip_id; in __rtw8852bx_set_channel_bb()
1176 bool cck_en = chan->channel <= 14; in __rtw8852bx_set_channel_bb()
1177 u8 pri_ch_idx = chan->pri_ch_idx; in __rtw8852bx_set_channel_bb()
1178 u8 band = chan->band_type, chan_idx; in __rtw8852bx_set_channel_bb()
1181 rtw8852bx_ctrl_sco_cck(rtwdev, chan->primary_channel); in __rtw8852bx_set_channel_bb()
1184 rtw8852bx_ctrl_bw(rtwdev, pri_ch_idx, chan->band_width, phy_idx); in __rtw8852bx_set_channel_bb()
1188 if (chip_id == RTL8852B && chan->band_type == RTW89_BAND_5G) { in __rtw8852bx_set_channel_bb()
1203 chan_idx = rtw89_encode_chan_idx(rtwdev, chan->primary_channel, band); in __rtw8852bx_set_channel_bb()
1228 tssi_ofst_cw = (u32)((s16)tssi_16dbm_cw + (ref << 1) - (16 << 3)); in rtw8852bx_bb_cal_txpwr_ref()
1291 u8 ch = chan->channel; in rtw8852bx_bb_set_tx_shape_dfir()
1325 const struct rtw89_rfe_parms *rfe_parms = rtwdev->rfe_parms; in rtw8852bx_set_tx_shape()
1326 u8 band = chan->band_type; in rtw8852bx_set_tx_shape()
1328 u8 tx_shape_cck = (*rfe_parms->tx_shape.lmt)[band][RTW89_RS_CCK][regd]; in rtw8852bx_set_tx_shape()
1329 u8 tx_shape_ofdm = (*rfe_parms->tx_shape.lmt)[band][RTW89_RS_OFDM][regd]; in rtw8852bx_set_tx_shape()
1361 if (pw_ofst < -16 || pw_ofst > 15) { in __rtw8852bx_set_txpwr_ul_tb_offset()
1372 pw_ofst = max_t(s8, pw_ofst - 3, -16); in __rtw8852bx_set_txpwr_ul_tb_offset()
1407 rtw89_phy_write32_mask(rtwdev, def->addr, def->mask, def->data); in __rtw8852bx_bb_set_plcp_tx()
1415 if (tx_info->mode == CONT_TX) in rtw8852bx_stop_pmac_tx()
1417 else if (tx_info->mode == PKTS_TX) in rtw8852bx_stop_pmac_tx()
1425 enum rtw8852bx_pmac_mode mode = tx_info->mode; in rtw8852bx_start_pmac_tx()
1426 u32 pkt_cnt = tx_info->tx_cnt; in rtw8852bx_start_pmac_tx()
1427 u16 period = tx_info->period; in rtw8852bx_start_pmac_tx()
1429 if (mode == CONT_TX && !tx_info->is_cck) { in rtw8852bx_start_pmac_tx()
1450 if (!tx_info->en_pmac_tx) { in rtw8852bx_bb_set_pmac_tx()
1453 if (chan->band_type == RTW89_BAND_2G) in rtw8852bx_bb_set_pmac_tx()
1543 bak->tx_path = rtw89_phy_read32_idx(rtwdev, R_TXPATH_SEL, B_TXPATH_SEL_MSK, idx); in __rtw8852bx_bb_backup_tssi()
1544 bak->rx_path = rtw89_phy_read32_idx(rtwdev, R_CHBW_MOD_V1, B_ANT_RX_SEG0, idx); in __rtw8852bx_bb_backup_tssi()
1545 bak->p0_rfmode = rtw89_phy_read32_idx(rtwdev, R_P0_RFMODE, MASKDWORD, idx); in __rtw8852bx_bb_backup_tssi()
1546 bak->p0_rfmode_ftm = rtw89_phy_read32_idx(rtwdev, R_P0_RFMODE_FTM_RX, MASKDWORD, idx); in __rtw8852bx_bb_backup_tssi()
1547 bak->p1_rfmode = rtw89_phy_read32_idx(rtwdev, R_P1_RFMODE, MASKDWORD, idx); in __rtw8852bx_bb_backup_tssi()
1548 bak->p1_rfmode_ftm = rtw89_phy_read32_idx(rtwdev, R_P1_RFMODE_FTM_RX, MASKDWORD, idx); in __rtw8852bx_bb_backup_tssi()
1550 bak->tx_pwr = sign_extend32(tmp, 8); in __rtw8852bx_bb_backup_tssi()
1557 rtw89_phy_write32_idx(rtwdev, R_TXPATH_SEL, B_TXPATH_SEL_MSK, bak->tx_path, idx); in __rtw8852bx_bb_restore_tssi()
1558 if (bak->tx_path == RF_AB) in __rtw8852bx_bb_restore_tssi()
1562 rtw89_phy_write32_idx(rtwdev, R_CHBW_MOD_V1, B_ANT_RX_SEG0, bak->rx_path, idx); in __rtw8852bx_bb_restore_tssi()
1564 rtw89_phy_write32_idx(rtwdev, R_P0_RFMODE, MASKDWORD, bak->p0_rfmode, idx); in __rtw8852bx_bb_restore_tssi()
1565 rtw89_phy_write32_idx(rtwdev, R_P0_RFMODE_FTM_RX, MASKDWORD, bak->p0_rfmode_ftm, idx); in __rtw8852bx_bb_restore_tssi()
1566 rtw89_phy_write32_idx(rtwdev, R_P1_RFMODE, MASKDWORD, bak->p1_rfmode, idx); in __rtw8852bx_bb_restore_tssi()
1567 rtw89_phy_write32_idx(rtwdev, R_P1_RFMODE_FTM_RX, MASKDWORD, bak->p1_rfmode_ftm, idx); in __rtw8852bx_bb_restore_tssi()
1568 rtw89_phy_write32_idx(rtwdev, R_TXPWR, B_TXPWR_MSK, bak->tx_pwr, idx); in __rtw8852bx_bb_restore_tssi()
1659 rtw8852bx_set_gain_offset(rtwdev, chan->subband_type, RTW89_PHY_0); in __rtw8852bx_bb_ctrl_rx_path()
1661 if (chan->band_type == RTW89_BAND_2G && in __rtw8852bx_bb_ctrl_rx_path()
1713 struct rtw89_hal *hal = &rtwdev->hal; in __rtw8852bx_bb_cfg_txrx_path()
1715 enum rtw89_rf_path_bit rx_path = hal->antenna_rx ? hal->antenna_rx : RF_AB; in __rtw8852bx_bb_cfg_txrx_path()
1720 if (rtwdev->hal.rx_nss == 1) { in __rtw8852bx_bb_cfg_txrx_path()
1737 if (rtwdev->is_tssi_mode[rf_path]) { in __rtw8852bx_get_thermal()
1763 struct rtw89_btc *btc = &rtwdev->btc; in __rtw8852bx_btc_init_cfg()
1764 const struct rtw89_chip_info *chip = rtwdev->chip; in __rtw8852bx_btc_init_cfg()
1773 /* set WL Tx response = Hi-Pri */ in __rtw8852bx_btc_init_cfg()
1774 chip->ops->btc_set_wl_pri(rtwdev, BTC_PRI_MASK_TX_RESP, true); in __rtw8852bx_btc_init_cfg()
1775 chip->ops->btc_set_wl_pri(rtwdev, BTC_PRI_MASK_BEACON, true); in __rtw8852bx_btc_init_cfg()
1782 if (btc->ant_type == BTC_ANT_SHARED) { in __rtw8852bx_btc_init_cfg()
1785 /* set path-A(S0) Tx/Rx no-mask if GNT_WL=0 && BT_S1=tx group */ in __rtw8852bx_btc_init_cfg()
1788 } else { /* set WL Tx stb if GNT_WL = 0 && BT_S1 = ss group for 3-ant */ in __rtw8852bx_btc_init_cfg()
1795 if (rtwdev->chip->chip_id == RTL8852BT) { in __rtw8852bx_btc_init_cfg()
1805 btc->cx.wl.status.map.init_ok = true; in __rtw8852bx_btc_init_cfg()
1840 /* +6 for compensate offset */ in __rtw8852bx_btc_get_bt_rssi()
1841 return clamp_t(s8, val + 6, -100, 0) + 100; in __rtw8852bx_btc_get_bt_rssi()
1856 /* set WL standby = Rx for GNT_BT_Tx = 1->0 settle issue */ in __rtw8852bx_btc_wl_s1_standby()
1897 struct rtw89_btc *btc = &rtwdev->btc; in __rtw8852bx_btc_set_wl_rx_gain()
1903 btc->dm.wl_lna2 = 0; in __rtw8852bx_btc_set_wl_rx_gain()
1905 case 1: /* for FDD free-run */ in __rtw8852bx_btc_set_wl_rx_gain()
1907 btc->dm.wl_lna2 = 0; in __rtw8852bx_btc_set_wl_rx_gain()
1909 case 2: /* for BTG Co-Rx*/ in __rtw8852bx_btc_set_wl_rx_gain()
1911 btc->dm.wl_lna2 = 1; in __rtw8852bx_btc_set_wl_rx_gain()
1915 rtw8852bx_btc_set_wl_lna2(rtwdev, btc->dm.wl_lna2); in __rtw8852bx_btc_set_wl_rx_gain()
1922 u16 chan = phy_ppdu->chan_idx; in rtw8852bx_fill_freq_with_ppdu()
1930 status->freq = ieee80211_channel_to_frequency(ch, band); in rtw8852bx_fill_freq_with_ppdu()
1931 status->band = band; in rtw8852bx_fill_freq_with_ppdu()
1939 u8 *rx_power = phy_ppdu->rssi; in __rtw8852bx_query_ppdu()
1941 status->signal = RTW89_RSSI_RAW_TO_DBM(max(rx_power[RF_PATH_A], rx_power[RF_PATH_B])); in __rtw8852bx_query_ppdu()
1942 for (path = 0; path < rtwdev->chip->rf_path_num; path++) { in __rtw8852bx_query_ppdu()
1943 status->chains |= BIT(path); in __rtw8852bx_query_ppdu()
1944 status->chain_signal[path] = RTW89_RSSI_RAW_TO_DBM(rx_power[path]); in __rtw8852bx_query_ppdu()
1946 if (phy_ppdu->valid) in __rtw8852bx_query_ppdu()
1953 u8 delta = phy_ppdu->rpl_avg - phy_ppdu->rssi_avg; in __rtw8852bx_convert_rpl_to_rssi()
1954 u8 *rssi = phy_ppdu->rssi; in __rtw8852bx_convert_rpl_to_rssi()
1960 phy_ppdu->rssi_avg = phy_ppdu->rpl_avg; in __rtw8852bx_convert_rpl_to_rssi()
1965 enum rtw89_core_chip_id chip_id = rtwdev->chip->chip_id; in __rtw8852bx_mac_enable_bb_rf()