Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 218492
b: refs/heads/master
c: 286f9f9
h: refs/heads/master
v: v3
  • Loading branch information
Mike Frysinger authored and Linus Torvalds committed Oct 28, 2010
1 parent 1c386a6 commit 614b384
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 12 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: 9aa449bed21515a3406f60238ce4747e4118b628
refs/heads/master: 286f9f95fcb165919125ef51bae23ef7a9f24008
27 changes: 16 additions & 11 deletions trunk/drivers/rtc/rtc-bfin.c
Original file line number Diff line number Diff line change
Expand Up @@ -183,39 +183,44 @@ static irqreturn_t bfin_rtc_interrupt(int irq, void *dev_id)
struct bfin_rtc *rtc = dev_get_drvdata(dev);
unsigned long events = 0;
bool write_complete = false;
u16 rtc_istat, rtc_ictl;
u16 rtc_istat, rtc_istat_clear, rtc_ictl, bits;

dev_dbg_stamp(dev);

rtc_istat = bfin_read_RTC_ISTAT();
rtc_ictl = bfin_read_RTC_ICTL();
rtc_istat_clear = 0;

if (rtc_istat & RTC_ISTAT_WRITE_COMPLETE) {
bfin_write_RTC_ISTAT(RTC_ISTAT_WRITE_COMPLETE);
bits = RTC_ISTAT_WRITE_COMPLETE;
if (rtc_istat & bits) {
rtc_istat_clear |= bits;
write_complete = true;
complete(&bfin_write_complete);
}

if (rtc_ictl & (RTC_ISTAT_ALARM | RTC_ISTAT_ALARM_DAY)) {
if (rtc_istat & (RTC_ISTAT_ALARM | RTC_ISTAT_ALARM_DAY)) {
bfin_write_RTC_ISTAT(RTC_ISTAT_ALARM | RTC_ISTAT_ALARM_DAY);
bits = (RTC_ISTAT_ALARM | RTC_ISTAT_ALARM_DAY);
if (rtc_ictl & bits) {
if (rtc_istat & bits) {
rtc_istat_clear |= bits;
events |= RTC_AF | RTC_IRQF;
}
}

if (rtc_ictl & RTC_ISTAT_SEC) {
if (rtc_istat & RTC_ISTAT_SEC) {
bfin_write_RTC_ISTAT(RTC_ISTAT_SEC);
bits = RTC_ISTAT_SEC;
if (rtc_ictl & bits) {
if (rtc_istat & bits) {
rtc_istat_clear |= bits;
events |= RTC_UF | RTC_IRQF;
}
}

if (events)
rtc_update_irq(rtc->rtc_dev, 1, events);

if (write_complete || events)
if (write_complete || events) {
bfin_write_RTC_ISTAT(rtc_istat_clear);
return IRQ_HANDLED;
else
} else
return IRQ_NONE;
}

Expand Down

0 comments on commit 614b384

Please sign in to comment.