Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 176615
b: refs/heads/master
c: a766ae3
h: refs/heads/master
i:
  176613: b3332f4
  176611: 3af2549
  176607: d741ffb
v: v3
  • Loading branch information
Werner Almesberger authored and Linus Torvalds committed Dec 16, 2009
1 parent 09b57d1 commit 2ea6bad
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f29627c2a3df5732af84bc217df26d1c311f5112
refs/heads/master: a766ae3ebd3575cf8c6b9a39fd5aa66856a578b4
5 changes: 5 additions & 0 deletions trunk/drivers/rtc/rtc-pcf50633.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ struct pcf50633_time {
struct pcf50633_rtc {
int alarm_enabled;
int second_enabled;
int alarm_pending;

struct pcf50633 *pcf;
struct rtc_device *rtc_dev;
Expand Down Expand Up @@ -209,6 +210,7 @@ static int pcf50633_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm)
rtc = dev_get_drvdata(dev);

alrm->enabled = rtc->alarm_enabled;
alrm->pending = rtc->alarm_pending;

ret = pcf50633_read_block(rtc->pcf, PCF50633_REG_RTCSCA,
PCF50633_TI_EXTENT, &pcf_tm.time[0]);
Expand Down Expand Up @@ -244,6 +246,8 @@ static int pcf50633_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm)
/* Returns 0 on success */
ret = pcf50633_write_block(rtc->pcf, PCF50633_REG_RTCSCA,
PCF50633_TI_EXTENT, &pcf_tm.time[0]);
if (!alrm->enabled)
rtc->alarm_pending = 0;

if (!alarm_masked || alrm->enabled)
pcf50633_irq_unmask(rtc->pcf, PCF50633_IRQ_ALARM);
Expand All @@ -268,6 +272,7 @@ static void pcf50633_rtc_irq(int irq, void *data)
switch (irq) {
case PCF50633_IRQ_ALARM:
rtc_update_irq(rtc->rtc_dev, 1, RTC_AF | RTC_IRQF);
rtc->alarm_pending = 1;
break;
case PCF50633_IRQ_SECOND:
rtc_update_irq(rtc->rtc_dev, 1, RTC_UF | RTC_IRQF);
Expand Down

0 comments on commit 2ea6bad

Please sign in to comment.