From cdb0e82ceb238b4011f8f2a538fa837e0fffca08 Mon Sep 17 00:00:00 2001 From: kettenis Date: Thu, 9 Apr 2026 15:13:45 +0000 Subject: [PATCH] Enable Vbus regulator if there is one Needed on the Banana Pi F3 to power USB devices. ok jsing@ --- sys/dev/fdt/xhci_fdt.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/sys/dev/fdt/xhci_fdt.c b/sys/dev/fdt/xhci_fdt.c index ffbb27cf0ce..ab4bea73d33 100644 --- a/sys/dev/fdt/xhci_fdt.c +++ b/sys/dev/fdt/xhci_fdt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: xhci_fdt.c,v 1.28 2026/04/08 13:43:32 kettenis Exp $ */ +/* $OpenBSD: xhci_fdt.c,v 1.29 2026/04/09 15:13:45 kettenis Exp $ */ /* * Copyright (c) 2017 Mark Kettenis * @@ -89,6 +89,7 @@ xhci_fdt_attach(struct device *parent, struct device *self, void *aux) { struct xhci_fdt_softc *sc = (struct xhci_fdt_softc *)self; struct fdt_attach_args *faa = aux; + uint32_t vbus_supply; int error = 0; int idx; @@ -157,6 +158,10 @@ xhci_fdt_attach(struct device *parent, struct device *self, void *aux) goto disestablish_ret; } + vbus_supply = OF_getpropint(sc->sc_node, "vbus-supply", 0); + if (vbus_supply) + regulator_enable(vbus_supply); + xhci_init_phys(sc); xhci_init_hubs(sc); @@ -593,7 +598,8 @@ void imx8mp_usb_init(struct xhci_fdt_softc *sc, uint32_t *cells) { uint32_t phy_reg[2], reg; - int node, vbus_supply; + uint32_t vbus_supply; + int node; node = OF_getnodebyphandle(cells[0]); KASSERT(node != 0); @@ -649,7 +655,8 @@ void imx8mq_usb_init(struct xhci_fdt_softc *sc, uint32_t *cells) { uint32_t phy_reg[2], reg; - int node, vbus_supply; + uint32_t vbus_supply; + int node; node = OF_getnodebyphandle(cells[0]); KASSERT(node != 0);