aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc/interface.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/rtc/interface.c')
-rw-r--r--drivers/rtc/interface.c42
1 files changed, 21 insertions, 21 deletions
diff --git a/drivers/rtc/interface.c b/drivers/rtc/interface.c
index c81c50b497b7..90384b9f6b2c 100644
--- a/drivers/rtc/interface.c
+++ b/drivers/rtc/interface.c
@@ -174,14 +174,14 @@ int rtc_set_alarm(struct rtc_device *rtc, struct rtc_wkalrm *alarm)
174 if (err) 174 if (err)
175 return err; 175 return err;
176 if (rtc->aie_timer.enabled) { 176 if (rtc->aie_timer.enabled) {
177 rtctimer_remove(rtc, &rtc->aie_timer); 177 rtc_timer_remove(rtc, &rtc->aie_timer);
178 rtc->aie_timer.enabled = 0; 178 rtc->aie_timer.enabled = 0;
179 } 179 }
180 rtc->aie_timer.node.expires = rtc_tm_to_ktime(alarm->time); 180 rtc->aie_timer.node.expires = rtc_tm_to_ktime(alarm->time);
181 rtc->aie_timer.period = ktime_set(0, 0); 181 rtc->aie_timer.period = ktime_set(0, 0);
182 if (alarm->enabled) { 182 if (alarm->enabled) {
183 rtc->aie_timer.enabled = 1; 183 rtc->aie_timer.enabled = 1;
184 rtctimer_enqueue(rtc, &rtc->aie_timer); 184 rtc_timer_enqueue(rtc, &rtc->aie_timer);
185 } 185 }
186 mutex_unlock(&rtc->ops_lock); 186 mutex_unlock(&rtc->ops_lock);
187 return 0; 187 return 0;
@@ -197,9 +197,9 @@ int rtc_alarm_irq_enable(struct rtc_device *rtc, unsigned int enabled)
197 if (rtc->aie_timer.enabled != enabled) { 197 if (rtc->aie_timer.enabled != enabled) {
198 if (enabled) { 198 if (enabled) {
199 rtc->aie_timer.enabled = 1; 199 rtc->aie_timer.enabled = 1;
200 rtctimer_enqueue(rtc, &rtc->aie_timer); 200 rtc_timer_enqueue(rtc, &rtc->aie_timer);
201 } else { 201 } else {
202 rtctimer_remove(rtc, &rtc->aie_timer); 202 rtc_timer_remove(rtc, &rtc->aie_timer);
203 rtc->aie_timer.enabled = 0; 203 rtc->aie_timer.enabled = 0;
204 } 204 }
205 } 205 }
@@ -236,9 +236,9 @@ int rtc_update_irq_enable(struct rtc_device *rtc, unsigned int enabled)
236 rtc->uie_rtctimer.node.expires = ktime_add(now, onesec); 236 rtc->uie_rtctimer.node.expires = ktime_add(now, onesec);
237 rtc->uie_rtctimer.period = ktime_set(1, 0); 237 rtc->uie_rtctimer.period = ktime_set(1, 0);
238 rtc->uie_rtctimer.enabled = 1; 238 rtc->uie_rtctimer.enabled = 1;
239 rtctimer_enqueue(rtc, &rtc->uie_rtctimer); 239 rtc_timer_enqueue(rtc, &rtc->uie_rtctimer);
240 } else { 240 } else {
241 rtctimer_remove(rtc, &rtc->uie_rtctimer); 241 rtc_timer_remove(rtc, &rtc->uie_rtctimer);
242 rtc->uie_rtctimer.enabled = 0; 242 rtc->uie_rtctimer.enabled = 0;
243 } 243 }
244 244
@@ -481,7 +481,7 @@ int rtc_irq_set_freq(struct rtc_device *rtc, struct rtc_task *task, int freq)
481EXPORT_SYMBOL_GPL(rtc_irq_set_freq); 481EXPORT_SYMBOL_GPL(rtc_irq_set_freq);
482 482
483/** 483/**
484 * rtctimer_enqueue - Adds a rtc_timer to the rtc_device timerqueue 484 * rtc_timer_enqueue - Adds a rtc_timer to the rtc_device timerqueue
485 * @rtc rtc device 485 * @rtc rtc device
486 * @timer timer being added. 486 * @timer timer being added.
487 * 487 *
@@ -490,7 +490,7 @@ EXPORT_SYMBOL_GPL(rtc_irq_set_freq);
490 * 490 *
491 * Must hold ops_lock for proper serialization of timerqueue 491 * Must hold ops_lock for proper serialization of timerqueue
492 */ 492 */
493void rtctimer_enqueue(struct rtc_device *rtc, struct rtc_timer *timer) 493void rtc_timer_enqueue(struct rtc_device *rtc, struct rtc_timer *timer)
494{ 494{
495 timerqueue_add(&rtc->timerqueue, &timer->node); 495 timerqueue_add(&rtc->timerqueue, &timer->node);
496 if (&timer->node == timerqueue_getnext(&rtc->timerqueue)) { 496 if (&timer->node == timerqueue_getnext(&rtc->timerqueue)) {
@@ -505,7 +505,7 @@ void rtctimer_enqueue(struct rtc_device *rtc, struct rtc_timer *timer)
505} 505}
506 506
507/** 507/**
508 * rtctimer_remove - Removes a rtc_timer from the rtc_device timerqueue 508 * rtc_timer_remove - Removes a rtc_timer from the rtc_device timerqueue
509 * @rtc rtc device 509 * @rtc rtc device
510 * @timer timer being removed. 510 * @timer timer being removed.
511 * 511 *
@@ -514,7 +514,7 @@ void rtctimer_enqueue(struct rtc_device *rtc, struct rtc_timer *timer)
514 * 514 *
515 * Must hold ops_lock for proper serialization of timerqueue 515 * Must hold ops_lock for proper serialization of timerqueue
516 */ 516 */
517void rtctimer_remove(struct rtc_device *rtc, struct rtc_timer *timer) 517void rtc_timer_remove(struct rtc_device *rtc, struct rtc_timer *timer)
518{ 518{
519 struct timerqueue_node *next = timerqueue_getnext(&rtc->timerqueue); 519 struct timerqueue_node *next = timerqueue_getnext(&rtc->timerqueue);
520 timerqueue_del(&rtc->timerqueue, &timer->node); 520 timerqueue_del(&rtc->timerqueue, &timer->node);
@@ -534,7 +534,7 @@ void rtctimer_remove(struct rtc_device *rtc, struct rtc_timer *timer)
534} 534}
535 535
536/** 536/**
537 * rtctimer_do_work - Expires rtc timers 537 * rtc_timer_do_work - Expires rtc timers
538 * @rtc rtc device 538 * @rtc rtc device
539 * @timer timer being removed. 539 * @timer timer being removed.
540 * 540 *
@@ -543,7 +543,7 @@ void rtctimer_remove(struct rtc_device *rtc, struct rtc_timer *timer)
543 * 543 *
544 * Serializes access to timerqueue via ops_lock mutex 544 * Serializes access to timerqueue via ops_lock mutex
545 */ 545 */
546void rtctimer_do_work(struct work_struct *work) 546void rtc_timer_do_work(struct work_struct *work)
547{ 547{
548 struct rtc_timer *timer; 548 struct rtc_timer *timer;
549 struct timerqueue_node *next; 549 struct timerqueue_node *next;
@@ -592,14 +592,14 @@ again:
592} 592}
593 593
594 594
595/* rtctimer_init - Initializes an rtc_timer 595/* rtc_timer_init - Initializes an rtc_timer
596 * @timer: timer to be intiialized 596 * @timer: timer to be intiialized
597 * @f: function pointer to be called when timer fires 597 * @f: function pointer to be called when timer fires
598 * @data: private data passed to function pointer 598 * @data: private data passed to function pointer
599 * 599 *
600 * Kernel interface to initializing an rtc_timer. 600 * Kernel interface to initializing an rtc_timer.
601 */ 601 */
602void rtctimer_init(struct rtc_timer *timer, void (*f)(void* p), void* data) 602void rtc_timer_init(struct rtc_timer *timer, void (*f)(void* p), void* data)
603{ 603{
604 timerqueue_init(&timer->node); 604 timerqueue_init(&timer->node);
605 timer->enabled = 0; 605 timer->enabled = 0;
@@ -607,7 +607,7 @@ void rtctimer_init(struct rtc_timer *timer, void (*f)(void* p), void* data)
607 timer->task.private_data = data; 607 timer->task.private_data = data;
608} 608}
609 609
610/* rtctimer_start - Sets an rtc_timer to fire in the future 610/* rtc_timer_start - Sets an rtc_timer to fire in the future
611 * @ rtc: rtc device to be used 611 * @ rtc: rtc device to be used
612 * @ timer: timer being set 612 * @ timer: timer being set
613 * @ expires: time at which to expire the timer 613 * @ expires: time at which to expire the timer
@@ -615,36 +615,36 @@ void rtctimer_init(struct rtc_timer *timer, void (*f)(void* p), void* data)
615 * 615 *
616 * Kernel interface to set an rtc_timer 616 * Kernel interface to set an rtc_timer
617 */ 617 */
618int rtctimer_start(struct rtc_device *rtc, struct rtc_timer* timer, 618int rtc_timer_start(struct rtc_device *rtc, struct rtc_timer* timer,
619 ktime_t expires, ktime_t period) 619 ktime_t expires, ktime_t period)
620{ 620{
621 int ret = 0; 621 int ret = 0;
622 mutex_lock(&rtc->ops_lock); 622 mutex_lock(&rtc->ops_lock);
623 if (timer->enabled) 623 if (timer->enabled)
624 rtctimer_remove(rtc, timer); 624 rtc_timer_remove(rtc, timer);
625 625
626 timer->node.expires = expires; 626 timer->node.expires = expires;
627 timer->period = period; 627 timer->period = period;
628 628
629 timer->enabled = 1; 629 timer->enabled = 1;
630 rtctimer_enqueue(rtc, timer); 630 rtc_timer_enqueue(rtc, timer);
631 631
632 mutex_unlock(&rtc->ops_lock); 632 mutex_unlock(&rtc->ops_lock);
633 return ret; 633 return ret;
634} 634}
635 635
636/* rtctimer_cancel - Stops an rtc_timer 636/* rtc_timer_cancel - Stops an rtc_timer
637 * @ rtc: rtc device to be used 637 * @ rtc: rtc device to be used
638 * @ timer: timer being set 638 * @ timer: timer being set
639 * 639 *
640 * Kernel interface to cancel an rtc_timer 640 * Kernel interface to cancel an rtc_timer
641 */ 641 */
642int rtctimer_cancel(struct rtc_device *rtc, struct rtc_timer* timer) 642int rtc_timer_cancel(struct rtc_device *rtc, struct rtc_timer* timer)
643{ 643{
644 int ret = 0; 644 int ret = 0;
645 mutex_lock(&rtc->ops_lock); 645 mutex_lock(&rtc->ops_lock);
646 if (timer->enabled) 646 if (timer->enabled)
647 rtctimer_remove(rtc, timer); 647 rtc_timer_remove(rtc, timer);
648 timer->enabled = 0; 648 timer->enabled = 0;
649 mutex_unlock(&rtc->ops_lock); 649 mutex_unlock(&rtc->ops_lock);
650 return ret; 650 return ret;