Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 234638
b: refs/heads/master
c: a417493
h: refs/heads/master
v: v3
  • Loading branch information
Marcelo Roberto Jimenez authored and John Stultz committed Mar 9, 2011
1 parent 0b9625a commit 82fd305
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 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: 4cebe7aadc9ee8e7b44857b7aba3a878870cef65
refs/heads/master: a417493ef916b8b6d1782a589766a713c553842e
13 changes: 9 additions & 4 deletions trunk/drivers/rtc/rtc-test.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,16 @@ static ssize_t test_irq_store(struct device *dev,
struct rtc_device *rtc = platform_get_drvdata(plat_dev);

retval = count;
if (strncmp(buf, "tick", 4) == 0)
if (strncmp(buf, "tick", 4) == 0 && rtc->pie_enabled)
rtc_update_irq(rtc, 1, RTC_PF | RTC_IRQF);
else if (strncmp(buf, "alarm", 5) == 0)
rtc_update_irq(rtc, 1, RTC_AF | RTC_IRQF);
else if (strncmp(buf, "update", 6) == 0)
else if (strncmp(buf, "alarm", 5) == 0) {
struct rtc_wkalrm alrm;
int err = rtc_read_alarm(rtc, &alrm);

if (!err && alrm.enabled)
rtc_update_irq(rtc, 1, RTC_AF | RTC_IRQF);

} else if (strncmp(buf, "update", 6) == 0 && rtc->uie_rtctimer.enabled)
rtc_update_irq(rtc, 1, RTC_UF | RTC_IRQF);
else
retval = -EINVAL;
Expand Down

0 comments on commit 82fd305

Please sign in to comment.