Lines Matching +full:dac +full:- +full:full +full:- +full:bias +full:- +full:current

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
45 * DSP bias current): bias current is half the detected current
138 switch (phydev->port) {
170 return -EOPNOTSUPP;
174 return -EOPNOTSUPP;
184 return -EINVAL;
196 return -EINVAL;
208 return -EINVAL;
218 switch (phydev->port) {
229 return -EINVAL;
254 return -EINVAL;
258 return -EINVAL;
261 switch (phydev->port) {
298 return -EINVAL;
309 return -EINVAL;
311 switch (phydev->port) {
322 return -EINVAL;
335 return -EINVAL;
355 return -EINVAL;
374 val = phy_read_mmd(priv->phy, MDIO_MMD_AN, reg);
387 val = phy_read_mmd(priv->phy, MDIO_MMD_AN, reg);
392 phy_write_mmd(priv->phy, MDIO_MMD_AN, reg, val);
404 struct device *dev = &phydev->mdio.dev;
410 return -ENOMEM;
412 priv->phy = phydev;
416 return -ENOMEM;
418 gc->label = dev_name(dev);
419 gc->base = -1;
420 gc->ngpio = 2;
421 gc->parent = dev;
422 gc->owner = THIS_MODULE;
423 gc->can_sleep = true;
424 gc->get_direction = qca807x_gpio_get_direction;
425 gc->direction_output = qca807x_gpio_dir_out;
426 gc->get = qca807x_gpio_get;
427 gc->set = qca807x_gpio_set;
442 /* Read the QCA807x PHY-Specific Status register fiber page,
450 phydev->speed = SPEED_UNKNOWN;
451 phydev->duplex = DUPLEX_UNKNOWN;
455 phydev->speed = SPEED_100;
458 phydev->speed = SPEED_1000;
463 phydev->duplex = DUPLEX_FULL;
465 phydev->duplex = DUPLEX_HALF;
473 if (linkmode_test_bit(ETHTOOL_LINK_MODE_FIBRE_BIT, phydev->supported)) {
474 switch (phydev->port) {
480 return -EINVAL;
489 struct phy_package_shared *shared = phydev->shared;
490 struct qca807x_shared_priv *priv = shared->priv;
495 if (of_property_read_u32(shared->np, "qcom,tx-drive-strength-milliwatt",
501 priv->tx_drive_strength = PQSGMII_TX_DRIVER_140MV;
504 priv->tx_drive_strength = PQSGMII_TX_DRIVER_160MV;
507 priv->tx_drive_strength = PQSGMII_TX_DRIVER_180MV;
510 priv->tx_drive_strength = PQSGMII_TX_DRIVER_200MV;
513 priv->tx_drive_strength = PQSGMII_TX_DRIVER_220MV;
516 priv->tx_drive_strength = PQSGMII_TX_DRIVER_240MV;
519 priv->tx_drive_strength = PQSGMII_TX_DRIVER_260MV;
522 priv->tx_drive_strength = PQSGMII_TX_DRIVER_280MV;
525 priv->tx_drive_strength = PQSGMII_TX_DRIVER_300MV;
528 priv->tx_drive_strength = PQSGMII_TX_DRIVER_320MV;
531 priv->tx_drive_strength = PQSGMII_TX_DRIVER_400MV;
534 priv->tx_drive_strength = PQSGMII_TX_DRIVER_500MV;
537 priv->tx_drive_strength = PQSGMII_TX_DRIVER_600MV;
540 return -EINVAL;
543 priv->package_mode = PHY_INTERFACE_MODE_NA;
544 if (!of_property_read_string(shared->np, "qcom,package-mode",
548 priv->package_mode = PHY_INTERFACE_MODE_PSGMII;
551 priv->package_mode = PHY_INTERFACE_MODE_QSGMII;
553 return -EINVAL;
561 struct phy_package_shared *shared = phydev->shared;
562 struct qca807x_shared_priv *priv = shared->priv;
566 if (priv->package_mode != PHY_INTERFACE_MODE_NA &&
567 phydev->interface != priv->package_mode)
568 return -EINVAL;
580 switch (priv->package_mode) {
625 val |= FIELD_PREP(PQSGMII_TX_DRIVER_MASK, priv->tx_drive_strength);
652 sfp_parse_support(phydev->sfp_bus, id, support, interfaces);
653 iface = sfp_select_interface(phydev->sfp_bus, support);
655 dev_info(&phydev->mdio.dev, "%s SFP module inserted\n", phy_modes(iface));
665 /* Enable fiber mode autodection (1000Base-X or 100Base-FX) */
675 phydev->port = PORT_FIBRE;
678 dev_err(&phydev->mdio.dev, "Incompatible SFP module inserted\n");
679 return -EINVAL;
694 phydev->port = PORT_TP;
708 struct device_node *node = phydev->mdio.dev.of_node;
710 struct device *dev = &phydev->mdio.dev;
725 shared = phydev->shared;
726 shared_priv = shared->priv;
730 return -ENOMEM;
732 priv->dac_full_amplitude = of_property_read_bool(node, "qcom,dac-full-amplitude");
733 priv->dac_full_bias_current = of_property_read_bool(node, "qcom,dac-full-bias-current");
734 priv->dac_disable_bias_current_tweak = of_property_read_bool(node,
735 "qcom,dac-disable-bias-current-tweak");
739 if (of_property_read_bool(node, "gpio-controller")) {
751 linkmode_set_bit(ETHTOOL_LINK_MODE_FIBRE_BIT, phydev->supported);
752 linkmode_set_bit(ETHTOOL_LINK_MODE_FIBRE_BIT, phydev->advertising);
755 phydev->priv = priv;
762 struct qca807x_priv *priv = phydev->priv;
775 if (!priv->dac_full_amplitude)
777 if (!priv->dac_full_amplitude)
779 if (!priv->dac_disable_bias_current_tweak)