cregit-Linux how code gets into the kernel

Release 4.16 include/linux/of_mdio.h

Directory: include/linux
/*
 * 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

PersonTokensPropCommitsCommitProp
Jon Mason8193.10%150.00%
Arnd Bergmann66.90%150.00%
Total87100.00%2100.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

PersonTokensPropCommitsCommitProp
Srinivas Kandagatla1770.83%133.33%
Daniel Mack520.83%133.33%
Mark Brown28.33%133.33%
Total24100.00%3100.00%


static inline struct phy_device *of_phy_find_device(struct device_node *phy_np) { return NULL; }

Contributors

PersonTokensPropCommitsCommitProp
Srinivas Kandagatla1588.24%150.00%
Mark Brown211.76%150.00%
Total17100.00%2100.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

PersonTokensPropCommitsCommitProp
Srinivas Kandagatla3589.74%133.33%
Mark Brown25.13%133.33%
Dongpo Li25.13%133.33%
Total39100.00%3100.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

PersonTokensPropCommitsCommitProp
Dongpo Li3193.94%150.00%
Srinivas Kandagatla26.06%150.00%
Total33100.00%2100.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

PersonTokensPropCommitsCommitProp
Andy Fleming28100.00%1100.00%
Total28100.00%1100.00%


static inline struct mii_bus *of_mdio_find_bus(struct device_node *mdio_np) { return NULL; }

Contributors

PersonTokensPropCommitsCommitProp
Srinivas Kandagatla1588.24%150.00%
Mark Brown211.76%150.00%
Total17100.00%2100.00%


static inline int of_mdio_parse_addr(struct device *dev, const struct device_node *np) { return -ENOSYS; }

Contributors

PersonTokensPropCommitsCommitProp
Florian Fainelli22100.00%1100.00%
Total22100.00%1100.00%


static inline int of_phy_register_fixed_link(struct device_node *np) { return -ENOSYS; }

Contributors

PersonTokensPropCommitsCommitProp
Thomas Petazzoni16100.00%1100.00%
Total16100.00%1100.00%


static inline void of_phy_deregister_fixed_link(struct device_node *np) { }

Contributors

PersonTokensPropCommitsCommitProp
Johan Hovold11100.00%1100.00%
Total11100.00%1100.00%


static inline bool of_phy_is_fixed_link(struct device_node *np) { return false; }

Contributors

PersonTokensPropCommitsCommitProp
Thomas Petazzoni15100.00%1100.00%
Total15100.00%1100.00%

#endif #endif /* __LINUX_OF_MDIO_H */

Overall Contributors

PersonTokensPropCommitsCommitProp
Jon Mason8617.59%17.14%
Srinivas Kandagatla8617.59%17.14%
Grant C. Likely7715.75%17.14%
Dongpo Li6112.47%17.14%
Andy Fleming5010.22%17.14%
Florian Fainelli387.77%214.29%
Thomas Petazzoni336.75%17.14%
Johan Hovold183.68%17.14%
Arnd Bergmann153.07%17.14%
David Daney102.04%17.14%
Mark Brown81.64%17.14%
Daniel Mack51.02%17.14%
Anton Vorontsov20.41%17.14%
Total489100.00%14100.00%
Directory: include/linux
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.
Created with cregit.