usb: dwc3: add delay phy power change quirk
[cascardo/linux.git] / drivers / usb / dwc3 / core.c
index c076514..de6a009 100644 (file)
@@ -383,6 +383,9 @@ static void dwc3_phy_setup(struct dwc3 *dwc)
        if (dwc->del_p1p2p3_quirk)
                reg |= DWC3_GUSB3PIPECTL_DEP1P2P3_EN;
 
+       if (dwc->del_phy_power_chg_quirk)
+               reg |= DWC3_GUSB3PIPECTL_DEPOCHANGE;
+
        dwc3_writel(dwc->regs, DWC3_GUSB3PIPECTL(0), reg);
 
        mdelay(100);
@@ -766,6 +769,8 @@ static int dwc3_probe(struct platform_device *pdev)
                                "snps,req_p1p2p3_quirk");
                dwc->del_p1p2p3_quirk = of_property_read_bool(node,
                                "snps,del_p1p2p3_quirk");
+               dwc->del_phy_power_chg_quirk = of_property_read_bool(node,
+                               "snps,del_phy_power_chg_quirk");
        } else if (pdata) {
                dwc->maximum_speed = pdata->maximum_speed;
                dwc->has_lpm_erratum = pdata->has_lpm_erratum;
@@ -780,6 +785,7 @@ static int dwc3_probe(struct platform_device *pdev)
                dwc->u2ss_inp3_quirk = pdata->u2ss_inp3_quirk;
                dwc->req_p1p2p3_quirk = pdata->req_p1p2p3_quirk;
                dwc->del_p1p2p3_quirk = pdata->del_p1p2p3_quirk;
+               dwc->del_phy_power_chg_quirk = pdata->del_phy_power_chg_quirk;
        }
 
        /* default to superspeed if no maximum_speed passed */