diff options
author | Paul Mackerras <paulus@samba.org> | 2008-06-29 20:16:50 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2008-06-29 20:16:50 -0400 |
commit | e9a4b6a3f6592862a67837e80aad3f50468857a6 (patch) | |
tree | 087420cf91ac922c7e99757c4490a605ec7b10f2 /drivers/rtc/rtc-at32ap700x.c | |
parent | 441dbb500b4344a8e3125e5aabab4f9dbf72514f (diff) | |
parent | 1702b52092e9a6d05398d3f9581ddc050ef00d06 (diff) |
Merge branch 'linux-2.6'
Diffstat (limited to 'drivers/rtc/rtc-at32ap700x.c')
-rw-r--r-- | drivers/rtc/rtc-at32ap700x.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/rtc/rtc-at32ap700x.c b/drivers/rtc/rtc-at32ap700x.c index 42244f14b41c..2ef8cdfda4a7 100644 --- a/drivers/rtc/rtc-at32ap700x.c +++ b/drivers/rtc/rtc-at32ap700x.c | |||
@@ -94,8 +94,11 @@ static int at32_rtc_readalarm(struct device *dev, struct rtc_wkalrm *alrm) | |||
94 | { | 94 | { |
95 | struct rtc_at32ap700x *rtc = dev_get_drvdata(dev); | 95 | struct rtc_at32ap700x *rtc = dev_get_drvdata(dev); |
96 | 96 | ||
97 | spin_lock_irq(&rtc->lock); | ||
97 | rtc_time_to_tm(rtc->alarm_time, &alrm->time); | 98 | rtc_time_to_tm(rtc->alarm_time, &alrm->time); |
98 | alrm->pending = rtc_readl(rtc, IMR) & RTC_BIT(IMR_TOPI) ? 1 : 0; | 99 | alrm->enabled = rtc_readl(rtc, IMR) & RTC_BIT(IMR_TOPI) ? 1 : 0; |
100 | alrm->pending = rtc_readl(rtc, ISR) & RTC_BIT(ISR_TOPI) ? 1 : 0; | ||
101 | spin_unlock_irq(&rtc->lock); | ||
99 | 102 | ||
100 | return 0; | 103 | return 0; |
101 | } | 104 | } |
@@ -119,7 +122,7 @@ static int at32_rtc_setalarm(struct device *dev, struct rtc_wkalrm *alrm) | |||
119 | spin_lock_irq(&rtc->lock); | 122 | spin_lock_irq(&rtc->lock); |
120 | rtc->alarm_time = alarm_unix_time; | 123 | rtc->alarm_time = alarm_unix_time; |
121 | rtc_writel(rtc, TOP, rtc->alarm_time); | 124 | rtc_writel(rtc, TOP, rtc->alarm_time); |
122 | if (alrm->pending) | 125 | if (alrm->enabled) |
123 | rtc_writel(rtc, CTRL, rtc_readl(rtc, CTRL) | 126 | rtc_writel(rtc, CTRL, rtc_readl(rtc, CTRL) |
124 | | RTC_BIT(CTRL_TOPEN)); | 127 | | RTC_BIT(CTRL_TOPEN)); |
125 | else | 128 | else |