diff options
author | Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> | 2014-02-05 23:40:05 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2014-02-10 09:08:51 +0100 |
commit | 29af281cb1bc1d8b9d098fa6b550af9b019a2512 (patch) | |
tree | d916c99eaa169b74c26c67fc03b5f8506135a6c4 /include | |
parent | 7ccd47fd5ca57b0755abe39cb39887aae783ac9d (diff) | |
download | barebox-29af281cb1bc1d8b9d098fa6b550af9b019a2512.tar.gz barebox-29af281cb1bc1d8b9d098fa6b550af9b019a2512.tar.xz |
net: phy: add of_phy_device_connect
This implements a of_phy_device_connect to allow DT enabled drivers
to connect to a PHY device by using the PHY's DT node only. It
currently assumes that each PHY node is a child of the corresponding
mdio bus.
Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/phy.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/include/linux/phy.h b/include/linux/phy.h index c8980b0191..9567c43e38 100644 --- a/include/linux/phy.h +++ b/include/linux/phy.h @@ -280,6 +280,20 @@ int phy_device_connect(struct eth_device *dev, struct mii_bus *bus, int addr, void (*adjust_link) (struct eth_device *edev), u32 flags, phy_interface_t interface); +#if defined(CONFIG_OFTREE) +int of_phy_device_connect(struct eth_device *edev, struct device_node *phy_np, + void (*adjust_link) (struct eth_device *edev), + u32 flags, phy_interface_t interface); +#else +static inline int of_phy_device_connect(struct eth_device *edev, + struct device_node *phy_np, + void (*adjust_link) (struct eth_device *edev), + u32 flags, phy_interface_t interface) +{ + return -ENOSYS; +} +#endif + int phy_update_status(struct phy_device *phydev); int phy_wait_aneg_done(struct phy_device *phydev); |