Lines Matching +full:tx +full:- +full:d +full:- +full:cal

1 // SPDX-License-Identifier: GPL-2.0+
6 #include <linux/nvmem-consumer.h>
307 phydev_dbg(phydev, "cal_val: 0x%x, ret: %d\n", cal_val, ret); in cal_cycle()
374 switch (phydev->drv->phy_id) { in tx_amp_fill_result()
485 if (phydev->drv->phy_id == MTK_GPHY_ID_MT7988) in tx_r50_fill_result()
486 bias = -1; in tx_r50_fill_result()
504 return -EINVAL; in tx_r50_fill_result()
531 return -EINVAL; in tx_r50_cal_efuse()
597 ret = -EINVAL; in tx_vcm_cal_sw()
604 phydev_dbg(phydev, "Start TX-VCM SW cal.\n"); in tx_vcm_cal_sw()
605 while ((upper_idx - lower_idx) > 1) { in tx_vcm_cal_sw()
649 /* We calibrate TX-VCM in different logic. Check upper index and then in tx_vcm_cal_sw()
653 ret = upper_ret - lower_ret; in tx_vcm_cal_sw()
664 phydev_dbg(phydev, "TX-VCM SW cal result: 0x%x\n", upper_idx); in tx_vcm_cal_sw()
675 phydev_warn(phydev, "TX-VCM SW cal result at low margin 0x%x\n", in tx_vcm_cal_sw()
681 "TX-VCM SW cal result at high margin 0x%x\n", in tx_vcm_cal_sw()
684 ret = -EINVAL; in tx_vcm_cal_sw()
750 * Keep middle level of TX MLT3 shapper as default. in mt7981_phy_finetune()
751 * Only change TX MLT3 overshoot level here. in mt7981_phy_finetune()
996 return -EINVAL; in cal_sw()
1026 return -EINVAL; in cal_efuse()
1050 return -EINVAL; in start_cal()
1054 phydev_err(phydev, "cal %d failed\n", cal_item); in start_cal()
1055 return -EIO; in start_cal()
1068 cell = nvmem_cell_get(&phydev->mdio.dev, "phy-cal-data"); in mt798x_phy_calibration()
1070 if (PTR_ERR(cell) == -EPROBE_DEFER) in mt798x_phy_calibration()
1082 ret = -EINVAL; in mt798x_phy_calibration()
1109 switch (phydev->drv->phy_id) { in mt798x_phy_config_init()
1193 struct mtk_socphy_shared *priv = phydev->shared->priv; in mt7988_phy_led_get_polarity()
1197 polarities = ~(priv->boottrap); in mt7988_phy_led_get_polarity()
1201 if (polarities & BIT(phydev->mdio.addr)) in mt7988_phy_led_get_polarity()
1221 pinctrl = devm_pinctrl_get_select(&phydev->mdio.dev, "gbe-led"); in mt7988_phy_fix_leds_polarities()
1223 dev_err(&phydev->mdio.bus->dev, in mt7988_phy_fix_leds_polarities()
1231 struct device_node *np = dev_of_node(&phydev->mdio.bus->dev); in mt7988_phy_probe_shared()
1232 struct mtk_socphy_shared *shared = phydev->shared->priv; in mt7988_phy_probe_shared()
1243 * The detected value at boot time is accessible at run-time using the in mt7988_phy_probe_shared()
1258 shared->boottrap = FIELD_GET(RG_GPIO_MISC_TPBANK0_BOOTMODE, reg); in mt7988_phy_probe_shared()
1269 if (phydev->mdio.addr > 3) in mt7988_phy_probe()
1270 return -EINVAL; in mt7988_phy_probe()
1272 err = devm_phy_package_join(&phydev->mdio.dev, phydev, 0, in mt7988_phy_probe()
1283 shared = phydev->shared->priv; in mt7988_phy_probe()
1284 priv = &shared->priv[phydev->mdio.addr]; in mt7988_phy_probe()
1286 phydev->priv = priv; in mt7988_phy_probe()
1294 /* Disable TX power saving at probing to: in mt7988_phy_probe()
1296 * 2. Make sure that TX-VCM calibration works fine in mt7988_phy_probe()
1308 priv = devm_kzalloc(&phydev->mdio.dev, sizeof(struct mtk_socphy_priv), in mt7981_phy_probe()
1311 return -ENOMEM; in mt7981_phy_probe()
1313 phydev->priv = priv; in mt7981_phy_probe()