diff --git a/drivers/usb/dwc3/dwc3-meson-g12a.c b/drivers/usb/dwc3/dwc3-meson-g12a.c index 74d07ded8a7e..d2a60e40061d 100644 --- a/drivers/usb/dwc3/dwc3-meson-g12a.c +++ b/drivers/usb/dwc3/dwc3-meson-g12a.c @@ -233,12 +233,19 @@ static int dwc3_meson_g12a_usb2_init(struct dwc3_meson_g12a *priv) priv->otg_phy_mode = PHY_MODE_USB_HOST; for (i = 0; i < priv->drvdata->num_phys; ++i) { + enum phy_mode mode; + if (!priv->phys[i]) continue; if (!strstr(priv->drvdata->phy_names[i], "usb2")) continue; + if (priv->drvdata->otg_switch_supported && i == USB2_OTG_PHY) + mode = priv->otg_phy_mode; + else + mode = PHY_MODE_USB_HOST; + ret = priv->drvdata->usb2_init_phy(priv, i, mode); if (ret) return ret;