diff options
author | Grant Likely <grant.likely@secretlab.ca> | 2009-04-25 08:52:56 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-04-27 05:53:47 -0400 |
commit | 8bc487d150b939e69830c39322df4ee486efe381 (patch) | |
tree | 36f19428f8cf40363b17e3afcc54dee7403f7d29 /include/linux/of_mdio.h | |
parent | fa94f6d93c5382810ff41f010f12ca8698fc775e (diff) |
openfirmware: Add OF phylib support code
Add support for parsing the device tree for PHY devices on an MDIO bus.
Currently many of the PowerPC ethernet drivers are open coding a solution
for reading data out of the device tree to find the correct PHY device.
This patch implements a set of common routines to:
a) let MDIO bus drivers register phy_devices described in the tree, and
b) let MAC drivers find the correct phy_device via the tree.
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Acked-by: Andy Fleming <afleming@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/of_mdio.h')
-rw-r--r-- | include/linux/of_mdio.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/include/linux/of_mdio.h b/include/linux/of_mdio.h new file mode 100644 index 000000000000..c9663c690303 --- /dev/null +++ b/include/linux/of_mdio.h | |||
@@ -0,0 +1,22 @@ | |||
1 | /* | ||
2 | * OF helpers for the MDIO (Ethernet PHY) API | ||
3 | * | ||
4 | * Copyright (c) 2009 Secret Lab Technologies, Ltd. | ||
5 | * | ||
6 | * This file is released under the GPLv2 | ||
7 | */ | ||
8 | |||
9 | #ifndef __LINUX_OF_MDIO_H | ||
10 | #define __LINUX_OF_MDIO_H | ||
11 | |||
12 | #include <linux/phy.h> | ||
13 | #include <linux/of.h> | ||
14 | |||
15 | extern int of_mdiobus_register(struct mii_bus *mdio, struct device_node *np); | ||
16 | extern struct phy_device *of_phy_find_device(struct device_node *phy_np); | ||
17 | extern struct phy_device *of_phy_connect(struct net_device *dev, | ||
18 | struct device_node *phy_np, | ||
19 | void (*hndlr)(struct net_device *), | ||
20 | u32 flags, phy_interface_t iface); | ||
21 | |||
22 | #endif /* __LINUX_OF_MDIO_H */ | ||