Message ID | 20231127104045.96722-2-ramon.nordin.rodriguez@ferroamp.se (mailing list archive) |
---|---|
State | Changes Requested |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | net: microchip_t1s: additional phy support and collision detect handling | expand |
On Mon, Nov 27, 2023 at 11:40:43AM +0100, Ramón N.Rodriguez wrote: > From: Ramón Nordin Rodriguez <ramon.nordin.rodriguez@ferroamp.se> > > This commit moves the reset functionality for lan867x from the revb1 > init function to a separate function. The intention with this minor > refactor is to prepare for adding support for lan867x rev C1. > > Signed-off-by: Ramón Nordin Rodriguez <ramon.nordin.rodriguez@ferroamp.se> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Andrew
diff --git a/drivers/net/phy/microchip_t1s.c b/drivers/net/phy/microchip_t1s.c index 534ca7d1b061..ace2bf35a18a 100644 --- a/drivers/net/phy/microchip_t1s.c +++ b/drivers/net/phy/microchip_t1s.c @@ -213,7 +213,7 @@ static int lan865x_revb0_config_init(struct phy_device *phydev) return lan865x_setup_cfgparam(phydev); } -static int lan867x_revb1_config_init(struct phy_device *phydev) +static int lan867x_wait_for_reset_complete(struct phy_device *phydev) { int err; @@ -234,6 +234,16 @@ static int lan867x_revb1_config_init(struct phy_device *phydev) return -ENODEV; } } + return 0; +} + +static int lan867x_revb1_config_init(struct phy_device *phydev) +{ + int err; + + err = lan867x_wait_for_reset_complete(phydev); + if (err) + return err; /* Reference to AN1699 * https://ww1.microchip.com/downloads/aemDocuments/documents/AIS/ProductDocuments/SupportingCollateral/AN-LAN8670-1-2-config-60001699.pdf