提交 15c945c3 编写于 作者: J Jamie Lenehan 提交者: Linus Torvalds

[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: NJamie 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: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 fc3dffe1
...@@ -492,10 +492,10 @@ static int sh_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *wkalrm) ...@@ -492,10 +492,10 @@ static int sh_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *wkalrm)
spin_lock_irq(&rtc->lock); spin_lock_irq(&rtc->lock);
/* disable alarm interrupt and clear flag */ /* disable alarm interrupt and clear the alarm flag */
rcr1 = readb(rtc->regbase + RCR1); rcr1 = readb(rtc->regbase + RCR1);
rcr1 &= ~RCR1_AF; rcr1 &= ~(RCR1_AF|RCR1_AIE);
writeb(rcr1 & ~RCR1_AIE, rtc->regbase + RCR1); writeb(rcr1, rtc->regbase + RCR1);
rtc->rearm_aie = 0; rtc->rearm_aie = 0;
...@@ -510,8 +510,10 @@ static int sh_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *wkalrm) ...@@ -510,8 +510,10 @@ static int sh_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *wkalrm)
mon += 1; mon += 1;
sh_rtc_write_alarm_value(rtc, mon, RMONAR); sh_rtc_write_alarm_value(rtc, mon, RMONAR);
/* Restore interrupt activation status */ if (wkalrm->enabled) {
writeb(rcr1, rtc->regbase + RCR1); rcr1 |= RCR1_AIE;
writeb(rcr1, rtc->regbase + RCR1);
}
spin_unlock_irq(&rtc->lock); spin_unlock_irq(&rtc->lock);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册