aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc/rtc-test.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/rtc/rtc-test.c')
-rw-r--r--drivers/rtc/rtc-test.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/drivers/rtc/rtc-test.c b/drivers/rtc/rtc-test.c
index a82d6fe97076..7e96254bd365 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,
78 struct rtc_device *rtc = platform_get_drvdata(plat_dev); 78 struct rtc_device *rtc = platform_get_drvdata(plat_dev);
79 79
80 retval = count; 80 retval = count;
81 if (strncmp(buf, "tick", 4) == 0) 81 if (strncmp(buf, "tick", 4) == 0 && rtc->pie_enabled)
82 rtc_update_irq(rtc, 1, RTC_PF | RTC_IRQF); 82 rtc_update_irq(rtc, 1, RTC_PF | RTC_IRQF);
83 else if (strncmp(buf, "alarm", 5) == 0) 83 else if (strncmp(buf, "alarm", 5) == 0) {
84 rtc_update_irq(rtc, 1, RTC_AF | RTC_IRQF); 84 struct rtc_wkalrm alrm;
85 else if (strncmp(buf, "update", 6) == 0) 85 int err = rtc_read_alarm(rtc, &alrm);
86
87 if (!err && alrm.enabled)
88 rtc_update_irq(rtc, 1, RTC_AF | RTC_IRQF);
89
90 } else if (strncmp(buf, "update", 6) == 0 && rtc->uie_rtctimer.enabled)
86 rtc_update_irq(rtc, 1, RTC_UF | RTC_IRQF); 91 rtc_update_irq(rtc, 1, RTC_UF | RTC_IRQF);
87 else 92 else
88 retval = -EINVAL; 93 retval = -EINVAL;