Lines Matching +full:efuse +full:- +full:settings

1 // SPDX-License-Identifier: GPL-2.0-only
3 * RTL8XXXU mac80211 USB driver - 8723b specific subdriver
5 * Copyright (c) 2014 - 2017 Jes Sorensen <Jes.Sorensen@gmail.com>
8 * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
238 * they never actually check the package type - and just default
293 struct device *dev = &priv->udev->dev; in rtl8723bu_identify_chip()
298 priv->chip_cut = u32_get_bits(sys_cfg, SYS_CFG_CHIP_VERSION_MASK); in rtl8723bu_identify_chip()
301 ret = -ENOTSUPP; in rtl8723bu_identify_chip()
305 strscpy(priv->chip_name, "8723BU", sizeof(priv->chip_name)); in rtl8723bu_identify_chip()
306 priv->rtl_chip = RTL8723B; in rtl8723bu_identify_chip()
307 priv->rf_paths = 1; in rtl8723bu_identify_chip()
308 priv->rx_paths = 1; in rtl8723bu_identify_chip()
309 priv->tx_paths = 1; in rtl8723bu_identify_chip()
313 priv->has_wifi = 1; in rtl8723bu_identify_chip()
315 priv->has_bluetooth = 1; in rtl8723bu_identify_chip()
317 priv->has_gps = 1; in rtl8723bu_identify_chip()
318 priv->is_multi_func = 1; in rtl8723bu_identify_chip()
324 priv->rom_rev = u32_get_bits(val32, GPIO_RF_RL_ID); in rtl8723bu_identify_chip()
331 if (!priv->ep_tx_count) in rtl8723bu_identify_chip()
398 cck = priv->cck_tx_power_index_B[group]; in rtl8723b_set_tx_power()
409 ofdmbase = priv->ht40_1s_tx_power_index_B[group]; in rtl8723b_set_tx_power()
410 ofdmbase += priv->ofdm_tx_power_diff[tx_idx].b; in rtl8723b_set_tx_power()
416 mcsbase = priv->ht40_1s_tx_power_index_B[group]; in rtl8723b_set_tx_power()
418 mcsbase += priv->ht40_tx_power_diff[tx_idx++].b; in rtl8723b_set_tx_power()
420 mcsbase += priv->ht20_tx_power_diff[tx_idx++].b; in rtl8723b_set_tx_power()
429 struct rtl8723bu_efuse *efuse = &priv->efuse_wifi.efuse8723bu; in rtl8723bu_parse_efuse() local
432 if (efuse->rtl_id != cpu_to_le16(0x8129)) in rtl8723bu_parse_efuse()
433 return -EINVAL; in rtl8723bu_parse_efuse()
435 ether_addr_copy(priv->mac_addr, efuse->mac_addr); in rtl8723bu_parse_efuse()
437 memcpy(priv->cck_tx_power_index_A, efuse->tx_power_index_A.cck_base, in rtl8723bu_parse_efuse()
438 sizeof(efuse->tx_power_index_A.cck_base)); in rtl8723bu_parse_efuse()
439 memcpy(priv->cck_tx_power_index_B, efuse->tx_power_index_B.cck_base, in rtl8723bu_parse_efuse()
440 sizeof(efuse->tx_power_index_B.cck_base)); in rtl8723bu_parse_efuse()
442 memcpy(priv->ht40_1s_tx_power_index_A, in rtl8723bu_parse_efuse()
443 efuse->tx_power_index_A.ht40_base, in rtl8723bu_parse_efuse()
444 sizeof(efuse->tx_power_index_A.ht40_base)); in rtl8723bu_parse_efuse()
445 memcpy(priv->ht40_1s_tx_power_index_B, in rtl8723bu_parse_efuse()
446 efuse->tx_power_index_B.ht40_base, in rtl8723bu_parse_efuse()
447 sizeof(efuse->tx_power_index_B.ht40_base)); in rtl8723bu_parse_efuse()
449 priv->ofdm_tx_power_diff[0].a = in rtl8723bu_parse_efuse()
450 efuse->tx_power_index_A.ht20_ofdm_1s_diff.a; in rtl8723bu_parse_efuse()
451 priv->ofdm_tx_power_diff[0].b = in rtl8723bu_parse_efuse()
452 efuse->tx_power_index_B.ht20_ofdm_1s_diff.a; in rtl8723bu_parse_efuse()
454 priv->ht20_tx_power_diff[0].a = in rtl8723bu_parse_efuse()
455 efuse->tx_power_index_A.ht20_ofdm_1s_diff.b; in rtl8723bu_parse_efuse()
456 priv->ht20_tx_power_diff[0].b = in rtl8723bu_parse_efuse()
457 efuse->tx_power_index_B.ht20_ofdm_1s_diff.b; in rtl8723bu_parse_efuse()
459 priv->ht40_tx_power_diff[0].a = 0; in rtl8723bu_parse_efuse()
460 priv->ht40_tx_power_diff[0].b = 0; in rtl8723bu_parse_efuse()
463 priv->ofdm_tx_power_diff[i].a = in rtl8723bu_parse_efuse()
464 efuse->tx_power_index_A.pwr_diff[i - 1].ofdm; in rtl8723bu_parse_efuse()
465 priv->ofdm_tx_power_diff[i].b = in rtl8723bu_parse_efuse()
466 efuse->tx_power_index_B.pwr_diff[i - 1].ofdm; in rtl8723bu_parse_efuse()
468 priv->ht20_tx_power_diff[i].a = in rtl8723bu_parse_efuse()
469 efuse->tx_power_index_A.pwr_diff[i - 1].ht20; in rtl8723bu_parse_efuse()
470 priv->ht20_tx_power_diff[i].b = in rtl8723bu_parse_efuse()
471 efuse->tx_power_index_B.pwr_diff[i - 1].ht20; in rtl8723bu_parse_efuse()
473 priv->ht40_tx_power_diff[i].a = in rtl8723bu_parse_efuse()
474 efuse->tx_power_index_A.pwr_diff[i - 1].ht40; in rtl8723bu_parse_efuse()
475 priv->ht40_tx_power_diff[i].b = in rtl8723bu_parse_efuse()
476 efuse->tx_power_index_B.pwr_diff[i - 1].ht40; in rtl8723bu_parse_efuse()
479 priv->default_crystal_cap = priv->efuse_wifi.efuse8723bu.xtal_k & 0x3f; in rtl8723bu_parse_efuse()
489 if (priv->enable_bluetooth) in rtl8723bu_load_firmware()
605 /* path-A IQK setting */ in rtl8723bu_iqk_path_a()
631 if (priv->rf_paths > 1) in rtl8723bu_iqk_path_a()
669 val32 = 0x400 - val32; in rtl8723bu_iqk_path_a()
715 /* path-A IQK setting */ in rtl8723bu_rx_iqk_path_a()
741 if (priv->rf_paths > 1) in rtl8723bu_rx_iqk_path_a()
779 val32 = 0x400 - val32; in rtl8723bu_rx_iqk_path_a()
819 /* path-A IQK setting */ in rtl8723bu_rx_iqk_path_a()
841 if (priv->rf_paths > 1) in rtl8723bu_rx_iqk_path_a()
879 val32 = 0x400 - val32; in rtl8723bu_rx_iqk_path_a()
897 struct device *dev = &priv->udev->dev; in rtl8723bu_phy_iqcalibrate()
931 rtl8xxxu_save_regs(priv, adda_regs, priv->adda_backup, in rtl8723bu_phy_iqcalibrate()
933 rtl8xxxu_save_mac_regs(priv, iqk_mac_regs, priv->mac_backup); in rtl8723bu_phy_iqcalibrate()
935 priv->bb_backup, RTL8XXXU_BB_REGS); in rtl8723bu_phy_iqcalibrate()
940 /* MAC settings */ in rtl8723bu_phy_iqcalibrate()
941 rtl8xxxu_mac_calibration(priv, iqk_mac_regs, priv->mac_backup); in rtl8723bu_phy_iqcalibrate()
1011 if (priv->tx_paths > 1) { in rtl8723bu_phy_iqcalibrate()
1071 rtl8xxxu_restore_regs(priv, adda_regs, priv->adda_backup, in rtl8723bu_phy_iqcalibrate()
1075 rtl8xxxu_restore_mac_regs(priv, iqk_mac_regs, priv->mac_backup); in rtl8723bu_phy_iqcalibrate()
1079 priv->bb_backup, RTL8XXXU_BB_REGS); in rtl8723bu_phy_iqcalibrate()
1087 if (priv->tx_paths > 1) { in rtl8723bu_phy_iqcalibrate()
1104 struct device *dev = &priv->udev->dev; in rtl8723bu_phy_iq_calibrate()
1117 candidate = -1; in rtl8723bu_phy_iq_calibrate()
1155 candidate = -1; in rtl8723bu_phy_iq_calibrate()
1173 priv->rege94 = reg_e94; in rtl8723bu_phy_iq_calibrate()
1175 priv->rege9c = reg_e9c; in rtl8723bu_phy_iq_calibrate()
1179 priv->regeb4 = reg_eb4; in rtl8723bu_phy_iq_calibrate()
1181 priv->regebc = reg_ebc; in rtl8723bu_phy_iq_calibrate()
1192 reg_e94 = reg_eb4 = priv->rege94 = priv->regeb4 = 0x100; in rtl8723bu_phy_iq_calibrate()
1193 reg_e9c = reg_ebc = priv->rege9c = priv->regebc = 0x0; in rtl8723bu_phy_iq_calibrate()
1200 if (priv->tx_paths > 1 && reg_eb4) in rtl8723bu_phy_iq_calibrate()
1205 priv->bb_recovery_backup, RTL8XXXU_BB_REGS); in rtl8723bu_phy_iq_calibrate()
1220 if (priv->rf_paths > 1) in rtl8723bu_phy_iq_calibrate()
1251 for (count = RTL8XXXU_MAX_REG_POLL; count; count--) { in rtl8723bu_active_to_emu()
1259 dev_warn(&priv->udev->dev, "%s: Disabling MAC timed out\n", in rtl8723bu_active_to_emu()
1261 ret = -EBUSY; in rtl8723bu_active_to_emu()
1313 for (count = RTL8XXXU_MAX_REG_POLL; count; count--) { in rtl8723b_emu_to_active()
1322 ret = -EBUSY; in rtl8723b_emu_to_active()
1348 for (count = RTL8XXXU_MAX_REG_POLL; count; count--) { in rtl8723b_emu_to_active()
1358 ret = -EBUSY; in rtl8723b_emu_to_active()
1431 * BT coexist power on settings. This is identical for 1 and 2 in rtl8723bu_power_on()
1515 * vendor code preserves bits 6-7 here. in rtl8723b_enable_rf()
1574 * Fix external switch Main->S1, Aux->S0 in rtl8723b_enable_rf()
1587 * Different settings per different antenna position. in rtl8723b_enable_rf()
1589 * -------------------------------------------------- in rtl8723b_enable_rf()
1661 u8 cck_agc_rpt = phy_stats->cck_agc_rpt_ofdm_cfosho_a; in rtl8723b_cck_rssi()
1670 rx_pwr_all = -34 - (2 * vga_idx); in rtl8723b_cck_rssi()
1673 rx_pwr_all = -14 - (2 * vga_idx); in rtl8723b_cck_rssi()
1676 rx_pwr_all = 6 - (2 * vga_idx); in rtl8723b_cck_rssi()
1679 rx_pwr_all = 16 - (2 * vga_idx); in rtl8723b_cck_rssi()