diff options
author | Tom Rini <trini@konsulko.com> | 2022-04-13 08:00:11 -0400 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2022-04-13 08:00:11 -0400 |
commit | 2ddf84679df65ba156782ceb75b44696f2cbb3e6 (patch) | |
tree | 7a736235da332086c458da9c20bd88cb1ce45a8e /drivers/net/phy/phy.c | |
parent | b2a22b2c9f07e4c78108feb3bc16e18ebd88388a (diff) | |
parent | a1c711046b0d5478a702b27c6773ea6231eba057 (diff) |
Merge tag 'u-boot-imx-20220413' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx
u-boot-imx-20220413
i.MX patches for 2022.07
CI: https://source.denx.de/u-boot/custodians/u-boot-imx/-/pipelines/11710
Diffstat (limited to 'drivers/net/phy/phy.c')
-rw-r--r-- | drivers/net/phy/phy.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c index d4731860f73..36722620f0c 100644 --- a/drivers/net/phy/phy.c +++ b/drivers/net/phy/phy.c @@ -530,6 +530,9 @@ int phy_init(void) phy_natsemi_init(); #endif #ifdef CONFIG_NXP_C45_TJA11XX_PHY + phy_nxp_c45_tja11xx_init(); +#endif +#ifdef CONFIG_PHY_NXP_TJA11XX phy_nxp_tja11xx_init(); #endif #ifdef CONFIG_PHY_REALTEK @@ -1110,3 +1113,23 @@ int phy_get_interface_by_name(const char *str) return -1; } + +/** + * phy_modify - Convenience function for modifying a given PHY register + * @phydev: the phy_device struct + * @devad: The MMD to read from + * @regnum: register number to write + * @mask: bit mask of bits to clear + * @set: new value of bits set in mask to write to @regnum + */ +int phy_modify(struct phy_device *phydev, int devad, int regnum, u16 mask, + u16 set) +{ + int ret; + + ret = phy_read(phydev, devad, regnum); + if (ret < 0) + return ret; + + return phy_write(phydev, devad, regnum, (ret & ~mask) | set); +} |