1 From ab2284cd4730b9ea29937ee3a0ef1bcdc6b3159d Mon Sep 17 00:00:00 2001
2 From: Alison Wang <b18965@freescale.com>
3 Date: Thu, 4 Aug 2011 09:59:54 +0800
4 Subject: [PATCH 46/52] Convert rtc drivers to use the alarm_irq_enable method
6 Old rtc drivers use the ioctl method instead of the alarm_irq_enable
7 method for enabling alarm interupts. With the new virtualized RTC
8 rework, its important for drivers to use the alarm_irq_enable instead.
10 This patch converts the drivers that use the AIE ioctl method to
11 use the alarm_irq_enable method.
13 Signed-off-by: Alison Wang <b18965@freescale.com>
15 drivers/rtc/rtc-m5441x.c | 22 +++++++++++-----------
16 drivers/rtc/rtc-mcf.c | 23 +++++++++++------------
17 2 files changed, 22 insertions(+), 23 deletions(-)
19 --- a/drivers/rtc/rtc-m5441x.c
20 +++ b/drivers/rtc/rtc-m5441x.c
21 @@ -400,17 +400,6 @@ static int mcf_rtc_ioctl(struct device *
22 writew((readw(MCF_RTC_IER) | PIE_BIT_DEF[i][1]), MCF_RTC_IER);
23 spin_unlock_irq(&rtc_lock);
26 - spin_lock_irq(&rtc_lock);
27 - writew((readw(MCF_RTC_IER) & ~MCF_RTC_ISR_ALM), MCF_RTC_IER);
28 - spin_unlock_irq(&rtc_lock);
32 - spin_lock_irq(&rtc_lock);
33 - writew((readw(MCF_RTC_IER) | MCF_RTC_ISR_ALM), MCF_RTC_IER);
34 - spin_unlock_irq(&rtc_lock);
37 case RTC_UIE_OFF: /* UIE is for the 1Hz interrupt */
38 spin_lock_irq(&rtc_lock);
39 @@ -427,6 +416,16 @@ static int mcf_rtc_ioctl(struct device *
43 +static int mcf_rtc_alarm_irq_enable(struct device *dev, unsigned int enabled)
46 + writew((readw(MCF_RTC_IER) | MCF_RTC_ISR_ALM), MCF_RTC_IER);
48 + writew((readw(MCF_RTC_IER) & ~MCF_RTC_ISR_ALM), MCF_RTC_IER);
54 * This function reads the current RTC time into tm in Gregorian date.
56 @@ -534,6 +533,7 @@ static struct rtc_class_ops mcf_rtc_ops
57 .set_time = mcf_rtc_set_time,
58 .read_alarm = mcf_rtc_read_alarm,
59 .set_alarm = mcf_rtc_set_alarm,
60 + .alarm_irq_enable = mcf_rtc_alarm_irq_enable,
63 static int __devinit mcf_rtc_probe(struct platform_device *pdev)
64 --- a/drivers/rtc/rtc-mcf.c
65 +++ b/drivers/rtc/rtc-mcf.c
66 @@ -298,18 +298,6 @@ static int mcf_rtc_ioctl(struct device *
67 writel((readl(MCF_RTC_IER) | PIE_BIT_DEF[i][1]), MCF_RTC_IER);
68 spin_unlock_irq(&rtc_lock);
71 - spin_lock_irq(&rtc_lock);
72 - writel((readl(MCF_RTC_IER) & ~MCF_RTC_ISR_ALM), MCF_RTC_IER);
73 - spin_unlock_irq(&rtc_lock);
77 - spin_lock_irq(&rtc_lock);
78 - writel((readl(MCF_RTC_IER) | MCF_RTC_ISR_ALM), MCF_RTC_IER);
79 - spin_unlock_irq(&rtc_lock);
82 case RTC_UIE_OFF: /* UIE is for the 1Hz interrupt */
83 spin_lock_irq(&rtc_lock);
84 writel((readl(MCF_RTC_IER) & ~MCF_RTC_ISR_1HZ), MCF_RTC_IER);
85 @@ -325,6 +313,16 @@ static int mcf_rtc_ioctl(struct device *
89 +static int mcf_rtc_alarm_irq_enable(struct device *dev, unsigned int enabled)
92 + writel((readl(MCF_RTC_IER) | MCF_RTC_ISR_ALM), MCF_RTC_IER);
94 + writel((readl(MCF_RTC_IER) & ~MCF_RTC_ISR_ALM), MCF_RTC_IER);
100 * This function reads the current RTC time into tm in Gregorian date.
102 @@ -466,6 +464,7 @@ static struct rtc_class_ops mcf_rtc_ops
103 .read_alarm = mcf_rtc_read_alarm,
104 .set_alarm = mcf_rtc_set_alarm,
105 .proc = mcf_rtc_proc,
106 + .alarm_irq_enable = mcf_rtc_alarm_irq_enable,
109 static int __devinit mcf_rtc_probe(struct platform_device *pdev)