diff options
author | Peter Chen <peter.chen@freescale.com> | 2015-02-11 12:44:49 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-03-18 16:19:09 +0100 |
commit | 6d6531104d20692190690ed73eaaac770c42aa49 (patch) | |
tree | f434fc56415c50ba285400c29ba07ca3e5900a68 | |
parent | f8efa7665e66c1e92fa10492a243cc0de4437ade (diff) | |
download | linux-6d6531104d20692190690ed73eaaac770c42aa49.tar.bz2 |
usb: chipidea: imx: add usb as system wakeup source
Enable USB as system wakeup source, and each platform needs to implement
imx_usbmisc_set_wakeup in usbmisc_imx.c to support.
Signed-off-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/usb/chipidea/ci_hdrc_imx.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/usb/chipidea/ci_hdrc_imx.c b/drivers/usb/chipidea/ci_hdrc_imx.c index 5ad85fe84411..f7f9fd45c9ea 100644 --- a/drivers/usb/chipidea/ci_hdrc_imx.c +++ b/drivers/usb/chipidea/ci_hdrc_imx.c @@ -199,6 +199,8 @@ static int ci_hdrc_imx_probe(struct platform_device *pdev) pm_runtime_enable(&pdev->dev); } + device_set_wakeup_capable(&pdev->dev, true); + return 0; disable_device: @@ -270,12 +272,23 @@ clk_disable: #ifdef CONFIG_PM_SLEEP static int ci_hdrc_imx_suspend(struct device *dev) { + int ret; + struct ci_hdrc_imx_data *data = dev_get_drvdata(dev); if (data->in_lpm) /* The core's suspend doesn't run */ return 0; + if (device_may_wakeup(dev)) { + ret = imx_usbmisc_set_wakeup(data->usbmisc_data, true); + if (ret) { + dev_err(dev, "usbmisc set_wakeup failed, ret=%d\n", + ret); + return ret; + } + } + return imx_controller_suspend(dev); } |