aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc/rtc-at91sam9.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/rtc/rtc-at91sam9.c')
-rw-r--r--drivers/rtc/rtc-at91sam9.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/drivers/rtc/rtc-at91sam9.c b/drivers/rtc/rtc-at91sam9.c
index f677e0710ca1..5469c52cba3d 100644
--- a/drivers/rtc/rtc-at91sam9.c
+++ b/drivers/rtc/rtc-at91sam9.c
@@ -229,12 +229,6 @@ static int at91_rtc_ioctl(struct device *dev, unsigned int cmd,
229 dev_dbg(dev, "ioctl: cmd=%08x, arg=%08lx, mr %08x\n", cmd, arg, mr); 229 dev_dbg(dev, "ioctl: cmd=%08x, arg=%08lx, mr %08x\n", cmd, arg, mr);
230 230
231 switch (cmd) { 231 switch (cmd) {
232 case RTC_AIE_OFF: /* alarm off */
233 rtt_writel(rtc, MR, mr & ~AT91_RTT_ALMIEN);
234 break;
235 case RTC_AIE_ON: /* alarm on */
236 rtt_writel(rtc, MR, mr | AT91_RTT_ALMIEN);
237 break;
238 case RTC_UIE_OFF: /* update off */ 232 case RTC_UIE_OFF: /* update off */
239 rtt_writel(rtc, MR, mr & ~AT91_RTT_RTTINCIEN); 233 rtt_writel(rtc, MR, mr & ~AT91_RTT_RTTINCIEN);
240 break; 234 break;
@@ -249,6 +243,19 @@ static int at91_rtc_ioctl(struct device *dev, unsigned int cmd,
249 return ret; 243 return ret;
250} 244}
251 245
246static int at91_rtc_alarm_irq_enable(struct device *dev, unsigned int enabled)
247{
248 struct sam9_rtc *rtc = dev_get_drvdata(dev);
249 u32 mr = rtt_readl(rtc, MR);
250
251 dev_dbg(dev, "alarm_irq_enable: enabled=%08x, mr %08x\n", enabled, mr);
252 if (enabled)
253 rtt_writel(rtc, MR, mr | AT91_RTT_ALMIEN);
254 else
255 rtt_writel(rtc, MR, mr & ~AT91_RTT_ALMIEN);
256 return 0;
257}
258
252/* 259/*
253 * Provide additional RTC information in /proc/driver/rtc 260 * Provide additional RTC information in /proc/driver/rtc
254 */ 261 */
@@ -302,6 +309,7 @@ static const struct rtc_class_ops at91_rtc_ops = {
302 .read_alarm = at91_rtc_readalarm, 309 .read_alarm = at91_rtc_readalarm,
303 .set_alarm = at91_rtc_setalarm, 310 .set_alarm = at91_rtc_setalarm,
304 .proc = at91_rtc_proc, 311 .proc = at91_rtc_proc,
312 .alarm_irq_enable = at91_rtc_alarm_irq_enable,
305}; 313};
306 314
307/* 315/*