aboutsummaryrefslogtreecommitdiff
path: root/drivers/net/phy/bcm-phy-lib.h
diff options
context:
space:
mode:
authorGravatar Jonathan Lemon <jonathan.lemon@gmail.com> 2022-06-21 22:04:52 -0700
committerGravatar Jakub Kicinski <kuba@kernel.org> 2022-06-23 20:49:02 -0700
commit15acf89e1286b91fc46aebf56d9334b33e5ca847 (patch)
tree950fcba35c31deb5528ca2e0abdd04b8bd6303b1 /drivers/net/phy/bcm-phy-lib.h
parentMerge branch 'net-dsa-mv88e6xxx-get-rid-of-speed_max' (diff)
downloadlinux-15acf89e1286b91fc46aebf56d9334b33e5ca847.tar.gz
linux-15acf89e1286b91fc46aebf56d9334b33e5ca847.tar.bz2
linux-15acf89e1286b91fc46aebf56d9334b33e5ca847.zip
net: phy: broadcom: Add Broadcom PTP hooks to bcm-phy-lib
Add 'struct bcm_ptp_private' to bcm54xx_phy_priv which points to an optional PTP structure attached to the PHY. This is allocated on probe if PHY PTP support is configured, and if the driver supports PTP for the specified PHY. Add the bcm_ptp_probe(), bcm_ptp_config_init() and bcn_ptp_stop() API functions to the bcm-phy library. Signed-off-by: Jonathan Lemon <jonathan.lemon@gmail.com> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Acked-by: Richard Cochran <richardcochran@gmail.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/net/phy/bcm-phy-lib.h')
-rw-r--r--drivers/net/phy/bcm-phy-lib.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/drivers/net/phy/bcm-phy-lib.h b/drivers/net/phy/bcm-phy-lib.h
index c3842f87c33b..9902fb182099 100644
--- a/drivers/net/phy/bcm-phy-lib.h
+++ b/drivers/net/phy/bcm-phy-lib.h
@@ -87,4 +87,23 @@ int bcm_phy_cable_test_start_rdb(struct phy_device *phydev);
int bcm_phy_cable_test_start(struct phy_device *phydev);
int bcm_phy_cable_test_get_status(struct phy_device *phydev, bool *finished);
+#if IS_ENABLED(CONFIG_BCM_NET_PHYPTP)
+struct bcm_ptp_private *bcm_ptp_probe(struct phy_device *phydev);
+void bcm_ptp_config_init(struct phy_device *phydev);
+void bcm_ptp_stop(struct bcm_ptp_private *priv);
+#else
+static inline struct bcm_ptp_private *bcm_ptp_probe(struct phy_device *phydev)
+{
+ return NULL;
+}
+
+static inline void bcm_ptp_config_init(struct phy_device *phydev)
+{
+}
+
+static inline void bcm_ptp_stop(struct bcm_ptp_private *priv)
+{
+}
+#endif
+
#endif /* _LINUX_BCM_PHY_LIB_H */