mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] mdio_bus: Configure pinctrl for phy devices
@ 2022-08-30 13:38 Sascha Hauer
  0 siblings, 0 replies; only message in thread
From: Sascha Hauer @ 2022-08-30 13:38 UTC (permalink / raw)
  To: Barebox List

Some phys registered from devicetree have pinctrl settings attached to
them. Configure the pinctrl state to make sure they can be accessed
before trying to reset and detect the phy devices.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 drivers/net/phy/mdio_bus.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/phy/mdio_bus.c b/drivers/net/phy/mdio_bus.c
index 99d23ffedf..e37ab79f3e 100644
--- a/drivers/net/phy/mdio_bus.c
+++ b/drivers/net/phy/mdio_bus.c
@@ -22,6 +22,7 @@
 #include <linux/phy.h>
 #include <linux/err.h>
 #include <of_device.h>
+#include <pinctrl.h>
 
 #define DEFAULT_GPIO_RESET_ASSERT       1000      /* us */
 #define DEFAULT_GPIO_RESET_DEASSERT     1000      /* us */
@@ -202,6 +203,7 @@ static int of_mdiobus_register(struct mii_bus *mdio, struct device_node *np)
 			continue;
 		}
 
+		of_pinctrl_select_state_default(child);
 		of_mdiobus_reset_phy(mdio, child);
 		of_mdiobus_register_phy(mdio, child, addr);
 	}
-- 
2.30.2




^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-08-30 13:40 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-30 13:38 [PATCH] mdio_bus: Configure pinctrl for phy devices Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox