summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorPatrick Wildt <patrick@cvs.openbsd.org>2019-05-10 18:20:42 +0000
committerPatrick Wildt <patrick@cvs.openbsd.org>2019-05-10 18:20:42 +0000
commit511840e205792b2232a8246a5a339046021b83be (patch)
tree4864c0df10b7408f4ea61135e0ba55dfefafe80d /sys/dev
parent8ae65be26753740d67414faaf6f8403a18dc9383 (diff)
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@
Diffstat (limited to 'sys/dev')
-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