When configuring the USB3 phy, try the OFW PHY API first, and if there's
authorpatrick <patrick@openbsd.org>
Tue, 29 Jun 2021 12:46:36 +0000 (12:46 +0000)
committerpatrick <patrick@openbsd.org>
Tue, 29 Jun 2021 12:46:36 +0000 (12:46 +0000)
no matching device, fall back to xhci(4)'s PHY configuration code.

ok kettenis@

sys/dev/fdt/xhci_fdt.c

index 38c976a..fdf76b3 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: xhci_fdt.c,v 1.16 2020/12/18 18:13:17 patrick Exp $   */
+/*     $OpenBSD: xhci_fdt.c,v 1.17 2021/06/29 12:46:36 patrick Exp $   */
 /*
  * Copyright (c) 2017 Mark Kettenis <kettenis@openbsd.org>
  *
@@ -265,6 +265,9 @@ xhci_init_phys(struct xhci_fdt_softc *sc)
        if (idx < 0)
                return;
 
+       if (phy_enable_idx(sc->sc_node, idx) != ENXIO)
+               return;
+
        len = OF_getproplen(sc->sc_node, "phys");
        if (len <= 0)
                return;