summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpatrick <patrick@openbsd.org>2019-05-10 18:20:41 +0000
committerpatrick <patrick@openbsd.org>2019-05-10 18:20:41 +0000
commit7eb94eddaa0cba936cdebb82274aa8e7f2bc7755 (patch)
tree760243c12e002790588df27e11abd57ae27e55a1
parentremove receive_vm prototype for the function does not exist (anymore) (diff)
downloadwireguard-openbsd-7eb94eddaa0cba936cdebb82274aa8e7f2bc7755.tar.xz
wireguard-openbsd-7eb94eddaa0cba936cdebb82274aa8e7f2bc7755.zip
Add a fallback to ehci(4)'s phy init code so that when there
is no compatible phy it tries to enable the VBus using the phy-supply property. Makes the USB ports on the RockPro64 work. ok kettenis@
-rw-r--r--sys/dev/fdt/ehci_fdt.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/dev/fdt/ehci_fdt.c b/sys/dev/fdt/ehci_fdt.c
index aea7386c211..9a5b69ccf99 100644
--- a/sys/dev/fdt/ehci_fdt.c
+++ b/sys/dev/fdt/ehci_fdt.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ehci_fdt.c,v 1.4 2018/08/06 10:52:30 patrick Exp $ */
+/* $OpenBSD: ehci_fdt.c,v 1.5 2019/05/10 18:20:41 patrick Exp $ */
/*
* Copyright (c) 2005 David Gwynne <dlg@openbsd.org>
@@ -195,6 +195,7 @@ ehci_next_phy(uint32_t *cells)
void
ehci_init_phy(struct ehci_fdt_softc *sc, uint32_t *cells)
{
+ uint32_t phy_supply;
int node;
int i;
@@ -208,6 +209,10 @@ ehci_init_phy(struct ehci_fdt_softc *sc, uint32_t *cells)
return;
}
}
+
+ phy_supply = OF_getpropint(node, "phy-supply", 0);
+ if (phy_supply)
+ regulator_enable(phy_supply);
}
void