aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/rtc')
-rw-r--r--drivers/rtc/rtc-ab8500.c2
-rw-r--r--drivers/rtc/rtc-max8925.c26
2 files changed, 27 insertions, 1 deletions
diff --git a/drivers/rtc/rtc-ab8500.c b/drivers/rtc/rtc-ab8500.c
index a0a9810adf0b..4bcf9ca2818a 100644
--- a/drivers/rtc/rtc-ab8500.c
+++ b/drivers/rtc/rtc-ab8500.c
@@ -15,7 +15,7 @@
15#include <linux/platform_device.h> 15#include <linux/platform_device.h>
16#include <linux/rtc.h> 16#include <linux/rtc.h>
17#include <linux/mfd/abx500.h> 17#include <linux/mfd/abx500.h>
18#include <linux/mfd/ab8500.h> 18#include <linux/mfd/abx500/ab8500.h>
19#include <linux/delay.h> 19#include <linux/delay.h>
20 20
21#define AB8500_RTC_SOFF_STAT_REG 0x00 21#define AB8500_RTC_SOFF_STAT_REG 0x00
diff --git a/drivers/rtc/rtc-max8925.c b/drivers/rtc/rtc-max8925.c
index 4a5529346b47..2d71943bc436 100644
--- a/drivers/rtc/rtc-max8925.c
+++ b/drivers/rtc/rtc-max8925.c
@@ -261,6 +261,8 @@ static int __devinit max8925_rtc_probe(struct platform_device *pdev)
261 /* XXX - isn't this redundant? */ 261 /* XXX - isn't this redundant? */
262 platform_set_drvdata(pdev, info); 262 platform_set_drvdata(pdev, info);
263 263
264 device_init_wakeup(&pdev->dev, 1);
265
264 info->rtc_dev = rtc_device_register("max8925-rtc", &pdev->dev, 266 info->rtc_dev = rtc_device_register("max8925-rtc", &pdev->dev,
265 &max8925_rtc_ops, THIS_MODULE); 267 &max8925_rtc_ops, THIS_MODULE);
266 ret = PTR_ERR(info->rtc_dev); 268 ret = PTR_ERR(info->rtc_dev);
@@ -290,10 +292,34 @@ static int __devexit max8925_rtc_remove(struct platform_device *pdev)
290 return 0; 292 return 0;
291} 293}
292 294
295#ifdef CONFIG_PM_SLEEP
296static int max8925_rtc_suspend(struct device *dev)
297{
298 struct platform_device *pdev = to_platform_device(dev);
299 struct max8925_chip *chip = dev_get_drvdata(pdev->dev.parent);
300
301 if (device_may_wakeup(dev))
302 chip->wakeup_flag |= 1 << MAX8925_IRQ_RTC_ALARM0;
303 return 0;
304}
305static int max8925_rtc_resume(struct device *dev)
306{
307 struct platform_device *pdev = to_platform_device(dev);
308 struct max8925_chip *chip = dev_get_drvdata(pdev->dev.parent);
309
310 if (device_may_wakeup(dev))
311 chip->wakeup_flag &= ~(1 << MAX8925_IRQ_RTC_ALARM0);
312 return 0;
313}
314#endif
315
316static SIMPLE_DEV_PM_OPS(max8925_rtc_pm_ops, max8925_rtc_suspend, max8925_rtc_resume);
317
293static struct platform_driver max8925_rtc_driver = { 318static struct platform_driver max8925_rtc_driver = {
294 .driver = { 319 .driver = {
295 .name = "max8925-rtc", 320 .name = "max8925-rtc",
296 .owner = THIS_MODULE, 321 .owner = THIS_MODULE,
322 .pm = &max8925_rtc_pm_ops,
297 }, 323 },
298 .probe = max8925_rtc_probe, 324 .probe = max8925_rtc_probe,
299 .remove = __devexit_p(max8925_rtc_remove), 325 .remove = __devexit_p(max8925_rtc_remove),