summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorAndy Fleming <afleming@freescale.com>2013-04-03 07:52:13 (GMT)
committerFleming Andrew-AFLEMING <AFLEMING@freescale.com>2013-04-03 07:59:19 (GMT)
commit8cb661834aacfbb99b8635f03bab7e49770c0415 (patch)
treecc483ef0b0969294d5287292a79eb2e54243f7ba /drivers
parent01e9d49623361ed0f563407347ce538943f8fb63 (diff)
downloadlinux-fsl-qoriq-8cb661834aacfbb99b8635f03bab7e49770c0415.tar.xz
phylib: Add of_phy_attach
10G PHYs don't currently support running the state machine, which is implicitly setup via of_phy_connect(). Therefore, it is necessary to implement an OF version of phy_attach(), which does everything except start the state machine. Change-Id: Iedc8a949b0c8b4ee35afb16fe41518c91e0b809f Signed-off-by: Andy Fleming <afleming@freescale.com> Reviewed-on: http://git.am.freescale.net:8181/970 Reviewed-by: Fleming Andrew-AFLEMING <AFLEMING@freescale.com> Tested-by: Fleming Andrew-AFLEMING <AFLEMING@freescale.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/of/of_mdio.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/drivers/of/of_mdio.c b/drivers/of/of_mdio.c
index 83ca06f..9ebb173 100644
--- a/drivers/of/of_mdio.c
+++ b/drivers/of/of_mdio.c
@@ -198,3 +198,25 @@ struct phy_device *of_phy_connect_fixed_link(struct net_device *dev,
return IS_ERR(phy) ? NULL : phy;
}
EXPORT_SYMBOL(of_phy_connect_fixed_link);
+
+/**
+ * of_phy_attach - Attach to a PHY without starting the state machine
+ * @dev: pointer to net_device claiming the phy
+ * @phy_np: Node pointer for the PHY
+ * @flags: flags to pass to the PHY
+ * @iface: PHY data interface type
+ */
+struct phy_device *of_phy_attach(struct net_device *dev,
+ struct device_node *phy_np,
+ u32 flags,
+ phy_interface_t iface)
+{
+ struct phy_device *phy = of_phy_find_device(phy_np);
+
+ if (!phy)
+ return NULL;
+
+ return phy_attach_direct(dev, phy, flags, iface) ? NULL : phy;
+}
+EXPORT_SYMBOL(of_phy_attach);
+