aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/rtc')
-rw-r--r--drivers/rtc/rtc-pcf50633.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/rtc/rtc-pcf50633.c b/drivers/rtc/rtc-pcf50633.c
index 9b74e9c9151c..854c3cb365a1 100644
--- a/drivers/rtc/rtc-pcf50633.c
+++ b/drivers/rtc/rtc-pcf50633.c
@@ -58,6 +58,7 @@ struct pcf50633_time {
58struct pcf50633_rtc { 58struct pcf50633_rtc {
59 int alarm_enabled; 59 int alarm_enabled;
60 int second_enabled; 60 int second_enabled;
61 int alarm_pending;
61 62
62 struct pcf50633 *pcf; 63 struct pcf50633 *pcf;
63 struct rtc_device *rtc_dev; 64 struct rtc_device *rtc_dev;
@@ -209,6 +210,7 @@ static int pcf50633_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm)
209 rtc = dev_get_drvdata(dev); 210 rtc = dev_get_drvdata(dev);
210 211
211 alrm->enabled = rtc->alarm_enabled; 212 alrm->enabled = rtc->alarm_enabled;
213 alrm->pending = rtc->alarm_pending;
212 214
213 ret = pcf50633_read_block(rtc->pcf, PCF50633_REG_RTCSCA, 215 ret = pcf50633_read_block(rtc->pcf, PCF50633_REG_RTCSCA,
214 PCF50633_TI_EXTENT, &pcf_tm.time[0]); 216 PCF50633_TI_EXTENT, &pcf_tm.time[0]);
@@ -244,6 +246,8 @@ static int pcf50633_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm)
244 /* Returns 0 on success */ 246 /* Returns 0 on success */
245 ret = pcf50633_write_block(rtc->pcf, PCF50633_REG_RTCSCA, 247 ret = pcf50633_write_block(rtc->pcf, PCF50633_REG_RTCSCA,
246 PCF50633_TI_EXTENT, &pcf_tm.time[0]); 248 PCF50633_TI_EXTENT, &pcf_tm.time[0]);
249 if (!alrm->enabled)
250 rtc->alarm_pending = 0;
247 251
248 if (!alarm_masked || alrm->enabled) 252 if (!alarm_masked || alrm->enabled)
249 pcf50633_irq_unmask(rtc->pcf, PCF50633_IRQ_ALARM); 253 pcf50633_irq_unmask(rtc->pcf, PCF50633_IRQ_ALARM);
@@ -268,6 +272,7 @@ static void pcf50633_rtc_irq(int irq, void *data)
268 switch (irq) { 272 switch (irq) {
269 case PCF50633_IRQ_ALARM: 273 case PCF50633_IRQ_ALARM:
270 rtc_update_irq(rtc->rtc_dev, 1, RTC_AF | RTC_IRQF); 274 rtc_update_irq(rtc->rtc_dev, 1, RTC_AF | RTC_IRQF);
275 rtc->alarm_pending = 1;
271 break; 276 break;
272 case PCF50633_IRQ_SECOND: 277 case PCF50633_IRQ_SECOND:
273 rtc_update_irq(rtc->rtc_dev, 1, RTC_UF | RTC_IRQF); 278 rtc_update_irq(rtc->rtc_dev, 1, RTC_UF | RTC_IRQF);