[PATCH 10/14] net: phy: Handle reset-delay-us/reset-post-delay-us properties
These two properties are used by various DTs in place of current reset-assert-us/reset-deassert-us , handle both . Signed-off-by: Marek Vasut --- Cc: Geert Uytterhoeven Cc: Joe Hershberger Cc: Michal Simek Cc: Nishanth Menon Cc: Ramon Fried --- drivers/net/eth-phy-uclass.c | 8 1 file changed, 8 insertions(+) diff --git a/drivers/net/eth-phy-uclass.c b/drivers/net/eth-phy-uclass.c index 231bad66514..9d1e8d38ffa 100644 --- a/drivers/net/eth-phy-uclass.c +++ b/drivers/net/eth-phy-uclass.c @@ -144,6 +144,14 @@ static int eth_phy_of_to_plat(struct udevice *dev) uc_priv->reset_assert_delay = dev_read_u32_default(dev, "reset-assert-us", 0); uc_priv->reset_deassert_delay = dev_read_u32_default(dev, "reset-deassert-us", 0); + /* These are used by some DTs, try these as a fallback. */ + if (!uc_priv->reset_assert_delay && !uc_priv->reset_deassert_delay) { + uc_priv->reset_assert_delay = + dev_read_u32_default(dev, "reset-delay-us", 0); + uc_priv->reset_deassert_delay = + dev_read_u32_default(dev, "reset-post-delay-us", 0); + } + return 0; } -- 2.39.2
Re: [PATCH 10/14] net: phy: Handle reset-delay-us/reset-post-delay-us properties
On Wed, May 31, 2023 at 1:51 AM Marek Vasut wrote: > > These two properties are used by various DTs in place of > current reset-assert-us/reset-deassert-us , handle both . > > Signed-off-by: Marek Vasut > --- > Cc: Geert Uytterhoeven > Cc: Joe Hershberger > Cc: Michal Simek > Cc: Nishanth Menon > Cc: Ramon Fried > --- > drivers/net/eth-phy-uclass.c | 8 > 1 file changed, 8 insertions(+) > > diff --git a/drivers/net/eth-phy-uclass.c b/drivers/net/eth-phy-uclass.c > index 231bad66514..9d1e8d38ffa 100644 > --- a/drivers/net/eth-phy-uclass.c > +++ b/drivers/net/eth-phy-uclass.c > @@ -144,6 +144,14 @@ static int eth_phy_of_to_plat(struct udevice *dev) > uc_priv->reset_assert_delay = dev_read_u32_default(dev, > "reset-assert-us", 0); > uc_priv->reset_deassert_delay = dev_read_u32_default(dev, > "reset-deassert-us", 0); > > + /* These are used by some DTs, try these as a fallback. */ > + if (!uc_priv->reset_assert_delay && !uc_priv->reset_deassert_delay) { > + uc_priv->reset_assert_delay = > + dev_read_u32_default(dev, "reset-delay-us", 0); > + uc_priv->reset_deassert_delay = > + dev_read_u32_default(dev, "reset-post-delay-us", 0); > + } > + > return 0; > } > > -- > 2.39.2 > Reviewed-by: Ramon Fried