Lines Matching +full:tx +full:- +full:drive +full:- +full:strength +full:- +full:milliwatt
1 // SPDX-License-Identifier: GPL-2.0-or-later
41 * - With both FULL amplitude and FULL bias current: bias current
43 * - With only DSP amplitude: bias current is set to half and
45 * - With DSP bias current (included both DSP amplitude and
139 switch (phydev->port) { in qca807x_led_parse_netdev()
171 return -EOPNOTSUPP; in qca807x_led_parse_netdev()
175 return -EOPNOTSUPP; in qca807x_led_parse_netdev()
185 return -EINVAL; in qca807x_led_hw_control_enable()
197 return -EINVAL; in qca807x_led_hw_is_supported()
209 return -EINVAL; in qca807x_led_hw_control_set()
219 switch (phydev->port) { in qca807x_led_hw_control_set()
230 return -EINVAL; in qca807x_led_hw_control_set()
255 return -EINVAL; in qca807x_led_hw_control_get()
259 return -EINVAL; in qca807x_led_hw_control_get()
262 switch (phydev->port) { in qca807x_led_hw_control_get()
299 return -EINVAL; in qca807x_led_hw_control_get()
310 return -EINVAL; in qca807x_led_hw_control_reset()
312 switch (phydev->port) { in qca807x_led_hw_control_reset()
323 return -EINVAL; in qca807x_led_hw_control_reset()
336 return -EINVAL; in qca807x_led_brightness_set()
356 return -EINVAL; in qca807x_led_blink_set()
375 val = phy_read_mmd(priv->phy, MDIO_MMD_AN, reg); in qca807x_gpio_get()
388 val = phy_read_mmd(priv->phy, MDIO_MMD_AN, reg); in qca807x_gpio_set()
393 phy_write_mmd(priv->phy, MDIO_MMD_AN, reg, val); in qca807x_gpio_set()
405 struct device *dev = &phydev->mdio.dev; in qca807x_gpio()
411 return -ENOMEM; in qca807x_gpio()
413 priv->phy = phydev; in qca807x_gpio()
417 return -ENOMEM; in qca807x_gpio()
419 gc->label = dev_name(dev); in qca807x_gpio()
420 gc->base = -1; in qca807x_gpio()
421 gc->ngpio = 2; in qca807x_gpio()
422 gc->parent = dev; in qca807x_gpio()
423 gc->owner = THIS_MODULE; in qca807x_gpio()
424 gc->can_sleep = true; in qca807x_gpio()
425 gc->get_direction = qca807x_gpio_get_direction; in qca807x_gpio()
426 gc->direction_output = qca807x_gpio_dir_out; in qca807x_gpio()
427 gc->get = qca807x_gpio_get; in qca807x_gpio()
428 gc->set = qca807x_gpio_set; in qca807x_gpio()
443 /* Read the QCA807x PHY-Specific Status register fiber page, in qca807x_read_fiber_status()
451 phydev->speed = SPEED_UNKNOWN; in qca807x_read_fiber_status()
452 phydev->duplex = DUPLEX_UNKNOWN; in qca807x_read_fiber_status()
456 phydev->speed = SPEED_100; in qca807x_read_fiber_status()
459 phydev->speed = SPEED_1000; in qca807x_read_fiber_status()
464 phydev->duplex = DUPLEX_FULL; in qca807x_read_fiber_status()
466 phydev->duplex = DUPLEX_HALF; in qca807x_read_fiber_status()
474 if (linkmode_test_bit(ETHTOOL_LINK_MODE_FIBRE_BIT, phydev->supported)) { in qca807x_read_status()
475 switch (phydev->port) { in qca807x_read_status()
481 return -EINVAL; in qca807x_read_status()
496 if (of_property_read_u32(np, "qcom,tx-drive-strength-milliwatt", in qca807x_phy_package_probe_once()
502 priv->tx_drive_strength = PQSGMII_TX_DRIVER_140MV; in qca807x_phy_package_probe_once()
505 priv->tx_drive_strength = PQSGMII_TX_DRIVER_160MV; in qca807x_phy_package_probe_once()
508 priv->tx_drive_strength = PQSGMII_TX_DRIVER_180MV; in qca807x_phy_package_probe_once()
511 priv->tx_drive_strength = PQSGMII_TX_DRIVER_200MV; in qca807x_phy_package_probe_once()
514 priv->tx_drive_strength = PQSGMII_TX_DRIVER_220MV; in qca807x_phy_package_probe_once()
517 priv->tx_drive_strength = PQSGMII_TX_DRIVER_240MV; in qca807x_phy_package_probe_once()
520 priv->tx_drive_strength = PQSGMII_TX_DRIVER_260MV; in qca807x_phy_package_probe_once()
523 priv->tx_drive_strength = PQSGMII_TX_DRIVER_280MV; in qca807x_phy_package_probe_once()
526 priv->tx_drive_strength = PQSGMII_TX_DRIVER_300MV; in qca807x_phy_package_probe_once()
529 priv->tx_drive_strength = PQSGMII_TX_DRIVER_320MV; in qca807x_phy_package_probe_once()
532 priv->tx_drive_strength = PQSGMII_TX_DRIVER_400MV; in qca807x_phy_package_probe_once()
535 priv->tx_drive_strength = PQSGMII_TX_DRIVER_500MV; in qca807x_phy_package_probe_once()
538 priv->tx_drive_strength = PQSGMII_TX_DRIVER_600MV; in qca807x_phy_package_probe_once()
541 return -EINVAL; in qca807x_phy_package_probe_once()
544 priv->package_mode = PHY_INTERFACE_MODE_NA; in qca807x_phy_package_probe_once()
545 if (!of_property_read_string(np, "qcom,package-mode", in qca807x_phy_package_probe_once()
549 priv->package_mode = PHY_INTERFACE_MODE_PSGMII; in qca807x_phy_package_probe_once()
552 priv->package_mode = PHY_INTERFACE_MODE_QSGMII; in qca807x_phy_package_probe_once()
554 return -EINVAL; in qca807x_phy_package_probe_once()
566 if (priv->package_mode != PHY_INTERFACE_MODE_NA && in qca807x_phy_package_config_init_once()
567 phydev->interface != priv->package_mode) in qca807x_phy_package_config_init_once()
568 return -EINVAL; in qca807x_phy_package_config_init_once()
580 switch (priv->package_mode) { in qca807x_phy_package_config_init_once()
621 /* Set PQSGMII TX AMP strength */ in qca807x_phy_package_config_init_once()
625 val |= FIELD_PREP(PQSGMII_TX_DRIVER_MASK, priv->tx_drive_strength); in qca807x_phy_package_config_init_once()
652 sfp_parse_support(phydev->sfp_bus, id, support, interfaces); in qca807x_sfp_insert()
653 iface = sfp_select_interface(phydev->sfp_bus, support); in qca807x_sfp_insert()
655 dev_info(&phydev->mdio.dev, "%s SFP module inserted\n", phy_modes(iface)); in qca807x_sfp_insert()
665 /* Enable fiber mode autodection (1000Base-X or 100Base-FX) */ in qca807x_sfp_insert()
675 phydev->port = PORT_FIBRE; in qca807x_sfp_insert()
678 dev_err(&phydev->mdio.dev, "Incompatible SFP module inserted\n"); in qca807x_sfp_insert()
679 return -EINVAL; in qca807x_sfp_insert()
694 phydev->port = PORT_TP; in qca807x_sfp_remove()
708 struct device_node *node = phydev->mdio.dev.of_node; in qca807x_probe()
710 struct device *dev = &phydev->mdio.dev; in qca807x_probe()
728 return -ENOMEM; in qca807x_probe()
730 priv->dac_full_amplitude = of_property_read_bool(node, "qcom,dac-full-amplitude"); in qca807x_probe()
731 priv->dac_full_bias_current = of_property_read_bool(node, "qcom,dac-full-bias-current"); in qca807x_probe()
732 priv->dac_disable_bias_current_tweak = of_property_read_bool(node, in qca807x_probe()
733 "qcom,dac-disable-bias-current-tweak"); in qca807x_probe()
737 if (of_property_read_bool(node, "gpio-controller")) { in qca807x_probe()
749 linkmode_set_bit(ETHTOOL_LINK_MODE_FIBRE_BIT, phydev->supported); in qca807x_probe()
750 linkmode_set_bit(ETHTOOL_LINK_MODE_FIBRE_BIT, phydev->advertising); in qca807x_probe()
753 phydev->priv = priv; in qca807x_probe()
760 struct qca807x_priv *priv = phydev->priv; in qca807x_config_init()
773 if (!priv->dac_full_amplitude) in qca807x_config_init()
775 if (!priv->dac_full_bias_current) in qca807x_config_init()
777 if (!priv->dac_disable_bias_current_tweak) in qca807x_config_init()