aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc/class.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/rtc/class.c')
-rw-r--r--drivers/rtc/class.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/rtc/class.c b/drivers/rtc/class.c
index e6539cbabb35..c404b61386bf 100644
--- a/drivers/rtc/class.c
+++ b/drivers/rtc/class.c
@@ -16,6 +16,7 @@
16#include <linux/kdev_t.h> 16#include <linux/kdev_t.h>
17#include <linux/idr.h> 17#include <linux/idr.h>
18#include <linux/slab.h> 18#include <linux/slab.h>
19#include <linux/workqueue.h>
19 20
20#include "rtc-core.h" 21#include "rtc-core.h"
21 22
@@ -142,6 +143,7 @@ struct rtc_device *rtc_device_register(const char *name, struct device *dev,
142 rtc->id = id; 143 rtc->id = id;
143 rtc->ops = ops; 144 rtc->ops = ops;
144 rtc->owner = owner; 145 rtc->owner = owner;
146 rtc->irq_freq = 1;
145 rtc->max_user_freq = 64; 147 rtc->max_user_freq = 64;
146 rtc->dev.parent = dev; 148 rtc->dev.parent = dev;
147 rtc->dev.class = rtc_class; 149 rtc->dev.class = rtc_class;
@@ -152,6 +154,18 @@ struct rtc_device *rtc_device_register(const char *name, struct device *dev,
152 spin_lock_init(&rtc->irq_task_lock); 154 spin_lock_init(&rtc->irq_task_lock);
153 init_waitqueue_head(&rtc->irq_queue); 155 init_waitqueue_head(&rtc->irq_queue);
154 156
157 /* Init timerqueue */
158 timerqueue_init_head(&rtc->timerqueue);
159 INIT_WORK(&rtc->irqwork, rtc_timer_do_work);
160 /* Init aie timer */
161 rtc_timer_init(&rtc->aie_timer, rtc_aie_update_irq, (void *)rtc);
162 /* Init uie timer */
163 rtc_timer_init(&rtc->uie_rtctimer, rtc_uie_update_irq, (void *)rtc);
164 /* Init pie timer */
165 hrtimer_init(&rtc->pie_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
166 rtc->pie_timer.function = rtc_pie_update_irq;
167 rtc->pie_enabled = 0;
168
155 strlcpy(rtc->name, name, RTC_DEVICE_NAME_SIZE); 169 strlcpy(rtc->name, name, RTC_DEVICE_NAME_SIZE);
156 dev_set_name(&rtc->dev, "rtc%d", id); 170 dev_set_name(&rtc->dev, "rtc%d", id);
157 171