aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc/rtc-sa1100.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/rtc/rtc-sa1100.c')
-rw-r--r--drivers/rtc/rtc-sa1100.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/drivers/rtc/rtc-sa1100.c b/drivers/rtc/rtc-sa1100.c
index 88ea52b8647a..5dfe5ffcb0d3 100644
--- a/drivers/rtc/rtc-sa1100.c
+++ b/drivers/rtc/rtc-sa1100.c
@@ -314,16 +314,6 @@ static int sa1100_rtc_ioctl(struct device *dev, unsigned int cmd,
314 unsigned long arg) 314 unsigned long arg)
315{ 315{
316 switch (cmd) { 316 switch (cmd) {
317 case RTC_AIE_OFF:
318 spin_lock_irq(&sa1100_rtc_lock);
319 RTSR &= ~RTSR_ALE;
320 spin_unlock_irq(&sa1100_rtc_lock);
321 return 0;
322 case RTC_AIE_ON:
323 spin_lock_irq(&sa1100_rtc_lock);
324 RTSR |= RTSR_ALE;
325 spin_unlock_irq(&sa1100_rtc_lock);
326 return 0;
327 case RTC_UIE_OFF: 317 case RTC_UIE_OFF:
328 spin_lock_irq(&sa1100_rtc_lock); 318 spin_lock_irq(&sa1100_rtc_lock);
329 RTSR &= ~RTSR_HZE; 319 RTSR &= ~RTSR_HZE;
@@ -338,6 +328,17 @@ static int sa1100_rtc_ioctl(struct device *dev, unsigned int cmd,
338 return -ENOIOCTLCMD; 328 return -ENOIOCTLCMD;
339} 329}
340 330
331static int sa1100_rtc_alarm_irq_enable(struct device *dev, unsigned int enabled)
332{
333 spin_lock_irq(&sa1100_rtc_lock);
334 if (enabled)
335 RTSR |= RTSR_ALE;
336 else
337 RTSR &= ~RTSR_ALE;
338 spin_unlock_irq(&sa1100_rtc_lock);
339 return 0;
340}
341
341static int sa1100_rtc_read_time(struct device *dev, struct rtc_time *tm) 342static int sa1100_rtc_read_time(struct device *dev, struct rtc_time *tm)
342{ 343{
343 rtc_time_to_tm(RCNR, tm); 344 rtc_time_to_tm(RCNR, tm);
@@ -410,6 +411,7 @@ static const struct rtc_class_ops sa1100_rtc_ops = {
410 .proc = sa1100_rtc_proc, 411 .proc = sa1100_rtc_proc,
411 .irq_set_freq = sa1100_irq_set_freq, 412 .irq_set_freq = sa1100_irq_set_freq,
412 .irq_set_state = sa1100_irq_set_state, 413 .irq_set_state = sa1100_irq_set_state,
414 .alarm_irq_enable = sa1100_rtc_alarm_irq_enable,
413}; 415};
414 416
415static int sa1100_rtc_probe(struct platform_device *pdev) 417static int sa1100_rtc_probe(struct platform_device *pdev)