net: phy: Factor out PHY GPIO reset code

Pull the PHY GPIO reset code into separate function, since
this is and will be reused multiple times. Set up default
reset assert and deassert timing to generous 20ms and 1ms
for maximum compatibility in case those DT properties are
missing.

Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
This commit is contained in:
Marek Vasut
2024-03-18 15:57:01 +01:00
committed by Tom Rini
parent 85d44e424a
commit e99a6efa80
3 changed files with 69 additions and 32 deletions

View File

@@ -183,6 +183,15 @@ struct fixed_link {
*/
int phy_reset(struct phy_device *phydev);
/**
* phy_gpio_reset() - Resets the specified PHY using GPIO reset
* Toggles the optional PHY reset GPIO
*
* @dev: PHY udevice to reset
* @return: 0 if OK, -ve on error
*/
int phy_gpio_reset(struct udevice *dev);
/**
* phy_find_by_mask() - Searches for a PHY on the specified MDIO bus
* The function checks the PHY addresses flagged in phy_mask and returns a