diff options
author | Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> | 2017-02-21 05:59:48 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-03-17 00:24:49 -0400 |
commit | d4d75128b8fd727d42c775a16b41634d09409dba (patch) | |
tree | f6e647d082d0e6177c771f644d488352aa7eafd7 | |
parent | 5095cb89c62acc78b4cfaeb9a4072979d010510a (diff) |
usb: host: ehci-platform: fix usb 1.1 device is not connected in system resume
This patch fixes an issue that a usb 1.1 device is not connected in
system resume and then the following message appeared if debug messages
are enabled:
usb 2-1: Waited 2000ms for CONNECT
To resolve this issue, the EHCI controller must be resumed after its
companion controllers. So, this patch adds such code on the driver.
Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/usb/host/ehci-platform.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/usb/host/ehci-platform.c b/drivers/usb/host/ehci-platform.c index a268d9e8d6cf..3214300396a0 100644 --- a/drivers/usb/host/ehci-platform.c +++ b/drivers/usb/host/ehci-platform.c | |||
@@ -34,6 +34,7 @@ | |||
34 | #include <linux/usb.h> | 34 | #include <linux/usb.h> |
35 | #include <linux/usb/hcd.h> | 35 | #include <linux/usb/hcd.h> |
36 | #include <linux/usb/ehci_pdriver.h> | 36 | #include <linux/usb/ehci_pdriver.h> |
37 | #include <linux/usb/of.h> | ||
37 | 38 | ||
38 | #include "ehci.h" | 39 | #include "ehci.h" |
39 | 40 | ||
@@ -297,6 +298,7 @@ static int ehci_platform_probe(struct platform_device *dev) | |||
297 | goto err_power; | 298 | goto err_power; |
298 | 299 | ||
299 | device_wakeup_enable(hcd->self.controller); | 300 | device_wakeup_enable(hcd->self.controller); |
301 | device_enable_async_suspend(hcd->self.controller); | ||
300 | platform_set_drvdata(dev, hcd); | 302 | platform_set_drvdata(dev, hcd); |
301 | 303 | ||
302 | return err; | 304 | return err; |
@@ -370,6 +372,7 @@ static int ehci_platform_resume(struct device *dev) | |||
370 | struct usb_ehci_pdata *pdata = dev_get_platdata(dev); | 372 | struct usb_ehci_pdata *pdata = dev_get_platdata(dev); |
371 | struct platform_device *pdev = to_platform_device(dev); | 373 | struct platform_device *pdev = to_platform_device(dev); |
372 | struct ehci_platform_priv *priv = hcd_to_ehci_priv(hcd); | 374 | struct ehci_platform_priv *priv = hcd_to_ehci_priv(hcd); |
375 | struct device *companion_dev; | ||
373 | 376 | ||
374 | if (pdata->power_on) { | 377 | if (pdata->power_on) { |
375 | int err = pdata->power_on(pdev); | 378 | int err = pdata->power_on(pdev); |
@@ -377,6 +380,10 @@ static int ehci_platform_resume(struct device *dev) | |||
377 | return err; | 380 | return err; |
378 | } | 381 | } |
379 | 382 | ||
383 | companion_dev = usb_of_get_companion_dev(hcd->self.controller); | ||
384 | if (companion_dev) | ||
385 | device_pm_wait_for_dev(hcd->self.controller, companion_dev); | ||
386 | |||
380 | ehci_resume(hcd, priv->reset_on_resume); | 387 | ehci_resume(hcd, priv->reset_on_resume); |
381 | return 0; | 388 | return 0; |
382 | } | 389 | } |