Lines Matching +full:fiber +full:- +full:mode
1 // SPDX-License-Identifier: GPL-2.0-or-later
40 * - With both FULL amplitude and FULL bias current: bias current
42 * - With only DSP amplitude: bias current is set to half and
44 * - With DSP bias current (included both DSP amplitude and
60 /* LED hw control pattern for fiber port */
138 switch (phydev->port) { in qca807x_led_parse_netdev()
170 return -EOPNOTSUPP; in qca807x_led_parse_netdev()
174 return -EOPNOTSUPP; in qca807x_led_parse_netdev()
184 return -EINVAL; in qca807x_led_hw_control_enable()
196 return -EINVAL; in qca807x_led_hw_is_supported()
208 return -EINVAL; in qca807x_led_hw_control_set()
218 switch (phydev->port) { in qca807x_led_hw_control_set()
229 return -EINVAL; in qca807x_led_hw_control_set()
254 return -EINVAL; in qca807x_led_hw_control_get()
258 return -EINVAL; in qca807x_led_hw_control_get()
261 switch (phydev->port) { in qca807x_led_hw_control_get()
298 return -EINVAL; in qca807x_led_hw_control_get()
309 return -EINVAL; in qca807x_led_hw_control_reset()
311 switch (phydev->port) { in qca807x_led_hw_control_reset()
322 return -EINVAL; in qca807x_led_hw_control_reset()
335 return -EINVAL; in qca807x_led_brightness_set()
355 return -EINVAL; in qca807x_led_blink_set()
374 val = phy_read_mmd(priv->phy, MDIO_MMD_AN, reg); in qca807x_gpio_get()
387 val = phy_read_mmd(priv->phy, MDIO_MMD_AN, reg); in qca807x_gpio_set()
392 phy_write_mmd(priv->phy, MDIO_MMD_AN, reg, val); in qca807x_gpio_set()
404 struct device *dev = &phydev->mdio.dev; in qca807x_gpio()
410 return -ENOMEM; in qca807x_gpio()
412 priv->phy = phydev; in qca807x_gpio()
416 return -ENOMEM; in qca807x_gpio()
418 gc->label = dev_name(dev); in qca807x_gpio()
419 gc->base = -1; in qca807x_gpio()
420 gc->ngpio = 2; in qca807x_gpio()
421 gc->parent = dev; in qca807x_gpio()
422 gc->owner = THIS_MODULE; in qca807x_gpio()
423 gc->can_sleep = true; in qca807x_gpio()
424 gc->get_direction = qca807x_gpio_get_direction; in qca807x_gpio()
425 gc->direction_output = qca807x_gpio_dir_out; in qca807x_gpio()
426 gc->get = qca807x_gpio_get; in qca807x_gpio()
427 gc->set = qca807x_gpio_set; in qca807x_gpio()
442 /* Read the QCA807x PHY-Specific Status register fiber page, in qca807x_read_fiber_status()
444 * using, irrespective of whether we are in autoneg mode or not. in qca807x_read_fiber_status()
450 phydev->speed = SPEED_UNKNOWN; in qca807x_read_fiber_status()
451 phydev->duplex = DUPLEX_UNKNOWN; in qca807x_read_fiber_status()
455 phydev->speed = SPEED_100; in qca807x_read_fiber_status()
458 phydev->speed = SPEED_1000; in qca807x_read_fiber_status()
463 phydev->duplex = DUPLEX_FULL; in qca807x_read_fiber_status()
465 phydev->duplex = DUPLEX_HALF; in qca807x_read_fiber_status()
473 if (linkmode_test_bit(ETHTOOL_LINK_MODE_FIBRE_BIT, phydev->supported)) { in qca807x_read_status()
474 switch (phydev->port) { in qca807x_read_status()
480 return -EINVAL; in qca807x_read_status()
489 struct phy_package_shared *shared = phydev->shared; in qca807x_phy_package_probe_once()
490 struct qca807x_shared_priv *priv = shared->priv; in qca807x_phy_package_probe_once()
495 if (of_property_read_u32(shared->np, "qcom,tx-drive-strength-milliwatt", in qca807x_phy_package_probe_once()
501 priv->tx_drive_strength = PQSGMII_TX_DRIVER_140MV; in qca807x_phy_package_probe_once()
504 priv->tx_drive_strength = PQSGMII_TX_DRIVER_160MV; in qca807x_phy_package_probe_once()
507 priv->tx_drive_strength = PQSGMII_TX_DRIVER_180MV; in qca807x_phy_package_probe_once()
510 priv->tx_drive_strength = PQSGMII_TX_DRIVER_200MV; in qca807x_phy_package_probe_once()
513 priv->tx_drive_strength = PQSGMII_TX_DRIVER_220MV; in qca807x_phy_package_probe_once()
516 priv->tx_drive_strength = PQSGMII_TX_DRIVER_240MV; in qca807x_phy_package_probe_once()
519 priv->tx_drive_strength = PQSGMII_TX_DRIVER_260MV; in qca807x_phy_package_probe_once()
522 priv->tx_drive_strength = PQSGMII_TX_DRIVER_280MV; in qca807x_phy_package_probe_once()
525 priv->tx_drive_strength = PQSGMII_TX_DRIVER_300MV; in qca807x_phy_package_probe_once()
528 priv->tx_drive_strength = PQSGMII_TX_DRIVER_320MV; in qca807x_phy_package_probe_once()
531 priv->tx_drive_strength = PQSGMII_TX_DRIVER_400MV; in qca807x_phy_package_probe_once()
534 priv->tx_drive_strength = PQSGMII_TX_DRIVER_500MV; in qca807x_phy_package_probe_once()
537 priv->tx_drive_strength = PQSGMII_TX_DRIVER_600MV; in qca807x_phy_package_probe_once()
540 return -EINVAL; in qca807x_phy_package_probe_once()
543 priv->package_mode = PHY_INTERFACE_MODE_NA; in qca807x_phy_package_probe_once()
544 if (!of_property_read_string(shared->np, "qcom,package-mode", in qca807x_phy_package_probe_once()
548 priv->package_mode = PHY_INTERFACE_MODE_PSGMII; in qca807x_phy_package_probe_once()
551 priv->package_mode = PHY_INTERFACE_MODE_QSGMII; in qca807x_phy_package_probe_once()
553 return -EINVAL; in qca807x_phy_package_probe_once()
561 struct phy_package_shared *shared = phydev->shared; in qca807x_phy_package_config_init_once()
562 struct qca807x_shared_priv *priv = shared->priv; in qca807x_phy_package_config_init_once()
565 /* Make sure PHY follow PHY package mode if enforced */ in qca807x_phy_package_config_init_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()
572 /* Set correct PHY package mode */ in qca807x_phy_package_config_init_once()
580 switch (priv->package_mode) { in qca807x_phy_package_config_init_once()
593 /* After mode change Serdes reset is required */ 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()
660 /* Set PHY mode to PSGMII combo (1/4 copper + combo ports) mode */ in qca807x_sfp_insert()
665 /* Enable fiber mode autodection (1000Base-X or 100Base-FX) */ in qca807x_sfp_insert()
670 /* Select fiber page */ 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()
725 shared = phydev->shared; in qca807x_probe()
726 shared_priv = shared->priv; in qca807x_probe()
730 return -ENOMEM; in qca807x_probe()
732 priv->dac_full_amplitude = of_property_read_bool(node, "qcom,dac-full-amplitude"); in qca807x_probe()
733 priv->dac_full_bias_current = of_property_read_bool(node, "qcom,dac-full-bias-current"); in qca807x_probe()
734 priv->dac_disable_bias_current_tweak = of_property_read_bool(node, in qca807x_probe()
735 "qcom,dac-disable-bias-current-tweak"); in qca807x_probe()
739 if (of_property_read_bool(node, "gpio-controller")) { in qca807x_probe()
751 linkmode_set_bit(ETHTOOL_LINK_MODE_FIBRE_BIT, phydev->supported); in qca807x_probe()
752 linkmode_set_bit(ETHTOOL_LINK_MODE_FIBRE_BIT, phydev->advertising); in qca807x_probe()
755 phydev->priv = priv; in qca807x_probe()
762 struct qca807x_priv *priv = phydev->priv; in qca807x_config_init()
775 if (!priv->dac_full_amplitude) in qca807x_config_init()
777 if (!priv->dac_full_amplitude) in qca807x_config_init()
779 if (!priv->dac_disable_bias_current_tweak) in qca807x_config_init()