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>
This commit is contained in:
@@ -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)
|
||||
|
Reference in New Issue
Block a user