Release 4.16 include/linux/of_mdio.h
/*
* 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>
#if IS_ENABLED(CONFIG_OF_MDIO)
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);
extern struct phy_device *
of_phy_get_and_connect(struct net_device *dev, struct device_node *np,
void (*hndlr)(struct net_device *));
struct phy_device *of_phy_attach(struct net_device *dev,
struct device_node *phy_np, u32 flags,
phy_interface_t iface);
extern struct mii_bus *of_mdio_find_bus(struct device_node *mdio_np);
extern int of_phy_register_fixed_link(struct device_node *np);
extern void of_phy_deregister_fixed_link(struct device_node *np);
extern bool of_phy_is_fixed_link(struct device_node *np);
static inline int of_mdio_parse_addr(struct device *dev,
const struct device_node *np)
{
u32 addr;
int ret;
ret = of_property_read_u32(np, "reg", &addr);
if (ret < 0) {
dev_err(dev, "%s has invalid PHY address\n", np->full_name);
return ret;
}
/* A PHY must have a reg property in the range [0-31] */
if (addr >= PHY_MAX_ADDR) {
dev_err(dev, "%s PHY address %i is too large\n",
np->full_name, addr);
return -EINVAL;
}
return addr;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Jon Mason | 81 | 93.10% | 1 | 50.00% |
Arnd Bergmann | 6 | 6.90% | 1 | 50.00% |
Total | 87 | 100.00% | 2 | 100.00% |
#else /* CONFIG_OF_MDIO */
static inline int of_mdiobus_register(struct mii_bus *mdio, struct device_node *np)
{
/*
* Fall back to the non-DT function to register a bus.
* This way, we don't have to keep compat bits around in drivers.
*/
return mdiobus_register(mdio);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Srinivas Kandagatla | 17 | 70.83% | 1 | 33.33% |
Daniel Mack | 5 | 20.83% | 1 | 33.33% |
Mark Brown | 2 | 8.33% | 1 | 33.33% |
Total | 24 | 100.00% | 3 | 100.00% |
static inline struct phy_device *of_phy_find_device(struct device_node *phy_np)
{
return NULL;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Srinivas Kandagatla | 15 | 88.24% | 1 | 50.00% |
Mark Brown | 2 | 11.76% | 1 | 50.00% |
Total | 17 | 100.00% | 2 | 100.00% |
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)
{
return NULL;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Srinivas Kandagatla | 35 | 89.74% | 1 | 33.33% |
Mark Brown | 2 | 5.13% | 1 | 33.33% |
Dongpo Li | 2 | 5.13% | 1 | 33.33% |
Total | 39 | 100.00% | 3 | 100.00% |
static inline struct phy_device *
of_phy_get_and_connect(struct net_device *dev, struct device_node *np,
void (*hndlr)(struct net_device *))
{
return NULL;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Dongpo Li | 31 | 93.94% | 1 | 50.00% |
Srinivas Kandagatla | 2 | 6.06% | 1 | 50.00% |
Total | 33 | 100.00% | 2 | 100.00% |
static inline struct phy_device *of_phy_attach(struct net_device *dev,
struct device_node *phy_np,
u32 flags, phy_interface_t iface)
{
return NULL;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Andy Fleming | 28 | 100.00% | 1 | 100.00% |
Total | 28 | 100.00% | 1 | 100.00% |
static inline struct mii_bus *of_mdio_find_bus(struct device_node *mdio_np)
{
return NULL;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Srinivas Kandagatla | 15 | 88.24% | 1 | 50.00% |
Mark Brown | 2 | 11.76% | 1 | 50.00% |
Total | 17 | 100.00% | 2 | 100.00% |
static inline int of_mdio_parse_addr(struct device *dev,
const struct device_node *np)
{
return -ENOSYS;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Florian Fainelli | 22 | 100.00% | 1 | 100.00% |
Total | 22 | 100.00% | 1 | 100.00% |
static inline int of_phy_register_fixed_link(struct device_node *np)
{
return -ENOSYS;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Thomas Petazzoni | 16 | 100.00% | 1 | 100.00% |
Total | 16 | 100.00% | 1 | 100.00% |
static inline void of_phy_deregister_fixed_link(struct device_node *np)
{
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Johan Hovold | 11 | 100.00% | 1 | 100.00% |
Total | 11 | 100.00% | 1 | 100.00% |
static inline bool of_phy_is_fixed_link(struct device_node *np)
{
return false;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Thomas Petazzoni | 15 | 100.00% | 1 | 100.00% |
Total | 15 | 100.00% | 1 | 100.00% |
#endif
#endif /* __LINUX_OF_MDIO_H */
Overall Contributors
Person | Tokens | Prop | Commits | CommitProp |
Jon Mason | 86 | 17.59% | 1 | 7.14% |
Srinivas Kandagatla | 86 | 17.59% | 1 | 7.14% |
Grant C. Likely | 77 | 15.75% | 1 | 7.14% |
Dongpo Li | 61 | 12.47% | 1 | 7.14% |
Andy Fleming | 50 | 10.22% | 1 | 7.14% |
Florian Fainelli | 38 | 7.77% | 2 | 14.29% |
Thomas Petazzoni | 33 | 6.75% | 1 | 7.14% |
Johan Hovold | 18 | 3.68% | 1 | 7.14% |
Arnd Bergmann | 15 | 3.07% | 1 | 7.14% |
David Daney | 10 | 2.04% | 1 | 7.14% |
Mark Brown | 8 | 1.64% | 1 | 7.14% |
Daniel Mack | 5 | 1.02% | 1 | 7.14% |
Anton Vorontsov | 2 | 0.41% | 1 | 7.14% |
Total | 489 | 100.00% | 14 | 100.00% |
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.