summaryrefslogtreecommitdiffstats
path: root/drivers/rtc/class.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-01-11 11:06:41 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2011-01-11 11:06:41 -0800
commit5943a268002fce97885f2ca08827ff1b0312068c (patch)
tree5e304e79b68263e799224ebb1a08ead474ab299b /drivers/rtc/class.c
parent42776163e13a56ea3096edff7a5df95408e80eb4 (diff)
parent96c8f06a0fb359a9a89701a7afab6d837e466ab0 (diff)
downloadblackbird-op-linux-5943a268002fce97885f2ca08827ff1b0312068c.tar.gz
blackbird-op-linux-5943a268002fce97885f2ca08827ff1b0312068c.zip
Merge branch 'timers-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'timers-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: rtc: Namespace fixup RTC: Remove UIE emulation RTC: Rework RTC code to use timerqueue for events Fix up trivial conflict in drivers/rtc/rtc-dev.c
Diffstat (limited to 'drivers/rtc/class.c')
-rw-r--r--drivers/rtc/class.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/rtc/class.c b/drivers/rtc/class.c
index e6539cbabb35..9583cbcc6b79 100644
--- a/drivers/rtc/class.c
+++ b/drivers/rtc/class.c
@@ -16,6 +16,7 @@
#include <linux/kdev_t.h>
#include <linux/idr.h>
#include <linux/slab.h>
+#include <linux/workqueue.h>
#include "rtc-core.h"
@@ -152,6 +153,18 @@ struct rtc_device *rtc_device_register(const char *name, struct device *dev,
spin_lock_init(&rtc->irq_task_lock);
init_waitqueue_head(&rtc->irq_queue);
+ /* Init timerqueue */
+ timerqueue_init_head(&rtc->timerqueue);
+ INIT_WORK(&rtc->irqwork, rtc_timer_do_work);
+ /* Init aie timer */
+ rtc_timer_init(&rtc->aie_timer, rtc_aie_update_irq, (void *)rtc);
+ /* Init uie timer */
+ rtc_timer_init(&rtc->uie_rtctimer, rtc_uie_update_irq, (void *)rtc);
+ /* Init pie timer */
+ hrtimer_init(&rtc->pie_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
+ rtc->pie_timer.function = rtc_pie_update_irq;
+ rtc->pie_enabled = 0;
+
strlcpy(rtc->name, name, RTC_DEVICE_NAME_SIZE);
dev_set_name(&rtc->dev, "rtc%d", id);
OpenPOWER on IntegriCloud