summaryrefslogtreecommitdiff
path: root/drivers/rtc/rtc-mv.c
diff options
context:
space:
mode:
authorJohn Stultz <john.stultz@linaro.org>2011-02-02 17:02:41 -0800
committerJohn Stultz <john.stultz@linaro.org>2011-02-03 13:02:35 -0800
commit16380c153a69c3784d2afaddfe0a22f353046cf6 (patch)
treee923f26334d999a1e456ca80c446fbf8b1c2eedd /drivers/rtc/rtc-mv.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-mv.c')
-rw-r--r--drivers/rtc/rtc-mv.c20
1 files changed, 7 insertions, 13 deletions
diff --git a/drivers/rtc/rtc-mv.c b/drivers/rtc/rtc-mv.c
index bcca47298554..60627a764514 100644
--- a/drivers/rtc/rtc-mv.c
+++ b/drivers/rtc/rtc-mv.c
@@ -169,25 +169,19 @@ static int mv_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alm)
return 0;
}
-static int mv_rtc_ioctl(struct device *dev, unsigned int cmd,
- unsigned long arg)
+static int mv_rtc_alarm_irq_enable(struct device *dev, unsigned int enabled)
{
struct platform_device *pdev = to_platform_device(dev);
struct rtc_plat_data *pdata = platform_get_drvdata(pdev);
void __iomem *ioaddr = pdata->ioaddr;
if (pdata->irq < 0)
- return -ENOIOCTLCMD; /* fall back into rtc-dev's emulation */
- switch (cmd) {
- case RTC_AIE_OFF:
- writel(0, ioaddr + RTC_ALARM_INTERRUPT_MASK_REG_OFFS);
- break;
- case RTC_AIE_ON:
+ return -EINVAL; /* fall back into rtc-dev's emulation */
+
+ if (enabled)
writel(1, ioaddr + RTC_ALARM_INTERRUPT_MASK_REG_OFFS);
- break;
- default:
- return -ENOIOCTLCMD;
- }
+ else
+ writel(0, ioaddr + RTC_ALARM_INTERRUPT_MASK_REG_OFFS);
return 0;
}
@@ -216,7 +210,7 @@ static const struct rtc_class_ops mv_rtc_alarm_ops = {
.set_time = mv_rtc_set_time,
.read_alarm = mv_rtc_read_alarm,
.set_alarm = mv_rtc_set_alarm,
- .ioctl = mv_rtc_ioctl,
+ .alarm_irq_enable = mv_rtc_alarm_irq_enable,
};
static int __devinit mv_rtc_probe(struct platform_device *pdev)