Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 105489
b: refs/heads/master
c: 449321b
h: refs/heads/master
i:
  105487: d8d73fa
v: v3
  • Loading branch information
David Brownell authored and Linus Torvalds committed Jul 24, 2008
1 parent 85a51d6 commit 682abb1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 773be7ee97c11fbb6b8a912a58b268dbe8a6a3fe
refs/heads/master: 449321b39f6c6ebfa15d6da24f134240bd51db29
16 changes: 6 additions & 10 deletions trunk/drivers/rtc/rtc-at91rm9200.c
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,10 @@ static int at91_rtc_setalarm(struct device *dev, struct rtc_wkalrm *alrm)
| BIN2BCD(tm.tm_mday) << 24
| AT91_RTC_DATEEN | AT91_RTC_MTHEN);

if (alrm->enabled)
if (alrm->enabled) {
at91_sys_write(AT91_RTC_SCCR, AT91_RTC_ALARM);
at91_sys_write(AT91_RTC_IER, AT91_RTC_ALARM);
}

pr_debug("%s(): %4d-%02d-%02d %02d:%02d:%02d\n", __func__,
at91_alarm_year, tm.tm_mon, tm.tm_mday, tm.tm_hour,
Expand All @@ -191,28 +193,22 @@ static int at91_rtc_ioctl(struct device *dev, unsigned int cmd,

pr_debug("%s(): cmd=%08x, arg=%08lx.\n", __func__, cmd, arg);

/* important: scrub old status before enabling IRQs */
switch (cmd) {
case RTC_AIE_OFF: /* alarm off */
at91_sys_write(AT91_RTC_IDR, AT91_RTC_ALARM);
break;
case RTC_AIE_ON: /* alarm on */
at91_sys_write(AT91_RTC_SCCR, AT91_RTC_ALARM);
at91_sys_write(AT91_RTC_IER, AT91_RTC_ALARM);
break;
case RTC_UIE_OFF: /* update off */
case RTC_PIE_OFF: /* periodic off */
at91_sys_write(AT91_RTC_IDR, AT91_RTC_SECEV);
break;
case RTC_UIE_ON: /* update on */
case RTC_PIE_ON: /* periodic on */
at91_sys_write(AT91_RTC_SCCR, AT91_RTC_SECEV);
at91_sys_write(AT91_RTC_IER, AT91_RTC_SECEV);
break;
case RTC_IRQP_READ: /* read periodic alarm frequency */
ret = put_user(AT91_RTC_FREQ, (unsigned long *) arg);
break;
case RTC_IRQP_SET: /* set periodic alarm frequency */
if (arg != AT91_RTC_FREQ)
ret = -EINVAL;
break;
default:
ret = -ENOIOCTLCMD;
break;
Expand Down

0 comments on commit 682abb1

Please sign in to comment.