diff options
author | Jamie Lenehan <lenehan@twibble.org> | 2007-01-22 23:40:41 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-01-23 10:52:06 -0500 |
commit | 15c945c3d0913d73a7d57d7a0a3c4e2902598cc6 (patch) | |
tree | ad264d49c433e6d81d6ac0def68d97a3359cc087 /drivers/rtc | |
parent | fc3dffe12148b9612870eb21b24f2aecefa9ea24 (diff) |
[PATCH] rtc-sh: act on rtc_wkalrm.enabled when setting an alarm
This fixes the SH rtc driver correctly act on the "enabled" flag when
setting an alarm.
Signed-off-by: Jamie Lenehan <lenehan@twibble.org>
Cc: David Brownell <david-b@pacbell.net>
Cc: Alessandro Zummo <alessandro.zummo@towertech.it>
Cc: Paul Mundt <lethal@linux-sh.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/rtc')
-rw-r--r-- | drivers/rtc/rtc-sh.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/rtc/rtc-sh.c b/drivers/rtc/rtc-sh.c index e9e0934380b8..198b9f22fbff 100644 --- a/drivers/rtc/rtc-sh.c +++ b/drivers/rtc/rtc-sh.c | |||
@@ -492,10 +492,10 @@ static int sh_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *wkalrm) | |||
492 | 492 | ||
493 | spin_lock_irq(&rtc->lock); | 493 | spin_lock_irq(&rtc->lock); |
494 | 494 | ||
495 | /* disable alarm interrupt and clear flag */ | 495 | /* disable alarm interrupt and clear the alarm flag */ |
496 | rcr1 = readb(rtc->regbase + RCR1); | 496 | rcr1 = readb(rtc->regbase + RCR1); |
497 | rcr1 &= ~RCR1_AF; | 497 | rcr1 &= ~(RCR1_AF|RCR1_AIE); |
498 | writeb(rcr1 & ~RCR1_AIE, rtc->regbase + RCR1); | 498 | writeb(rcr1, rtc->regbase + RCR1); |
499 | 499 | ||
500 | rtc->rearm_aie = 0; | 500 | rtc->rearm_aie = 0; |
501 | 501 | ||
@@ -510,8 +510,10 @@ static int sh_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *wkalrm) | |||
510 | mon += 1; | 510 | mon += 1; |
511 | sh_rtc_write_alarm_value(rtc, mon, RMONAR); | 511 | sh_rtc_write_alarm_value(rtc, mon, RMONAR); |
512 | 512 | ||
513 | /* Restore interrupt activation status */ | 513 | if (wkalrm->enabled) { |
514 | writeb(rcr1, rtc->regbase + RCR1); | 514 | rcr1 |= RCR1_AIE; |
515 | writeb(rcr1, rtc->regbase + RCR1); | ||
516 | } | ||
515 | 517 | ||
516 | spin_unlock_irq(&rtc->lock); | 518 | spin_unlock_irq(&rtc->lock); |
517 | 519 | ||