Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 139225
b: refs/heads/master
c: 47367a3
h: refs/heads/master
i:
  139223: a11fbd2
v: v3
  • Loading branch information
Mark Brown authored and Linus Torvalds committed Apr 1, 2009
1 parent f4f4d60 commit 8988266
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 22 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: 79955898f961a870cbcc58f6ae13f3741a909da5
refs/heads/master: 47367a3ba425d70467af0009782098235ddbf204
39 changes: 18 additions & 21 deletions trunk/drivers/rtc/rtc-wm8350.c
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,17 @@ static int wm8350_rtc_start_alarm(struct wm8350 *wm8350)
return 0;
}

static int wm8350_rtc_alarm_irq_enable(struct device *dev,
unsigned int enabled)
{
struct wm8350 *wm8350 = dev_get_drvdata(dev);

if (enabled)
return wm8350_rtc_start_alarm(wm8350);
else
return wm8350_rtc_stop_alarm(wm8350);
}

static int wm8350_rtc_setalarm(struct device *dev, struct rtc_wkalrm *alrm)
{
struct wm8350 *wm8350 = dev_get_drvdata(dev);
Expand Down Expand Up @@ -291,30 +302,15 @@ static int wm8350_rtc_setalarm(struct device *dev, struct rtc_wkalrm *alrm)
return ret;
}

/*
* Handle commands from user-space
*/
static int wm8350_rtc_ioctl(struct device *dev, unsigned int cmd,
unsigned long arg)
static int wm8350_rtc_update_irq_enable(struct device *dev,
unsigned int enabled)
{
struct wm8350 *wm8350 = dev_get_drvdata(dev);

switch (cmd) {
case RTC_AIE_OFF:
return wm8350_rtc_stop_alarm(wm8350);
case RTC_AIE_ON:
return wm8350_rtc_start_alarm(wm8350);

case RTC_UIE_OFF:
wm8350_mask_irq(wm8350, WM8350_IRQ_RTC_SEC);
break;
case RTC_UIE_ON:
if (enabled)
wm8350_unmask_irq(wm8350, WM8350_IRQ_RTC_SEC);
break;

default:
return -ENOIOCTLCMD;
}
else
wm8350_mask_irq(wm8350, WM8350_IRQ_RTC_SEC);

return 0;
}
Expand Down Expand Up @@ -345,11 +341,12 @@ static void wm8350_rtc_update_handler(struct wm8350 *wm8350, int irq,
}

static const struct rtc_class_ops wm8350_rtc_ops = {
.ioctl = wm8350_rtc_ioctl,
.read_time = wm8350_rtc_readtime,
.set_time = wm8350_rtc_settime,
.read_alarm = wm8350_rtc_readalarm,
.set_alarm = wm8350_rtc_setalarm,
.alarm_irq_enable = wm8350_rtc_alarm_irq_enable,
.update_irq_enable = wm8350_rtc_update_irq_enable,
};

#ifdef CONFIG_PM
Expand Down

0 comments on commit 8988266

Please sign in to comment.