diff options
author | Wong Vee Khee <vee.khee.wong@linux.intel.com> | 2021-03-23 17:46:40 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-03-24 23:20:07 +0100 |
commit | 0ef25ed104ac17fa0586fbb076f24a5e8940b966 (patch) | |
tree | 7c41681e5cd419a4d4ea70f12a60ef66c6d3c86e /drivers/net/phy/phy-c45.c | |
parent | rhashtable: avoid -Wrestrict warning on overlapping sprintf output (diff) | |
download | linux-0ef25ed104ac17fa0586fbb076f24a5e8940b966.tar.xz linux-0ef25ed104ac17fa0586fbb076f24a5e8940b966.zip |
net: phy: add genphy_c45_loopback
Add generic code to enable C45 PHY loopback into the common phy-c45.c
file. This will allow C45 PHY drivers aceess this by setting
.set_loopback.
Suggested-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: Wong Vee Khee <vee.khee.wong@linux.intel.com>
Reviewed-by: Heiner Kallweit <hkallweit1@gmail.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/phy/phy-c45.c')
-rw-r--r-- | drivers/net/phy/phy-c45.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/net/phy/phy-c45.c b/drivers/net/phy/phy-c45.c index 077f2929c45e..91e3acb9e397 100644 --- a/drivers/net/phy/phy-c45.c +++ b/drivers/net/phy/phy-c45.c @@ -560,6 +560,14 @@ int gen10g_config_aneg(struct phy_device *phydev) } EXPORT_SYMBOL_GPL(gen10g_config_aneg); +int genphy_c45_loopback(struct phy_device *phydev, bool enable) +{ + return phy_modify_mmd(phydev, MDIO_MMD_PCS, MDIO_CTRL1, + MDIO_PCS_CTRL1_LOOPBACK, + enable ? MDIO_PCS_CTRL1_LOOPBACK : 0); +} +EXPORT_SYMBOL_GPL(genphy_c45_loopback); + struct phy_driver genphy_c45_driver = { .phy_id = 0xffffffff, .phy_id_mask = 0xffffffff, |