- at91rm9200-rtc-can-issue-system-wakeup-events.patch removed from -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled

     AT91rm9200 RTC can issue system wakeup events

has been removed from the -mm tree.  Its filename is

     at91rm9200-rtc-can-issue-system-wakeup-events.patch

This patch was dropped because it was merged into mainline or a subsystem tree

------------------------------------------------------
Subject: AT91rm9200 RTC can issue system wakeup events
From: David Brownell <david-b@xxxxxxxxxxx>

This lets the at91rm9200 RTC alarm be a system wakeup irq, according to the
setting of /sys/devices/platform/at91_rtc/power/wakeup.  User code can set the
alarm, put the system into a low power mode, and then rely on it waking up no
later than the specified moment.

Signed-off-by: David Brownell <dbrownell@xxxxxxxxxxxxxxxxxxxxx>
Cc: Alessandro Zummo <a.zummo@xxxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxx>
---

 drivers/rtc/rtc-at91.c |   22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff -puN drivers/rtc/rtc-at91.c~at91rm9200-rtc-can-issue-system-wakeup-events drivers/rtc/rtc-at91.c
--- a/drivers/rtc/rtc-at91.c~at91rm9200-rtc-can-issue-system-wakeup-events
+++ a/drivers/rtc/rtc-at91.c
@@ -307,6 +307,7 @@ static int __init at91_rtc_probe(struct 
 		return PTR_ERR(rtc);
 	}
 	platform_set_drvdata(pdev, rtc);
+	device_init_wakeup(&pdev->dev, 1);
 
 	printk(KERN_INFO "AT91 Real Time Clock driver.\n");
 	return 0;
@@ -327,6 +328,7 @@ static int __devexit at91_rtc_remove(str
 
 	rtc_device_unregister(rtc);
 	platform_set_drvdata(pdev, NULL);
+	device_init_wakeup(&pdev->dev, 0);
 
 	return 0;
 }
@@ -336,6 +338,7 @@ static int __devexit at91_rtc_remove(str
 /* AT91RM9200 RTC Power management control */
 
 static struct timespec at91_rtc_delta;
+static u32 at91_rtc_imr;
 
 static int at91_rtc_suspend(struct platform_device *pdev, pm_message_t state)
 {
@@ -349,6 +352,18 @@ static int at91_rtc_suspend(struct platf
 	rtc_tm_to_time(&tm, &time.tv_sec);
 	save_time_delta(&at91_rtc_delta, &time);
 
+	/* this IRQ is shared with DBGU and other hardware which isn't
+	 * necessarily doing PM like we are...
+	 */
+	at91_rtc_imr = at91_sys_read(AT91_RTC_IMR)
+			& (AT91_RTC_ALARM|AT91_RTC_SECEV);
+	if (at91_rtc_imr) {
+		if (device_may_wakeup(&pdev->dev))
+			enable_irq_wake(AT91_ID_SYS);
+		else
+			at91_sys_write(AT91_RTC_IDR, at91_rtc_imr);
+	}
+
 	pr_debug("%s(): %4d-%02d-%02d %02d:%02d:%02d\n", __FUNCTION__,
 		1900 + tm.tm_year, tm.tm_mon, tm.tm_mday,
 		tm.tm_hour, tm.tm_min, tm.tm_sec);
@@ -367,6 +382,13 @@ static int at91_rtc_resume(struct platfo
 	rtc_tm_to_time(&tm, &time.tv_sec);
 	restore_time_delta(&at91_rtc_delta, &time);
 
+	if (at91_rtc_imr) {
+		if (device_may_wakeup(&pdev->dev))
+			disable_irq_wake(AT91_ID_SYS);
+		else
+			at91_sys_write(AT91_RTC_IER, at91_rtc_imr);
+	}
+
 	pr_debug("%s(): %4d-%02d-%02d %02d:%02d:%02d\n", __FUNCTION__,
 		1900 + tm.tm_year, tm.tm_mon, tm.tm_mday,
 		tm.tm_hour, tm.tm_min, tm.tm_sec);
_

Patches currently in -mm which might be from david-b@xxxxxxxxxxx are

origin.patch
i2c-tps65010-update-for-current-i2c-omap.patch
git-pcmcia.patch
ide-reprogram-disk-pio-timings-on-resume.patch

-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux