fwnode_mdio.h 858 B

1234567891011121314151617181920212223242526272829303132333435
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * FWNODE helper for the MDIO (Ethernet PHY) API
  4. */
  5. #ifndef __LINUX_FWNODE_MDIO_H
  6. #define __LINUX_FWNODE_MDIO_H
  7. #include <linux/phy.h>
  8. #if IS_ENABLED(CONFIG_FWNODE_MDIO)
  9. int fwnode_mdiobus_phy_device_register(struct mii_bus *mdio,
  10. struct phy_device *phy,
  11. struct fwnode_handle *child, u32 addr);
  12. int fwnode_mdiobus_register_phy(struct mii_bus *bus,
  13. struct fwnode_handle *child, u32 addr);
  14. #else /* CONFIG_FWNODE_MDIO */
  15. int fwnode_mdiobus_phy_device_register(struct mii_bus *mdio,
  16. struct phy_device *phy,
  17. struct fwnode_handle *child, u32 addr)
  18. {
  19. return -EINVAL;
  20. }
  21. static inline int fwnode_mdiobus_register_phy(struct mii_bus *bus,
  22. struct fwnode_handle *child,
  23. u32 addr)
  24. {
  25. return -EINVAL;
  26. }
  27. #endif
  28. #endif /* __LINUX_FWNODE_MDIO_H */