Lines Matching +full:phy +full:- +full:10 +full:base +full:- +full:t1l +full:- +full:2
1 // SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause)
3 * Driver for Analog Devices Industrial Ethernet T1L PHYs
14 #include <linux/phy.h>
37 #define ADIN_IS_CFG_SLV BIT(2)
65 * struct adin_priv - ADIN PHY driver private data
66 * @tx_level_2v4_able: set if the PHY supports 2.4V TX levels (10BASE-T1L)
67 * @tx_level_2v4: set if the PHY requests 2.4V TX levels (10BASE-T1L)
89 phydev->master_slave_state = MASTER_SLAVE_STATE_SLAVE; in adin_read_status()
92 phydev->master_slave_state = MASTER_SLAVE_STATE_MASTER; in adin_read_status()
99 struct adin_priv *priv = phydev->priv; in adin_config_aneg()
102 if (phydev->autoneg == AUTONEG_DISABLE) { in adin_config_aneg()
107 if (priv->tx_level_prop_present && priv->tx_level_2v4) in adin_config_aneg()
116 /* Force PHY to use above configurations */ in adin_config_aneg()
125 if (priv->tx_level_prop_present && priv->tx_level_2v4) { in adin_config_aneg()
134 if ((priv->tx_level_prop_present && !priv->tx_level_2v4) || !priv->tx_level_2v4_able) { in adin_config_aneg()
163 if (phydev->interrupts == PHY_INTERRUPT_ENABLED) in adin_config_intr()
221 return -EOPNOTSUPP; in adin_set_loopback()
227 /* PCS loopback (according to 10BASE-T1L spec) */ in adin_set_loopback()
247 struct adin_priv *priv = phydev->priv; in adin_get_features()
248 struct device *dev = &phydev->mdio.dev; in adin_get_features()
257 priv->tx_level_2v4_able = !!(ret & MDIO_PMA_10T1L_STAT_2V4_ABLE); in adin_get_features()
259 phydev_dbg(phydev, "PHY supports 2.4V TX level: %s\n", in adin_get_features()
260 priv->tx_level_2v4_able ? "yes" : "no"); in adin_get_features()
262 priv->tx_level_prop_present = device_property_present(dev, "phy-10base-t1l-2.4vpp"); in adin_get_features()
263 if (priv->tx_level_prop_present) { in adin_get_features()
264 ret = device_property_read_u8(dev, "phy-10base-t1l-2.4vpp", &val); in adin_get_features()
268 priv->tx_level_2v4 = val; in adin_get_features()
269 if (!priv->tx_level_2v4 && priv->tx_level_2v4_able) in adin_get_features()
271 "PHY supports 2.4V TX level, but disabled via config\n"); in adin_get_features()
275 phydev->supported); in adin_get_features()
302 return -EINVAL; in adin_get_sqi()
312 struct device *dev = &phydev->mdio.dev; in adin_probe()
317 return -ENOMEM; in adin_probe()
319 phydev->priv = priv; in adin_probe()
354 MODULE_DESCRIPTION("Analog Devices Industrial Ethernet T1L PHY driver");