Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

[PATCH] rtc-sa1100 rtc_wklarm.enabled bugfixes

Some rtc-sa1100 bugfixes:

- The read_alarm() method reports the rtc_wkalrm.enabled field properly.
This patch is already in the handhelds.org tree.

- And the set_alarm() method now handles that flag correctly, rather than
making mismatched {en,dis}able_irq_wake() calls, which trigger runtime
warning messages. (Those calls are best made in suspend/resume methods.)

Note that while this SA1100/PXA RTC is fully capable of waking those ARM
processors from sleep states, that mechanism isn't properly supported on
either processor family, or in this driver. Some boards have board-specific
PM glue providing partial workarounds for the weak generic PM support.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

David Brownell and committed by
Linus Torvalds
32b49da4 a631694a

+7 -5
+7 -5
drivers/rtc/rtc-sa1100.c
··· 263 263 264 264 static int sa1100_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm) 265 265 { 266 + u32 rtsr; 267 + 266 268 memcpy(&alrm->time, &rtc_alarm, sizeof(struct rtc_time)); 267 - alrm->pending = RTSR & RTSR_AL ? 1 : 0; 269 + rtsr = RTSR; 270 + alrm->enabled = (rtsr & RTSR_ALE) ? 1 : 0; 271 + alrm->pending = (rtsr & RTSR_AL) ? 1 : 0; 268 272 return 0; 269 273 } 270 274 ··· 279 275 spin_lock_irq(&sa1100_rtc_lock); 280 276 ret = rtc_update_alarm(&alrm->time); 281 277 if (ret == 0) { 282 - memcpy(&rtc_alarm, &alrm->time, sizeof(struct rtc_time)); 283 - 284 278 if (alrm->enabled) 285 - enable_irq_wake(IRQ_RTCAlrm); 279 + RTSR |= RTSR_ALE; 286 280 else 287 - disable_irq_wake(IRQ_RTCAlrm); 281 + RTSR &= ~RTSR_ALE; 288 282 } 289 283 spin_unlock_irq(&sa1100_rtc_lock); 290 284