diff options
author | Peter Chen <peter.chen@freescale.com> | 2015-02-10 23:44:49 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-03-18 11:19:09 -0400 |
commit | 6d6531104d20692190690ed73eaaac770c42aa49 (patch) | |
tree | f434fc56415c50ba285400c29ba07ca3e5900a68 | |
parent | f8efa7665e66c1e92fa10492a243cc0de4437ade (diff) |
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) | |||
199 | pm_runtime_enable(&pdev->dev); | 199 | pm_runtime_enable(&pdev->dev); |
200 | } | 200 | } |
201 | 201 | ||
202 | device_set_wakeup_capable(&pdev->dev, true); | ||
203 | |||
202 | return 0; | 204 | return 0; |
203 | 205 | ||
204 | disable_device: | 206 | disable_device: |
@@ -270,12 +272,23 @@ clk_disable: | |||
270 | #ifdef CONFIG_PM_SLEEP | 272 | #ifdef CONFIG_PM_SLEEP |
271 | static int ci_hdrc_imx_suspend(struct device *dev) | 273 | static int ci_hdrc_imx_suspend(struct device *dev) |
272 | { | 274 | { |
275 | int ret; | ||
276 | |||
273 | struct ci_hdrc_imx_data *data = dev_get_drvdata(dev); | 277 | struct ci_hdrc_imx_data *data = dev_get_drvdata(dev); |
274 | 278 | ||
275 | if (data->in_lpm) | 279 | if (data->in_lpm) |
276 | /* The core's suspend doesn't run */ | 280 | /* The core's suspend doesn't run */ |
277 | return 0; | 281 | return 0; |
278 | 282 | ||
283 | if (device_may_wakeup(dev)) { | ||
284 | ret = imx_usbmisc_set_wakeup(data->usbmisc_data, true); | ||
285 | if (ret) { | ||
286 | dev_err(dev, "usbmisc set_wakeup failed, ret=%d\n", | ||
287 | ret); | ||
288 | return ret; | ||
289 | } | ||
290 | } | ||
291 | |||
279 | return imx_controller_suspend(dev); | 292 | return imx_controller_suspend(dev); |
280 | } | 293 | } |
281 | 294 | ||