]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/rtc/rtc-sa1100.c
sis190: read the mac address from the eeprom first
[linux-2.6-omap-h63xx.git] / drivers / rtc / rtc-sa1100.c
index 0918b787c4dd033671a0bd1902594b1ae858b653..ee253cc45de1e1b1ed0df26ce7c3e73d243b30b2 100644 (file)
@@ -29,8 +29,8 @@
 #include <linux/interrupt.h>
 #include <linux/string.h>
 #include <linux/pm.h>
+#include <linux/bitops.h>
 
-#include <asm/bitops.h>
 #include <asm/hardware.h>
 #include <asm/irq.h>
 #include <asm/rtc.h>
@@ -337,6 +337,8 @@ static int sa1100_rtc_probe(struct platform_device *pdev)
        if (IS_ERR(rtc))
                return PTR_ERR(rtc);
 
+       device_init_wakeup(&pdev->dev, 1);
+
        platform_set_drvdata(pdev, rtc);
 
        return 0;
@@ -352,9 +354,30 @@ static int sa1100_rtc_remove(struct platform_device *pdev)
        return 0;
 }
 
+#ifdef CONFIG_PM
+static int sa1100_rtc_suspend(struct platform_device *pdev, pm_message_t state)
+{
+       if (device_may_wakeup(&pdev->dev))
+               enable_irq_wake(IRQ_RTCAlrm);
+       return 0;
+}
+
+static int sa1100_rtc_resume(struct platform_device *pdev)
+{
+       if (device_may_wakeup(&pdev->dev))
+               disable_irq_wake(IRQ_RTCAlrm);
+       return 0;
+}
+#else
+#define sa1100_rtc_suspend     NULL
+#define sa1100_rtc_resume      NULL
+#endif
+
 static struct platform_driver sa1100_rtc_driver = {
        .probe          = sa1100_rtc_probe,
        .remove         = sa1100_rtc_remove,
+       .suspend        = sa1100_rtc_suspend,
+       .resume         = sa1100_rtc_resume,
        .driver         = {
                .name           = "sa1100-rtc",
        },