aboutsummaryrefslogtreecommitdiff
path: root/arch/sh
diff options
context:
space:
mode:
authorJamie Lenehan <lenehan@twibble.org>2006-12-08 15:26:15 +0900
committerPaul Mundt <lethal@linux-sh.org>2006-12-12 08:42:08 +0900
commit1b73e6ae45d0353a062d7bea707757a235473cf9 (patch)
tree22f4d14de41371e48bf513e11e3734adb4dd788c /arch/sh
parenta16147965ca7a84dc08c4457961782e06ac7cd0d (diff)
rtc: rtc-sh: alarm support.
This adds alarm support for the RTC_ALM_SET, RTC_ALM_READ, RTC_WKALM_SET and RTC_WKALM_RD operations to rtc-sh. The only unusual part is the handling of the alarm interrupt. If you clear the alarm flag (AF) while the time in the RTC still matches the time in the alarm registers than AF is immediately re-set, and if the alarm interrupt (AIE) is still enabled then it re-triggers. I was originally getting around 20k+ interrupts generated during the second when the RTC and alarm registers matches. The solution I've used is to clear AIE when the alarm goes off and then use the carry interrupt to re-enabled it. The carry interrupt will check AF and re-enabled AIE if it's clear. If AF is not clear it'll clear it and then the check will be repeated next carry interrupt. This a bit in rtc structure that indicates that it's waiting to have AIE re-enabled so it doesn't turn it on when it wasn't enabled anyway. Signed-off-by: Jamie Lenehan <lenehan@twibble.org> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh')
0 files changed, 0 insertions, 0 deletions