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:
@ -259,15 +259,6 @@ static int bfin_rtc_ioctl(struct device *dev, unsigned int cmd, unsigned long ar
|
||||
bfin_rtc_int_clear(~RTC_ISTAT_SEC);
|
||||
break;
|
||||
|
||||
case RTC_AIE_ON:
|
||||
dev_dbg_stamp(dev);
|
||||
bfin_rtc_int_set_alarm(rtc);
|
||||
break;
|
||||
case RTC_AIE_OFF:
|
||||
dev_dbg_stamp(dev);
|
||||
bfin_rtc_int_clear(~(RTC_ISTAT_ALARM | RTC_ISTAT_ALARM_DAY));
|
||||
break;
|
||||
|
||||
default:
|
||||
dev_dbg_stamp(dev);
|
||||
ret = -ENOIOCTLCMD;
|
||||
@ -276,6 +267,17 @@ static int bfin_rtc_ioctl(struct device *dev, unsigned int cmd, unsigned long ar
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int bfin_rtc_alarm_irq_enable(struct device *dev, unsigned int enabled)
|
||||
{
|
||||
struct bfin_rtc *rtc = dev_get_drvdata(dev);
|
||||
|
||||
dev_dbg_stamp(dev);
|
||||
if (enabled)
|
||||
bfin_rtc_int_set_alarm(rtc);
|
||||
else
|
||||
bfin_rtc_int_clear(~(RTC_ISTAT_ALARM | RTC_ISTAT_ALARM_DAY));
|
||||
}
|
||||
|
||||
static int bfin_rtc_read_time(struct device *dev, struct rtc_time *tm)
|
||||
{
|
||||
struct bfin_rtc *rtc = dev_get_drvdata(dev);
|
||||
@ -362,6 +364,7 @@ static struct rtc_class_ops bfin_rtc_ops = {
|
||||
.read_alarm = bfin_rtc_read_alarm,
|
||||
.set_alarm = bfin_rtc_set_alarm,
|
||||
.proc = bfin_rtc_proc,
|
||||
.alarm_irq_enable = bfin_rtc_alarm_irq_enable,
|
||||
};
|
||||
|
||||
static int __devinit bfin_rtc_probe(struct platform_device *pdev)
|
||||
|
Reference in New Issue
Block a user