mirror of
https://github.com/lkl/linux.git
synced 2025-12-19 16:13:19 +09:00
net: mdiobus: Introduce fwnode_mdiobus_register_phy()
Introduce fwnode_mdiobus_register_phy() to register PHYs on the mdiobus. From the compatible string, identify whether the PHY is c45 and based on this create a PHY device instance which is registered on the mdiobus. Along with fwnode_mdiobus_register_phy() also introduce fwnode_find_mii_timestamper() and fwnode_mdiobus_phy_device_register() since they are needed. While at it, also use the newly introduced fwnode operation in of_mdiobus_phy_device_register(). Signed-off-by: Calvin Johnson <calvin.johnson@oss.nxp.com> Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com> Acked-by: Grant Likely <grant.likely@arm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
b9926da003
commit
bc1bee3b87
35
include/linux/fwnode_mdio.h
Normal file
35
include/linux/fwnode_mdio.h
Normal file
@@ -0,0 +1,35 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
/*
|
||||
* FWNODE helper for the MDIO (Ethernet PHY) API
|
||||
*/
|
||||
|
||||
#ifndef __LINUX_FWNODE_MDIO_H
|
||||
#define __LINUX_FWNODE_MDIO_H
|
||||
|
||||
#include <linux/phy.h>
|
||||
|
||||
#if IS_ENABLED(CONFIG_FWNODE_MDIO)
|
||||
int fwnode_mdiobus_phy_device_register(struct mii_bus *mdio,
|
||||
struct phy_device *phy,
|
||||
struct fwnode_handle *child, u32 addr);
|
||||
|
||||
int fwnode_mdiobus_register_phy(struct mii_bus *bus,
|
||||
struct fwnode_handle *child, u32 addr);
|
||||
|
||||
#else /* CONFIG_FWNODE_MDIO */
|
||||
int fwnode_mdiobus_phy_device_register(struct mii_bus *mdio,
|
||||
struct phy_device *phy,
|
||||
struct fwnode_handle *child, u32 addr)
|
||||
{
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
static inline int fwnode_mdiobus_register_phy(struct mii_bus *bus,
|
||||
struct fwnode_handle *child,
|
||||
u32 addr)
|
||||
{
|
||||
return -EINVAL;
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __LINUX_FWNODE_MDIO_H */
|
||||
Reference in New Issue
Block a user