Lines Matching +full:phy +full:- +full:pma

1 // SPDX-License-Identifier: GPL-2.0+
3 #include <linux/phy.h>
60 * when the copper cable is unplugged, the PHY enters into hibernation mode in about 10s.
70 #define QCA808X_MMD7_LED_CTRL(x) (0x8078 - ((x) * 2))
73 #define QCA808X_MMD7_LED_FORCE_CTRL(x) (0x8079 - ((x) * 2))
90 MODULE_DESCRIPTION("Qualcomm Atheros QCA808X PHY driver");
150 return (phydev->master_slave_get == MASTER_SLAVE_CFG_MASTER_FORCE) || in qca808x_is_prefer_master()
151 (phydev->master_slave_get == MASTER_SLAVE_CFG_MASTER_PREFERRED); in qca808x_is_prefer_master()
156 return linkmode_test_bit(ETHTOOL_LINK_MODE_2500baseT_Full_BIT, phydev->supported); in qca808x_has_fast_retrain_or_slave_seed()
172 unsigned long *possible = phydev->possible_interfaces; in qca808x_fill_possible_interfaces()
182 struct device *dev = &phydev->mdio.dev; in qca808x_probe()
187 return -ENOMEM; in qca808x_probe()
189 /* Init LED polarity mode to -1 */ in qca808x_probe()
190 priv->led_polarity_mode = -1; in qca808x_probe()
192 phydev->priv = priv; in qca808x_probe()
199 struct qca808x_priv *priv = phydev->priv; in qca808x_config_init()
202 /* Default to LED Active High if active-low not in DT */ in qca808x_config_init()
203 if (priv->led_polarity_mode == -1) { in qca808x_config_init()
235 /* Enable seed and configure lower ramdom seed to make phy in qca808x_config_init()
261 linkmode_mod_bit(ETHTOOL_LINK_MODE_2500baseT_Full_BIT, phydev->lp_advertising, in qca808x_read_status()
275 if (phydev->link) { in qca808x_read_status()
276 if (phydev->speed == SPEED_2500) in qca808x_read_status()
277 phydev->interface = PHY_INTERFACE_MODE_2500BASEX; in qca808x_read_status()
279 phydev->interface = PHY_INTERFACE_MODE_SGMII; in qca808x_read_status()
281 /* generate seed as a lower random value to make PHY linked as SLAVE easily, in qca808x_read_status()
286 * the corner case where the link partner is also the qca8081 PHY and the seed in qca808x_read_status()
291 if (phydev->master_slave_state == MASTER_SLAVE_STATE_ERR || in qca808x_read_status()
323 * 2. force PHY working in MDI mode. in qca808x_cable_test_start()
324 * 3. for PHY working in 1000BaseT. in qca808x_cable_test_start()
336 /* Force 1000base-T needs to configure PMA/PMD and MII_BMCR */ in qca808x_cable_test_start()
337 phydev->duplex = DUPLEX_FULL; in qca808x_cable_test_start()
338 phydev->speed = SPEED_1000; in qca808x_cable_test_start()
367 * but it is supported by qca808x PHY, so we add it here in qca808x_get_features()
370 linkmode_set_bit(ETHTOOL_LINK_MODE_Autoneg_BIT, phydev->supported); in qca808x_get_features()
377 linkmode_clear_bit(ETHTOOL_LINK_MODE_2500baseT_Full_BIT, phydev->supported); in qca808x_get_features()
394 if (phydev->autoneg == AUTONEG_DISABLE) in qca808x_config_aneg()
397 if (linkmode_test_bit(ETHTOOL_LINK_MODE_2500baseT_Full_BIT, phydev->advertising)) in qca808x_config_aneg()
411 * the interface device address is always phy address added by 1. in qca808x_link_change_notify()
413 mdiobus_c45_modify_changed(phydev->mdio.bus, phydev->mdio.addr + 1, in qca808x_link_change_notify()
416 phydev->link ? QCA8081_PHY_FIFO_RSTN : 0); in qca808x_link_change_notify()
441 return -EOPNOTSUPP; in qca808x_led_parse_netdev()
456 return -EINVAL; in qca808x_led_hw_control_enable()
468 return -EINVAL; in qca808x_led_hw_is_supported()
480 return -EINVAL; in qca808x_led_hw_control_set()
515 return -EINVAL; in qca808x_led_hw_control_get()
519 return -EINVAL; in qca808x_led_hw_control_get()
549 return -EINVAL; in qca808x_led_hw_control_reset()
564 return -EINVAL; in qca808x_led_brightness_set()
583 return -EINVAL; in qca808x_led_blink_set()
592 struct qca808x_priv *priv = phydev->priv; in qca808x_led_polarity_set()
602 return -EINVAL; in qca808x_led_polarity_set()
606 /* PHY polarity is global and can't be set per LED. in qca808x_led_polarity_set()
610 if (priv->led_polarity_mode >= 0 && in qca808x_led_polarity_set()
611 priv->led_polarity_mode != active_low) { in qca808x_led_polarity_set()
612 phydev_err(phydev, "PHY polarity is global. Mismatched polarity on different LED\n"); in qca808x_led_polarity_set()
613 return -EINVAL; in qca808x_led_polarity_set()
616 /* Save the last PHY polarity mode */ in qca808x_led_polarity_set()
617 priv->led_polarity_mode = active_low; in qca808x_led_polarity_set()