aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc/rtc-vr41xx.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/rtc/rtc-vr41xx.c')
-rw-r--r--drivers/rtc/rtc-vr41xx.c38
1 files changed, 18 insertions, 20 deletions
diff --git a/drivers/rtc/rtc-vr41xx.c b/drivers/rtc/rtc-vr41xx.c
index c3244244e8cf..769190ac6d11 100644
--- a/drivers/rtc/rtc-vr41xx.c
+++ b/drivers/rtc/rtc-vr41xx.c
@@ -240,26 +240,6 @@ static int vr41xx_rtc_irq_set_state(struct device *dev, int enabled)
240static int vr41xx_rtc_ioctl(struct device *dev, unsigned int cmd, unsigned long arg) 240static int vr41xx_rtc_ioctl(struct device *dev, unsigned int cmd, unsigned long arg)
241{ 241{
242 switch (cmd) { 242 switch (cmd) {
243 case RTC_AIE_ON:
244 spin_lock_irq(&rtc_lock);
245
246 if (!alarm_enabled) {
247 enable_irq(aie_irq);
248 alarm_enabled = 1;
249 }
250
251 spin_unlock_irq(&rtc_lock);
252 break;
253 case RTC_AIE_OFF:
254 spin_lock_irq(&rtc_lock);
255
256 if (alarm_enabled) {
257 disable_irq(aie_irq);
258 alarm_enabled = 0;
259 }
260
261 spin_unlock_irq(&rtc_lock);
262 break;
263 case RTC_EPOCH_READ: 243 case RTC_EPOCH_READ:
264 return put_user(epoch, (unsigned long __user *)arg); 244 return put_user(epoch, (unsigned long __user *)arg);
265 case RTC_EPOCH_SET: 245 case RTC_EPOCH_SET:
@@ -275,6 +255,24 @@ static int vr41xx_rtc_ioctl(struct device *dev, unsigned int cmd, unsigned long
275 return 0; 255 return 0;
276} 256}
277 257
258static int vr41xx_rtc_alarm_irq_enable(struct device *dev, unsigned int enabled)
259{
260 spin_lock_irq(&rtc_lock);
261 if (enabled) {
262 if (!alarm_enabled) {
263 enable_irq(aie_irq);
264 alarm_enabled = 1;
265 }
266 } else {
267 if (alarm_enabled) {
268 disable_irq(aie_irq);
269 alarm_enabled = 0;
270 }
271 }
272 spin_unlock_irq(&rtc_lock);
273 return 0;
274}
275
278static irqreturn_t elapsedtime_interrupt(int irq, void *dev_id) 276static irqreturn_t elapsedtime_interrupt(int irq, void *dev_id)
279{ 277{
280 struct platform_device *pdev = (struct platform_device *)dev_id; 278 struct platform_device *pdev = (struct platform_device *)dev_id;