summaryrefslogtreecommitdiff
path: root/drivers/usb/chipidea/core.c
diff options
context:
space:
mode:
authorPeter Chen <peter.chen@freescale.com>2015-02-11 07:44:48 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-03-18 18:19:09 +0300
commitf8efa7665e66c1e92fa10492a243cc0de4437ade (patch)
tree853da2f37d53293be53995a9bd1e7c1164553cae /drivers/usb/chipidea/core.c
parente14db48dfcf3ab6ebea212e82dc56036a00b0d6b (diff)
downloadlinux-f8efa7665e66c1e92fa10492a243cc0de4437ade.tar.xz
usb: chipidea: add usb as system wakeup source
The USB signal can be system wakeup source, this patch add the support, for how to enable it, see Documentation/usb/chipidea.txt. Since USB wakeup enable logic is vendor/platform specific, the glue layer needs to implement it to support this feature. Signed-off-by: Peter Chen <peter.chen@freescale.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/chipidea/core.c')
-rw-r--r--drivers/usb/chipidea/core.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/usb/chipidea/core.c b/drivers/usb/chipidea/core.c
index 63d2b398c9a0..6d9dc2d175eb 100644
--- a/drivers/usb/chipidea/core.c
+++ b/drivers/usb/chipidea/core.c
@@ -808,6 +808,8 @@ static int ci_hdrc_probe(struct platform_device *pdev)
if (ci_otg_is_fsm_mode(ci))
ci_hdrc_otg_fsm_start(ci);
+ device_set_wakeup_capable(&pdev->dev, true);
+
ret = dbg_create_files(ci);
if (!ret)
return 0;
@@ -898,6 +900,11 @@ static int ci_suspend(struct device *dev)
return 0;
}
+ if (device_may_wakeup(dev)) {
+ usb_phy_set_wakeup(ci->usb_phy, true);
+ enable_irq_wake(ci->irq);
+ }
+
ci_controller_suspend(ci);
return 0;
@@ -908,6 +915,9 @@ static int ci_resume(struct device *dev)
struct ci_hdrc *ci = dev_get_drvdata(dev);
int ret;
+ if (device_may_wakeup(dev))
+ disable_irq_wake(ci->irq);
+
ret = ci_controller_resume(dev);
if (ret)
return ret;