diff options
Diffstat (limited to 'drivers/rtc/rtc-mxc_v2.c')
-rw-r--r-- | drivers/rtc/rtc-mxc_v2.c | 29 |
1 files changed, 4 insertions, 25 deletions
diff --git a/drivers/rtc/rtc-mxc_v2.c b/drivers/rtc/rtc-mxc_v2.c index 007879a5042d..5b970a816631 100644 --- a/drivers/rtc/rtc-mxc_v2.c +++ b/drivers/rtc/rtc-mxc_v2.c | |||
@@ -10,6 +10,7 @@ | |||
10 | #include <linux/module.h> | 10 | #include <linux/module.h> |
11 | #include <linux/mod_devicetable.h> | 11 | #include <linux/mod_devicetable.h> |
12 | #include <linux/platform_device.h> | 12 | #include <linux/platform_device.h> |
13 | #include <linux/pm_wakeirq.h> | ||
13 | #include <linux/rtc.h> | 14 | #include <linux/rtc.h> |
14 | 15 | ||
15 | #define SRTC_LPPDR_INIT 0x41736166 /* init for glitch detect */ | 16 | #define SRTC_LPPDR_INIT 0x41736166 /* init for glitch detect */ |
@@ -305,6 +306,9 @@ static int mxc_rtc_probe(struct platform_device *pdev) | |||
305 | return pdata->irq; | 306 | return pdata->irq; |
306 | 307 | ||
307 | device_init_wakeup(&pdev->dev, 1); | 308 | device_init_wakeup(&pdev->dev, 1); |
309 | ret = dev_pm_set_wake_irq(&pdev->dev, pdata->irq); | ||
310 | if (ret) | ||
311 | dev_err(&pdev->dev, "failed to enable irq wake\n"); | ||
308 | 312 | ||
309 | ret = clk_prepare_enable(pdata->clk); | 313 | ret = clk_prepare_enable(pdata->clk); |
310 | if (ret) | 314 | if (ret) |
@@ -367,30 +371,6 @@ static int mxc_rtc_remove(struct platform_device *pdev) | |||
367 | return 0; | 371 | return 0; |
368 | } | 372 | } |
369 | 373 | ||
370 | #ifdef CONFIG_PM_SLEEP | ||
371 | static int mxc_rtc_suspend(struct device *dev) | ||
372 | { | ||
373 | struct mxc_rtc_data *pdata = dev_get_drvdata(dev); | ||
374 | |||
375 | if (device_may_wakeup(dev)) | ||
376 | enable_irq_wake(pdata->irq); | ||
377 | |||
378 | return 0; | ||
379 | } | ||
380 | |||
381 | static int mxc_rtc_resume(struct device *dev) | ||
382 | { | ||
383 | struct mxc_rtc_data *pdata = dev_get_drvdata(dev); | ||
384 | |||
385 | if (device_may_wakeup(dev)) | ||
386 | disable_irq_wake(pdata->irq); | ||
387 | |||
388 | return 0; | ||
389 | } | ||
390 | #endif | ||
391 | |||
392 | static SIMPLE_DEV_PM_OPS(mxc_rtc_pm_ops, mxc_rtc_suspend, mxc_rtc_resume); | ||
393 | |||
394 | static const struct of_device_id mxc_ids[] = { | 374 | static const struct of_device_id mxc_ids[] = { |
395 | { .compatible = "fsl,imx53-rtc", }, | 375 | { .compatible = "fsl,imx53-rtc", }, |
396 | {} | 376 | {} |
@@ -400,7 +380,6 @@ static struct platform_driver mxc_rtc_driver = { | |||
400 | .driver = { | 380 | .driver = { |
401 | .name = "mxc_rtc_v2", | 381 | .name = "mxc_rtc_v2", |
402 | .of_match_table = mxc_ids, | 382 | .of_match_table = mxc_ids, |
403 | .pm = &mxc_rtc_pm_ops, | ||
404 | }, | 383 | }, |
405 | .probe = mxc_rtc_probe, | 384 | .probe = mxc_rtc_probe, |
406 | .remove = mxc_rtc_remove, | 385 | .remove = mxc_rtc_remove, |