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:
parent
ac54cd2bd5
commit
16380c153a
18 changed files with 223 additions and 297 deletions
|
@ -240,26 +240,6 @@ static int vr41xx_rtc_irq_set_state(struct device *dev, int enabled)
|
|||
static int vr41xx_rtc_ioctl(struct device *dev, unsigned int cmd, unsigned long arg)
|
||||
{
|
||||
switch (cmd) {
|
||||
case RTC_AIE_ON:
|
||||
spin_lock_irq(&rtc_lock);
|
||||
|
||||
if (!alarm_enabled) {
|
||||
enable_irq(aie_irq);
|
||||
alarm_enabled = 1;
|
||||
}
|
||||
|
||||
spin_unlock_irq(&rtc_lock);
|
||||
break;
|
||||
case RTC_AIE_OFF:
|
||||
spin_lock_irq(&rtc_lock);
|
||||
|
||||
if (alarm_enabled) {
|
||||
disable_irq(aie_irq);
|
||||
alarm_enabled = 0;
|
||||
}
|
||||
|
||||
spin_unlock_irq(&rtc_lock);
|
||||
break;
|
||||
case RTC_EPOCH_READ:
|
||||
return put_user(epoch, (unsigned long __user *)arg);
|
||||
case RTC_EPOCH_SET:
|
||||
|
@ -275,6 +255,24 @@ static int vr41xx_rtc_ioctl(struct device *dev, unsigned int cmd, unsigned long
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int vr41xx_rtc_alarm_irq_enable(struct device *dev, unsigned int enabled)
|
||||
{
|
||||
spin_lock_irq(&rtc_lock);
|
||||
if (enabled) {
|
||||
if (!alarm_enabled) {
|
||||
enable_irq(aie_irq);
|
||||
alarm_enabled = 1;
|
||||
}
|
||||
} else {
|
||||
if (alarm_enabled) {
|
||||
disable_irq(aie_irq);
|
||||
alarm_enabled = 0;
|
||||
}
|
||||
}
|
||||
spin_unlock_irq(&rtc_lock);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static irqreturn_t elapsedtime_interrupt(int irq, void *dev_id)
|
||||
{
|
||||
struct platform_device *pdev = (struct platform_device *)dev_id;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue