usb: dwc3: support option to disable usb3 host autosuspend

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: I33d4d2ec86102653bfb043eed12bfb6b5b426823
Signed-off-by: William Wu <william.wu@rock-chips.com>
This commit is contained in:
William Wu
2019-11-04 11:19:06 +08:00
parent fbc2bf3242
commit 1b69499a30
3 changed files with 7 additions and 1 deletions

View File

@@ -1296,6 +1296,8 @@ static void dwc3_get_properties(struct dwc3 *dwc)
"snps,xhci-slow-suspend-quirk");
dwc->xhci_trb_ent_quirk = device_property_read_bool(dev,
"snps,xhci-trb-ent-quirk");
dwc->dis_u3_autosuspend_quirk = device_property_read_bool(dev,
"snps,dis-u3-autosuspend-quirk");
dwc->tx_de_emphasis_quirk = device_property_read_bool(dev,
"snps,tx_de_emphasis_quirk");

View File

@@ -1029,6 +1029,7 @@ struct dwc3_scratchpad_array {
* @xhci_trb_ent_quirk: set if need to enable the Evaluate Next TRB(ENT)
flag in the TRB data structure to force xHC to
pre-fetch the next TRB of a TD.
* @dis_u3_autosuspend_quirk: set if the we want to disable usb3 autosuspend
* @tx_de_emphasis_quirk: set if we enable Tx de-emphasis quirk
* @tx_de_emphasis: Tx de-emphasis value
* 0 - -6dB de-emphasis
@@ -1219,6 +1220,7 @@ struct dwc3 {
unsigned dis_tx_ipgap_linecheck_quirk:1;
unsigned xhci_slow_suspend_quirk:1;
unsigned xhci_trb_ent_quirk:1;
unsigned dis_u3_autosuspend_quirk:1;
unsigned tx_de_emphasis_quirk:1;
unsigned tx_de_emphasis:2;

View File

@@ -46,7 +46,7 @@ out:
int dwc3_host_init(struct dwc3 *dwc)
{
struct property_entry props[5];
struct property_entry props[6];
struct platform_device *xhci;
int ret, irq;
struct resource *res;
@@ -102,6 +102,8 @@ int dwc3_host_init(struct dwc3 *dwc)
if (dwc->usb2_lpm_disable)
props[prop_idx++].name = "usb2-lpm-disable";
if (dwc->dis_u3_autosuspend_quirk)
props[prop_idx++].name = "usb3-dis-autosuspend";
/**
* WORKAROUND: dwc3 revisions <=3.00a have a limitation
* where Port Disable command doesn't work.