Page MenuHomeFreeBSD

D60803.1795663920.diff
No OneTemporary

Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None

D60803.1795663920.diff

diff --git a/sys/arm/allwinner/aw_usbphy.c b/sys/arm/allwinner/aw_usbphy.c
--- a/sys/arm/allwinner/aw_usbphy.c
+++ b/sys/arm/allwinner/aw_usbphy.c
@@ -354,6 +354,7 @@
intptr_t phy;
struct awusbphy_softc *sc;
regulator_t reg;
+ char pname[20];
int error, vbus_det;
dev = phynode_get_device(phynode);
@@ -366,10 +367,21 @@
/* Configure PHY */
awusbphy_configure(dev, phy);
- /* Regulators are optional. If not found, return success. */
+ /*
+ * Regulators are optional. If not found, return success.
+ *
+ * The lookup in awusbphy_init() fails when the supply comes from a
+ * PMIC that attaches after us in the same bus pass (e.g. AXP803
+ * ldo_io0 on the PineTab), so retry here: we are called from the
+ * host controller's attach, by which time the PMIC is up.
+ */
reg = sc->reg[phy];
- if (reg == NULL)
- return (0);
+ if (reg == NULL) {
+ snprintf(pname, sizeof(pname), "usb%d_vbus-supply", (int)phy);
+ if (regulator_get_by_ofw_property(dev, 0, pname, &reg) != 0)
+ return (0);
+ sc->reg[phy] = reg;
+ }
if (phy == 0) {
/* If an external vbus is detected, do not enable phy 0 */

File Metadata

Mime Type
text/plain
Expires
Thu, Nov 26, 3:32 AM (13 h, 50 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
40992250
Default Alt Text
D60803.1795663920.diff (1 KB)

Event Timeline