summaryrefslogtreecommitdiff
path: root/include/phy.h
diff options
context:
space:
mode:
authorDan Murphy <dmurphy@ti.com>2016-05-02 15:46:01 -0500
committerJoe Hershberger <joe.hershberger@ni.com>2016-05-24 11:42:05 -0500
commit3c221af3c3bb4eadc0899f611c8b25bb95a1e09f (patch)
tree51190c303478f77b804138d6148690c2a99a720b /include/phy.h
parent3ab72fe8075b137c238665008c356239d1e6bc54 (diff)
downloadu-boot-imx-3c221af3c3bb4eadc0899f611c8b25bb95a1e09f.zip
u-boot-imx-3c221af3c3bb4eadc0899f611c8b25bb95a1e09f.tar.gz
u-boot-imx-3c221af3c3bb4eadc0899f611c8b25bb95a1e09f.tar.bz2
net: phy: Add phy_interface_is_sgmii to phy.h
Add a helper to phy.h to identify whether the phy is configured for SGMII all variables. Signed-off-by: Dan Murphy <dmurphy@ti.com> Reviewed-by: Mugunthan V N <mugunthanvnm@ti.com> Reviewed-by: Michal Simek <michal.simek@xilinx.com> Tested-by: Mugunthan V N <mugunthanvnm@ti.com> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
Diffstat (limited to 'include/phy.h')
-rw-r--r--include/phy.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/phy.h b/include/phy.h
index 7346da7..268d9a1 100644
--- a/include/phy.h
+++ b/include/phy.h
@@ -289,6 +289,17 @@ static inline bool phy_interface_is_rgmii(struct phy_device *phydev)
phydev->interface <= PHY_INTERFACE_MODE_RGMII_TXID;
}
+/**
+ * phy_interface_is_sgmii - Convenience function for testing if a PHY interface
+ * is SGMII (all variants)
+ * @phydev: the phy_device struct
+ */
+static inline bool phy_interface_is_sgmii(struct phy_device *phydev)
+{
+ return phydev->interface >= PHY_INTERFACE_MODE_SGMII &&
+ phydev->interface <= PHY_INTERFACE_MODE_QSGMII;
+}
+
/* PHY UIDs for various PHYs that are referenced in external code */
#define PHY_UID_CS4340 0x13e51002
#define PHY_UID_TN2020 0x00a19410