of_mdio.h 1.5 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14
/*
 * OF helpers for the MDIO (Ethernet PHY) API
 *
 * Copyright (c) 2009 Secret Lab Technologies, Ltd.
 *
 * This file is released under the GPLv2
 */

#ifndef __LINUX_OF_MDIO_H
#define __LINUX_OF_MDIO_H

#include <linux/phy.h>
#include <linux/of.h>

15
#ifdef CONFIG_OF
16 17 18 19 20 21
extern int of_mdiobus_register(struct mii_bus *mdio, struct device_node *np);
extern struct phy_device *of_phy_find_device(struct device_node *phy_np);
extern struct phy_device *of_phy_connect(struct net_device *dev,
					 struct device_node *phy_np,
					 void (*hndlr)(struct net_device *),
					 u32 flags, phy_interface_t iface);
22 23 24
extern struct phy_device *of_phy_connect_fixed_link(struct net_device *dev,
					 void (*hndlr)(struct net_device *),
					 phy_interface_t iface);
25

26 27
extern struct mii_bus *of_mdio_find_bus(struct device_node *mdio_np);

28
#else /* CONFIG_OF */
M
Mark Brown 已提交
29
static inline int of_mdiobus_register(struct mii_bus *mdio, struct device_node *np)
30 31 32 33
{
	return -ENOSYS;
}

M
Mark Brown 已提交
34
static inline struct phy_device *of_phy_find_device(struct device_node *phy_np)
35 36 37 38
{
	return NULL;
}

M
Mark Brown 已提交
39 40 41 42
static inline struct phy_device *of_phy_connect(struct net_device *dev,
						struct device_node *phy_np,
						void (*hndlr)(struct net_device *),
						u32 flags, phy_interface_t iface)
43 44 45 46
{
	return NULL;
}

M
Mark Brown 已提交
47 48 49
static inline struct phy_device *of_phy_connect_fixed_link(struct net_device *dev,
							   void (*hndlr)(struct net_device *),
							   phy_interface_t iface)
50 51 52 53
{
	return NULL;
}

M
Mark Brown 已提交
54
static inline struct mii_bus *of_mdio_find_bus(struct device_node *mdio_np)
55 56 57 58 59
{
	return NULL;
}
#endif /* CONFIG_OF */

60
#endif /* __LINUX_OF_MDIO_H */