usb: amend ehci no-relinquish-port for rk3288 platform

For the hardware bug of RK3288 OHCI, we use commit cfe6f1dd57
("usb: ehci: add rockchip relinquishing port quirk support") to fix
it previously. However, it have been ineffective after upstream commit
94c43b9897 ("USB: Check for dropped connection before switching to
full speed") was merged due to the condition of relinquishing port was
changed.

This patch adds an additional condition for the previous commit to ensure
no relinquish port quirk can take effect for RK3288 EHCI.

Change-Id: I0630265e101afb349816955e069e1c121745ac08
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
This commit is contained in:
Frank Wang 2018-01-22 15:02:49 +08:00 committed by Tao Huang
parent 2815b3d1d9
commit a03c5f1ef5
3 changed files with 6 additions and 2 deletions

View File

@ -5091,7 +5091,8 @@ static void hub_port_connect(struct usb_hub *hub, int port1, u16 portstatus,
done:
hub_port_disable(hub, port1, 1);
if (hcd->driver->relinquish_port && !hub->hdev->parent) {
if (status != -ENOTCONN && status != -ENODEV)
if ((status != -ENOTCONN && status != -ENODEV) ||
(status == -ENOTCONN && hcd->rk3288_relinquish_port_quirk))
hcd->driver->relinquish_port(hcd, port1);
}
}

View File

@ -192,9 +192,11 @@ static int ehci_platform_probe(struct platform_device *dev)
if (of_machine_is_compatible("rockchip,rk3288") &&
of_property_read_bool(dev->dev.of_node,
"rockchip-relinquish-port"))
"rockchip-relinquish-port")) {
ehci_platform_hc_driver.relinquish_port =
ehci_rockchip_relinquish_port;
hcd->rk3288_relinquish_port_quirk = 1;
}
for (clk = 0; clk < EHCI_MAX_CLKS; clk++) {
priv->clks[clk] = of_clk_get(dev->dev.of_node, clk);

View File

@ -167,6 +167,7 @@ struct usb_hcd {
unsigned tpl_support:1; /* OTG & EH TPL support */
unsigned cant_recv_wakeups:1;
/* wakeup requests from downstream aren't received */
unsigned rk3288_relinquish_port_quirk:1;
unsigned int irq; /* irq allocated */
void __iomem *regs; /* device memory/io */