]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - drivers/rtc/rtc-at91sam9.c
Merge branch 'sbp2-spindown' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee139...
[mirror_ubuntu-artful-kernel.git] / drivers / rtc / rtc-at91sam9.c
index bbf10ecf416cb1330415280cb8961bf7a5398ace..f0246ef413a40a4fca53e2fbf9f77188adce3dcf 100644 (file)
@@ -19,7 +19,6 @@
 #include <linux/interrupt.h>
 #include <linux/ioctl.h>
 
-#include <asm/mach/time.h>
 #include <asm/arch/board.h>
 #include <asm/arch/at91_rtt.h>
 
@@ -274,7 +273,7 @@ static irqreturn_t at91_rtc_interrupt(int irq, void *_rtc)
         * SR clears it, so we must only read it in this irq handler!
         */
        mr = rtt_readl(rtc, MR) & (AT91_RTT_ALMIEN | AT91_RTT_RTTINCIEN);
-       sr = rtt_readl(rtc, SR) & mr;
+       sr = rtt_readl(rtc, SR) & (mr >> 16);
        if (!sr)
                return IRQ_NONE;
 
@@ -288,7 +287,7 @@ static irqreturn_t at91_rtc_interrupt(int irq, void *_rtc)
 
        rtc_update_irq(rtc->rtcdev, 1, events);
 
-       pr_debug("%s: num=%ld, events=0x%02lx\n", __FUNCTION__,
+       pr_debug("%s: num=%ld, events=0x%02lx\n", __func__,
                events >> 8, events & 0x000000FF);
 
        return IRQ_HANDLED;
@@ -321,6 +320,10 @@ static int __init at91_rtc_probe(struct platform_device *pdev)
        if (!rtc)
                return -ENOMEM;
 
+       /* platform setup code should have handled this; sigh */
+       if (!device_can_wakeup(&pdev->dev))
+               device_init_wakeup(&pdev->dev, 1);
+
        platform_set_drvdata(pdev, rtc);
        rtc->rtt = (void __force __iomem *) (AT91_VA_BASE_SYS - AT91_BASE_SYS);
        rtc->rtt += r->start;