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 <marek.vasut+renesas@mailbox.org>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
diff --git a/drivers/net/eth-phy-uclass.c b/drivers/net/eth-phy-uclass.c
index 231bad6..9d1e8d3 100644
--- a/drivers/net/eth-phy-uclass.c
+++ b/drivers/net/eth-phy-uclass.c
@@ -144,6 +144,14 @@
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;
}