mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] ARM: i.MX6 sabrelite: free USB VBUS GPIO after use
@ 2024-10-01  8:52 Sascha Hauer
  2024-10-01 10:35 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Sascha Hauer @ 2024-10-01  8:52 UTC (permalink / raw)
  To: Barebox List

The sabrelite board code uses a GPIO to enable USB VBUS. The same GPIO
is registered in the device tree as a USB VBUS regulator. This regulator
currently can't probe because the GPIO is busy due to its usage in board
code. Free the GPIO after usage in board code to allow probing the VBUS
regulator.

The board specific code to enable VBUS might not be needed at all
anymore, but I currently do not have the board handy to try out, so
for now just avoid the error messages from failed driver probe.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/boards/freescale-mx6-sabrelite/board.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/arch/arm/boards/freescale-mx6-sabrelite/board.c b/arch/arm/boards/freescale-mx6-sabrelite/board.c
index fe47743540..5982d75e2b 100644
--- a/arch/arm/boards/freescale-mx6-sabrelite/board.c
+++ b/arch/arm/boards/freescale-mx6-sabrelite/board.c
@@ -117,10 +117,16 @@ static int sabrelite_ksz9021rn_setup(void)
 
 static void sabrelite_ehci_init(void)
 {
+	unsigned int vbus_gpio = IMX_GPIO_NR(7, 12);
+
+	gpio_request(vbus_gpio, "usb-vbus");
+
 	/* hub reset */
-	gpio_direction_output(IMX_GPIO_NR(7, 12), 0);
+	gpio_direction_output(vbus_gpio, 0);
 	udelay(2000);
-	gpio_set_value(IMX_GPIO_NR(7, 12), 1);
+	gpio_set_value(vbus_gpio, 1);
+
+	gpio_free(vbus_gpio);
 }
 
 static int sabrelite_probe(struct device *dev)
-- 
2.39.5




^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] ARM: i.MX6 sabrelite: free USB VBUS GPIO after use
  2024-10-01  8:52 [PATCH] ARM: i.MX6 sabrelite: free USB VBUS GPIO after use Sascha Hauer
@ 2024-10-01 10:35 ` Sascha Hauer
  0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2024-10-01 10:35 UTC (permalink / raw)
  To: Barebox List, Sascha Hauer


On Tue, 01 Oct 2024 10:52:13 +0200, Sascha Hauer wrote:
> The sabrelite board code uses a GPIO to enable USB VBUS. The same GPIO
> is registered in the device tree as a USB VBUS regulator. This regulator
> currently can't probe because the GPIO is busy due to its usage in board
> code. Free the GPIO after usage in board code to allow probing the VBUS
> regulator.
> 
> The board specific code to enable VBUS might not be needed at all
> anymore, but I currently do not have the board handy to try out, so
> for now just avoid the error messages from failed driver probe.
> 
> [...]

Applied, thanks!

[1/1] ARM: i.MX6 sabrelite: free USB VBUS GPIO after use
      https://git.pengutronix.de/cgit/barebox/commit/?id=3995dd53d2fe (link may not be stable)

Best regards,
-- 
Sascha Hauer <s.hauer@pengutronix.de>




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-10-01 10:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-10-01  8:52 [PATCH] ARM: i.MX6 sabrelite: free USB VBUS GPIO after use Sascha Hauer
2024-10-01 10:35 ` Sascha Hauer

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