Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 263830
b: refs/heads/master
c: 88cee8f
h: refs/heads/master
v: v3
  • Loading branch information
Donggeun Kim authored and Linus Torvalds committed Sep 15, 2011
1 parent 8be837b commit d2bcde8
Show file tree
Hide file tree
Showing 2 changed files with 27 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: 7a5caabd090b8f7d782c40fc1c048d798f2b6fd7
refs/heads/master: 88cee8fd77af28d414b983798dd30c8950c71e31
26 changes: 26 additions & 0 deletions trunk/drivers/rtc/rtc-s3c.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,27 @@ static enum s3c_cpu_type s3c_rtc_cpu_type;

static DEFINE_SPINLOCK(s3c_rtc_pie_lock);

static void s3c_rtc_alarm_clk_enable(bool enable)
{
static DEFINE_SPINLOCK(s3c_rtc_alarm_clk_lock);
static bool alarm_clk_enabled;
unsigned long irq_flags;

spin_lock_irqsave(&s3c_rtc_alarm_clk_lock, irq_flags);
if (enable) {
if (!alarm_clk_enabled) {
clk_enable(rtc_clk);
alarm_clk_enabled = true;
}
} else {
if (alarm_clk_enabled) {
clk_disable(rtc_clk);
alarm_clk_enabled = false;
}
}
spin_unlock_irqrestore(&s3c_rtc_alarm_clk_lock, irq_flags);
}

/* IRQ Handlers */

static irqreturn_t s3c_rtc_alarmirq(int irq, void *id)
Expand All @@ -64,6 +85,9 @@ static irqreturn_t s3c_rtc_alarmirq(int irq, void *id)
writeb(S3C2410_INTP_ALM, s3c_rtc_base + S3C2410_INTP);

clk_disable(rtc_clk);

s3c_rtc_alarm_clk_enable(false);

return IRQ_HANDLED;
}

Expand Down Expand Up @@ -97,6 +121,8 @@ static int s3c_rtc_setaie(struct device *dev, unsigned int enabled)
writeb(tmp, s3c_rtc_base + S3C2410_RTCALM);
clk_disable(rtc_clk);

s3c_rtc_alarm_clk_enable(enabled);

return 0;
}

Expand Down

0 comments on commit d2bcde8

Please sign in to comment.