Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 61663
b: refs/heads/master
c: 57deb52
h: refs/heads/master
i:
  61661: 3e36ba0
  61659: df37a5f
  61655: 416e848
  61647: bf86437
  61631: bacac5c
v: v3
  • Loading branch information
Alessandro Zummo authored and Linus Torvalds committed Jul 19, 2007
1 parent ce74261 commit 081ea51
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 3 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: c7d51402d2a64c5b96531f9900bb368020ebbbbb
refs/heads/master: 57deb52622f3700d154e32662f36cd5f4053f6ed
33 changes: 31 additions & 2 deletions trunk/drivers/rtc/rtc-cmos.c
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ static int cmos_set_alarm(struct device *dev, struct rtc_wkalrm *t)
return 0;
}

static int cmos_set_freq(struct device *dev, int freq)
static int cmos_irq_set_freq(struct device *dev, int freq)
{
struct cmos_rtc *cmos = dev_get_drvdata(dev);
int f;
Expand All @@ -259,6 +259,34 @@ static int cmos_set_freq(struct device *dev, int freq)
return 0;
}

static int cmos_irq_set_state(struct device *dev, int enabled)
{
struct cmos_rtc *cmos = dev_get_drvdata(dev);
unsigned char rtc_control, rtc_intr;
unsigned long flags;

if (!is_valid_irq(cmos->irq))
return -ENXIO;

spin_lock_irqsave(&rtc_lock, flags);
rtc_control = CMOS_READ(RTC_CONTROL);

if (enabled)
rtc_control |= RTC_PIE;
else
rtc_control &= ~RTC_PIE;

CMOS_WRITE(rtc_control, RTC_CONTROL);

rtc_intr = CMOS_READ(RTC_INTR_FLAGS);
rtc_intr &= (rtc_control & RTC_IRQMASK) | RTC_IRQF;
if (is_intr(rtc_intr))
rtc_update_irq(cmos->rtc, 1, rtc_intr);

spin_unlock_irqrestore(&rtc_lock, flags);
return 0;
}

#if defined(CONFIG_RTC_INTF_DEV) || defined(CONFIG_RTC_INTF_DEV_MODULE)

static int
Expand Down Expand Up @@ -360,7 +388,8 @@ static const struct rtc_class_ops cmos_rtc_ops = {
.read_alarm = cmos_read_alarm,
.set_alarm = cmos_set_alarm,
.proc = cmos_procfs,
.irq_set_freq = cmos_set_freq,
.irq_set_freq = cmos_irq_set_freq,
.irq_set_state = cmos_irq_set_state,
};

/*----------------------------------------------------------------*/
Expand Down

0 comments on commit 081ea51

Please sign in to comment.