usb: dwc3: add dis_u3_autosuspend_quirk
authorWilliam Wu <wulf@rock-chips.com>
Tue, 21 Feb 2017 08:58:22 +0000 (16:58 +0800)
committerHuang, Tao <huangtao@rock-chips.com>
Wed, 22 Feb 2017 06:16:55 +0000 (14:16 +0800)
Some xHCI controllers (e.g. Rockchip rk3328 SoC) integrated
in DWC3 IP, don't support USB 3.0 autosuspend well, so we
need to disable USB 3.0 HUB autosuspend function with a quirk.

Change-Id: I72d93837496f875dbcbb16818aa3690017cc1085
Signed-off-by: William Wu <wulf@rock-chips.com>
Documentation/devicetree/bindings/usb/dwc3.txt
drivers/usb/dwc3/core.c
drivers/usb/dwc3/core.h
drivers/usb/dwc3/host.c

index 0099e2fbed0110c673a0b76bb6027ad276396625..6c376308ac5a2fc6506ffb0371858d58bc08302d 100644 (file)
@@ -33,6 +33,8 @@ Optional properties:
  - snps,tx_de_emphasis_quirk: when set core will set Tx de-emphasis value.
  - snps,tx_de_emphasis: the value driven to the PHY is controlled by the
                        LTSSM during USB3 Compliance mode.
+ - snps,dis-u3-autosuspend-quirk: when set USB core driver will disable
+                       USB3 autosuspend function.
  - snps,dis_u3_susphy_quirk: when set core will disable USB3 suspend phy.
  - snps,dis_u2_susphy_quirk: when set core will disable USB2 suspend phy.
  - snps,dis_enblslpm_quirk: when set clears the enblslpm in GUSB2PHYCFG,
index 00eb077e9b51f4e4903608718c767f8e024177b0..db5f8e056d293c30cf73f5b20f3885e1b8ff7953 100644 (file)
@@ -967,6 +967,8 @@ static int dwc3_probe(struct platform_device *pdev)
                                "snps,lfps_filter_quirk");
        dwc->rx_detect_poll_quirk = device_property_read_bool(dev,
                                "snps,rx_detect_poll_quirk");
+       dwc->dis_u3_autosuspend_quirk = device_property_read_bool(dev,
+                               "snps,dis-u3-autosuspend-quirk");
        dwc->dis_u3_susphy_quirk = device_property_read_bool(dev,
                                "snps,dis_u3_susphy_quirk");
        dwc->dis_u2_susphy_quirk = device_property_read_bool(dev,
index d11303373a9ba08b9d9e63db3baf59cb5a458aeb..dff3aed23689e10d5a0b2e467100279a269c7d57 100644 (file)
@@ -804,6 +804,7 @@ struct dwc3_scratchpad_array {
  * @del_phy_power_chg_quirk: set if we enable delay phy power change quirk
  * @lfps_filter_quirk: set if we enable LFPS filter quirk
  * @rx_detect_poll_quirk: set if we enable rx_detect to polling lfps quirk
+ * @dis_u3_autosuspend_quirk: set if the we disable usb3 autosuspend
  * @dis_u3_susphy_quirk: set if we disable usb3 suspend phy
  * @dis_u2_susphy_quirk: set if we disable usb2 suspend phy
  * @dis_enblslpm_quirk: set if we clear enblslpm in GUSB2PHYCFG,
@@ -956,6 +957,7 @@ struct dwc3 {
        unsigned                del_phy_power_chg_quirk:1;
        unsigned                lfps_filter_quirk:1;
        unsigned                rx_detect_poll_quirk:1;
+       unsigned                dis_u3_autosuspend_quirk:1;
        unsigned                dis_u3_susphy_quirk:1;
        unsigned                dis_u2_susphy_quirk:1;
        unsigned                dis_enblslpm_quirk:1;
index 971d95163ce6fa9f375b34a0658863b76f2a575f..489ab425e177a431ada294c2e47d85f78ed83f3d 100644 (file)
@@ -91,6 +91,7 @@ int dwc3_host_init(struct dwc3 *dwc)
 
        memset(&pdata, 0, sizeof(pdata));
 
+       pdata.usb3_disable_autosuspend = dwc->dis_u3_autosuspend_quirk;
        pdata.usb3_lpm_capable = dwc->usb3_lpm_capable;
        pdata.xhci_slow_suspend = dwc->xhci_slow_suspend_quirk;