Commit f08ae685 authored by Felipe Balbi's avatar Felipe Balbi Committed by Greg Kroah-Hartman

usb: dwc3: host: pass quirk-broken-port-ped property for known broken revisions

[ Upstream commit e42a5dbb ]

dwc3 revisions <=3.00a have a limitation where Port Disable command
doesn't work. Set the quirk-broken-port-ped property for such
controllers so XHCI core can do the necessary workaround.

[rogerq@ti.com] Updated code from platform data to device property.
Signed-off-by: default avatarRoger Quadros <rogerq@ti.com>
Signed-off-by: default avatarFelipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: default avatarSasha Levin <alexander.levin@verizon.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 41d6d975
...@@ -54,11 +54,12 @@ static int dwc3_host_get_irq(struct dwc3 *dwc) ...@@ -54,11 +54,12 @@ static int dwc3_host_get_irq(struct dwc3 *dwc)
int dwc3_host_init(struct dwc3 *dwc) int dwc3_host_init(struct dwc3 *dwc)
{ {
struct property_entry props[2]; struct property_entry props[3];
struct platform_device *xhci; struct platform_device *xhci;
int ret, irq; int ret, irq;
struct resource *res; struct resource *res;
struct platform_device *dwc3_pdev = to_platform_device(dwc->dev); struct platform_device *dwc3_pdev = to_platform_device(dwc->dev);
int prop_idx = 0;
irq = dwc3_host_get_irq(dwc); irq = dwc3_host_get_irq(dwc);
if (irq < 0) if (irq < 0)
...@@ -97,8 +98,22 @@ int dwc3_host_init(struct dwc3 *dwc) ...@@ -97,8 +98,22 @@ int dwc3_host_init(struct dwc3 *dwc)
memset(props, 0, sizeof(struct property_entry) * ARRAY_SIZE(props)); memset(props, 0, sizeof(struct property_entry) * ARRAY_SIZE(props));
if (dwc->usb3_lpm_capable) { if (dwc->usb3_lpm_capable)
props[0].name = "usb3-lpm-capable"; props[prop_idx++].name = "usb3-lpm-capable";
/**
* WORKAROUND: dwc3 revisions <=3.00a have a limitation
* where Port Disable command doesn't work.
*
* The suggested workaround is that we avoid Port Disable
* completely.
*
* This following flag tells XHCI to do just that.
*/
if (dwc->revision <= DWC3_REVISION_300A)
props[prop_idx++].name = "quirk-broken-port-ped";
if (prop_idx) {
ret = platform_device_add_properties(xhci, props); ret = platform_device_add_properties(xhci, props);
if (ret) { if (ret) {
dev_err(dwc->dev, "failed to add properties to xHCI\n"); dev_err(dwc->dev, "failed to add properties to xHCI\n");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment