aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc/rtc-sh.c
diff options
context:
space:
mode:
authorJohn Stultz <john.stultz@linaro.org>2011-02-02 20:02:41 -0500
committerJohn Stultz <john.stultz@linaro.org>2011-02-03 16:02:35 -0500
commit16380c153a69c3784d2afaddfe0a22f353046cf6 (patch)
treee923f26334d999a1e456ca80c446fbf8b1c2eedd /drivers/rtc/rtc-sh.c
parentac54cd2bd5b4db4f1c03392d63daf355627ea180 (diff)
RTC: Convert rtc drivers to use the alarm_irq_enable method
Some rtc drivers use the ioctl method instead of the alarm_irq_enable method for enabling alarm interupts. With the new virtualized RTC rework, its important for drivers to use the alarm_irq_enable instead. This patch converts the drivers that use the AIE ioctl method to use the alarm_irq_enable method. Other ioctl cmds are left untouched. I have not been able to test or even compile most of these drivers. Any help to make sure this change is correct would be appreciated! CC: Alessandro Zummo <a.zummo@towertech.it> CC: Thomas Gleixner <tglx@linutronix.de> CC: Marcelo Roberto Jimenez <mroberto@cpti.cetuc.puc-rio.br> Reported-by: Marcelo Roberto Jimenez <mroberto@cpti.cetuc.puc-rio.br> Tested-by: Marcelo Roberto Jimenez <mroberto@cpti.cetuc.puc-rio.br> Signed-off-by: John Stultz <john.stultz@linaro.org>
Diffstat (limited to 'drivers/rtc/rtc-sh.c')
-rw-r--r--drivers/rtc/rtc-sh.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/rtc/rtc-sh.c b/drivers/rtc/rtc-sh.c
index 06e41ed93230..93314a9e7fa9 100644
--- a/drivers/rtc/rtc-sh.c
+++ b/drivers/rtc/rtc-sh.c
@@ -350,10 +350,6 @@ static int sh_rtc_ioctl(struct device *dev, unsigned int cmd, unsigned long arg)
350 unsigned int ret = 0; 350 unsigned int ret = 0;
351 351
352 switch (cmd) { 352 switch (cmd) {
353 case RTC_AIE_OFF:
354 case RTC_AIE_ON:
355 sh_rtc_setaie(dev, cmd == RTC_AIE_ON);
356 break;
357 case RTC_UIE_OFF: 353 case RTC_UIE_OFF:
358 rtc->periodic_freq &= ~PF_OXS; 354 rtc->periodic_freq &= ~PF_OXS;
359 sh_rtc_setcie(dev, 0); 355 sh_rtc_setcie(dev, 0);
@@ -369,6 +365,12 @@ static int sh_rtc_ioctl(struct device *dev, unsigned int cmd, unsigned long arg)
369 return ret; 365 return ret;
370} 366}
371 367
368static int sh_rtc_alarm_irq_enable(struct device *dev, unsigned int enabled)
369{
370 sh_rtc_setaie(dev, enabled);
371 return 0;
372}
373
372static int sh_rtc_read_time(struct device *dev, struct rtc_time *tm) 374static int sh_rtc_read_time(struct device *dev, struct rtc_time *tm)
373{ 375{
374 struct platform_device *pdev = to_platform_device(dev); 376 struct platform_device *pdev = to_platform_device(dev);
@@ -604,6 +606,7 @@ static struct rtc_class_ops sh_rtc_ops = {
604 .irq_set_state = sh_rtc_irq_set_state, 606 .irq_set_state = sh_rtc_irq_set_state,
605 .irq_set_freq = sh_rtc_irq_set_freq, 607 .irq_set_freq = sh_rtc_irq_set_freq,
606 .proc = sh_rtc_proc, 608 .proc = sh_rtc_proc,
609 .alarm_irq_enable = sh_rtc_alarm_irq_enable,
607}; 610};
608 611
609static int __init sh_rtc_probe(struct platform_device *pdev) 612static int __init sh_rtc_probe(struct platform_device *pdev)