mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-30 08:07:59 +00:00
net: phy: Port set/clear bits from Linux
To simply porting phy drivers from Linux to U-Boot, define phy_set_bits() and phy_clear_bits() functions with a similar API to those used in Linux. The U-Boot versions of these functions include the `devad` argument which is not present in the Linux versions, to keep them aligned with the other phy functions in U-Boot. Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org> Signed-off-by: Paul Barker <paul.barker.ct@bp.renesas.com>
This commit is contained in:
parent
667ab63f93
commit
985dc81a1d
1 changed files with 24 additions and 0 deletions
|
@ -333,6 +333,30 @@ int gen10g_startup(struct phy_device *phydev);
|
||||||
int gen10g_shutdown(struct phy_device *phydev);
|
int gen10g_shutdown(struct phy_device *phydev);
|
||||||
int gen10g_discover_mmds(struct phy_device *phydev);
|
int gen10g_discover_mmds(struct phy_device *phydev);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* phy_set_bits - Convenience function for setting bits in a PHY register
|
||||||
|
* @phydev: the phy_device struct
|
||||||
|
* @devad: The MMD to read from
|
||||||
|
* @regnum: register number to write
|
||||||
|
* @val: bits to set
|
||||||
|
*/
|
||||||
|
static inline int phy_set_bits(struct phy_device *phydev, int devad, u32 regnum, u16 val)
|
||||||
|
{
|
||||||
|
return phy_modify(phydev, devad, regnum, 0, val);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* phy_clear_bits - Convenience function for clearing bits in a PHY register
|
||||||
|
* @phydev: the phy_device struct
|
||||||
|
* @devad: The MMD to write to
|
||||||
|
* @regnum: register number to write
|
||||||
|
* @val: bits to clear
|
||||||
|
*/
|
||||||
|
static inline int phy_clear_bits(struct phy_device *phydev, int devad, u32 regnum, u16 val)
|
||||||
|
{
|
||||||
|
return phy_modify(phydev, devad, regnum, val, 0);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* U_BOOT_PHY_DRIVER() - Declare a new U-Boot driver
|
* U_BOOT_PHY_DRIVER() - Declare a new U-Boot driver
|
||||||
* @__name: name of the driver
|
* @__name: name of the driver
|
||||||
|
|
Loading…
Add table
Reference in a new issue