usb: dwc3: add dis_del_phy_power_chg_quirk
authorJagan Teki <jagan@amarulasolutions.com>
Wed, 6 May 2020 07:50:25 +0000 (13:20 +0530)
committerMarek Vasut <marek.vasut+renesas@gmail.com>
Tue, 12 May 2020 07:27:14 +0000 (09:27 +0200)
Add a quirk to clear the GUSB3PIPECTL.DELAYP1TRANS bit,
which specifies whether disable delay PHY power change
from P0 to P1/P2/P3 when link state changing from U0
to U1/U2/U3 respectively.

Reference from below Linux commit,

commit <00fe081dc3a3> ("usb: dwc3: add dis_del_phy_power_chg_quirk")

Cc: Marek Vasut <marex@denx.de>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
drivers/usb/dwc3/core.c
drivers/usb/dwc3/core.h
include/dwc3-uboot.h

index a8982bdc0946285c7cd7f2b74c00cd386910665f..0972e458eb02e2c027de88d009e619f1c190b114 100644 (file)
@@ -377,6 +377,9 @@ static void dwc3_phy_setup(struct dwc3 *dwc)
        if (dwc->dis_u3_susphy_quirk)
                reg &= ~DWC3_GUSB3PIPECTL_SUSPHY;
 
+       if (dwc->dis_del_phy_power_chg_quirk)
+               reg &= ~DWC3_GUSB3PIPECTL_DEPOCHANGE;
+
        dwc3_writel(dwc->regs, DWC3_GUSB3PIPECTL(0), reg);
 
        mdelay(100);
@@ -715,6 +718,7 @@ int dwc3_uboot_init(struct dwc3_device *dwc3_dev)
        dwc->rx_detect_poll_quirk = dwc3_dev->rx_detect_poll_quirk;
        dwc->dis_u3_susphy_quirk = dwc3_dev->dis_u3_susphy_quirk;
        dwc->dis_u2_susphy_quirk = dwc3_dev->dis_u2_susphy_quirk;
+       dwc->dis_del_phy_power_chg_quirk = dwc3_dev->dis_del_phy_power_chg_quirk;
 
        dwc->tx_de_emphasis_quirk = dwc3_dev->tx_de_emphasis_quirk;
        if (dwc3_dev->tx_de_emphasis)
@@ -920,6 +924,8 @@ void dwc3_of_parse(struct dwc3 *dwc)
                                "snps,dis_u3_susphy_quirk");
        dwc->dis_u2_susphy_quirk = dev_read_bool(dev,
                                "snps,dis_u2_susphy_quirk");
+       dwc->dis_del_phy_power_chg_quirk = dev_read_bool(dev,
+                               "snps,dis-del-phy-power-chg-quirk");
        dwc->tx_de_emphasis_quirk = dev_read_bool(dev,
                                "snps,tx_de_emphasis_quirk");
        tmp = dev_read_u8_array_ptr(dev, "snps,tx_de_emphasis", 1);
index 1c08a2c5b6e6b87e444f648d5247a8d4f23b2c0a..7f45a9c459794c616fb6c853f9ee2032cf54ae0a 100644 (file)
@@ -821,6 +821,7 @@ struct dwc3 {
        unsigned                rx_detect_poll_quirk:1;
        unsigned                dis_u3_susphy_quirk:1;
        unsigned                dis_u2_susphy_quirk:1;
+       unsigned                dis_del_phy_power_chg_quirk:1;
 
        unsigned                tx_de_emphasis_quirk:1;
        unsigned                tx_de_emphasis:2;
index ce835fd1b2b11ec7fe018d9b2081ba8d8c04480a..ecae34bf0697732caa40b83d5602d9844853ae6a 100644 (file)
@@ -33,6 +33,7 @@ struct dwc3_device {
        unsigned rx_detect_poll_quirk;
        unsigned dis_u3_susphy_quirk;
        unsigned dis_u2_susphy_quirk;
+       unsigned dis_del_phy_power_chg_quirk;
        unsigned tx_de_emphasis_quirk;
        unsigned tx_de_emphasis;
        int index;