diff options
| author | Grant Likely <grant.likely@secretlab.ca> | 2011-03-17 13:46:58 -0600 |
|---|---|---|
| committer | Grant Likely <grant.likely@secretlab.ca> | 2011-03-17 13:48:06 -0600 |
| commit | 2dd22997679a88874c131f6e6ffb963e6d43b3a6 (patch) | |
| tree | bfe1707dda7e755b8b550c6796e2649813bcfbb9 /drivers/rtc/rtc-test.c | |
| parent | 36885ff0e6563687e6152da6d311abbf83c0198f (diff) | |
| parent | 7b7adc4a016a1decb806eb71ecab98721fa7f146 (diff) | |
Merge remote-tracking branch 'origin' into spi/next
Pull in Linus' tree to pick up changes required for the langwell gpio fixes
Diffstat (limited to 'drivers/rtc/rtc-test.c')
| -rw-r--r-- | drivers/rtc/rtc-test.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/drivers/rtc/rtc-test.c b/drivers/rtc/rtc-test.c index a82d6fe9707..7e96254bd36 100644 --- a/drivers/rtc/rtc-test.c +++ b/drivers/rtc/rtc-test.c @@ -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; |
