Arve Hjønnevåg | 841cb11 | 2012-02-09 14:24:30 -0800 | [diff] [blame] | 1 | /* drivers/rtc/alarm-dev.c |
| 2 | * |
| 3 | * Copyright (C) 2007-2009 Google, Inc. |
| 4 | * |
| 5 | * This software is licensed under the terms of the GNU General Public |
| 6 | * License version 2, as published by the Free Software Foundation, and |
| 7 | * may be copied, distributed, and modified under those terms. |
| 8 | * |
| 9 | * This program is distributed in the hope that it will be useful, |
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | * GNU General Public License for more details. |
| 13 | * |
| 14 | */ |
| 15 | |
John Stultz | d47908b | 2012-02-09 14:24:33 -0800 | [diff] [blame] | 16 | #include <linux/time.h> |
Andy Green | bf647ea | 2012-02-09 14:24:32 -0800 | [diff] [blame] | 17 | #include <linux/module.h> |
Arve Hjønnevåg | 841cb11 | 2012-02-09 14:24:30 -0800 | [diff] [blame] | 18 | #include <linux/device.h> |
| 19 | #include <linux/miscdevice.h> |
| 20 | #include <linux/fs.h> |
| 21 | #include <linux/platform_device.h> |
| 22 | #include <linux/sched.h> |
| 23 | #include <linux/spinlock.h> |
Arve Hjønnevåg | 841cb11 | 2012-02-09 14:24:30 -0800 | [diff] [blame] | 24 | #include <linux/uaccess.h> |
John Stultz | b8793260 | 2012-04-20 12:31:46 -0700 | [diff] [blame] | 25 | #include <linux/alarmtimer.h> |
Arve Hjønnevåg | 841cb11 | 2012-02-09 14:24:30 -0800 | [diff] [blame] | 26 | #include "android_alarm.h" |
| 27 | |
| 28 | #define ANDROID_ALARM_PRINT_INFO (1U << 0) |
| 29 | #define ANDROID_ALARM_PRINT_IO (1U << 1) |
| 30 | #define ANDROID_ALARM_PRINT_INT (1U << 2) |
| 31 | |
| 32 | static int debug_mask = ANDROID_ALARM_PRINT_INFO; |
| 33 | module_param_named(debug_mask, debug_mask, int, S_IRUGO | S_IWUSR | S_IWGRP); |
| 34 | |
Joe Perches | 8a7245e | 2012-05-20 14:06:36 -0700 | [diff] [blame] | 35 | #define alarm_dbg(debug_level_mask, fmt, ...) \ |
| 36 | do { \ |
| 37 | if (debug_mask & ANDROID_ALARM_PRINT_##debug_level_mask) \ |
| 38 | pr_info(fmt, ##__VA_ARGS__); \ |
| 39 | } while (0) |
Arve Hjønnevåg | 841cb11 | 2012-02-09 14:24:30 -0800 | [diff] [blame] | 40 | |
| 41 | #define ANDROID_ALARM_WAKEUP_MASK ( \ |
| 42 | ANDROID_ALARM_RTC_WAKEUP_MASK | \ |
| 43 | ANDROID_ALARM_ELAPSED_REALTIME_WAKEUP_MASK) |
| 44 | |
Masanari Iida | ad220db | 2012-04-17 00:26:29 +0900 | [diff] [blame] | 45 | /* support old userspace code */ |
Arve Hjønnevåg | 841cb11 | 2012-02-09 14:24:30 -0800 | [diff] [blame] | 46 | #define ANDROID_ALARM_SET_OLD _IOW('a', 2, time_t) /* set alarm */ |
| 47 | #define ANDROID_ALARM_SET_AND_WAIT_OLD _IOW('a', 3, time_t) |
| 48 | |
| 49 | static int alarm_opened; |
| 50 | static DEFINE_SPINLOCK(alarm_slock); |
John Stultz | a180c0d | 2012-04-24 10:57:16 -0700 | [diff] [blame] | 51 | static struct wakeup_source alarm_wake_lock; |
Arve Hjønnevåg | 841cb11 | 2012-02-09 14:24:30 -0800 | [diff] [blame] | 52 | static DECLARE_WAIT_QUEUE_HEAD(alarm_wait_queue); |
| 53 | static uint32_t alarm_pending; |
| 54 | static uint32_t alarm_enabled; |
| 55 | static uint32_t wait_pending; |
| 56 | |
John Stultz | b8793260 | 2012-04-20 12:31:46 -0700 | [diff] [blame] | 57 | struct devalarm { |
| 58 | union { |
| 59 | struct hrtimer hrt; |
| 60 | struct alarm alrm; |
| 61 | } u; |
| 62 | enum android_alarm_type type; |
| 63 | }; |
| 64 | |
| 65 | static struct devalarm alarms[ANDROID_ALARM_TYPE_COUNT]; |
| 66 | |
| 67 | |
| 68 | static int is_wakeup(enum android_alarm_type type) |
| 69 | { |
Dae S. Kim | 147cd16 | 2012-08-29 17:08:33 +0200 | [diff] [blame] | 70 | return (type == ANDROID_ALARM_RTC_WAKEUP || |
| 71 | type == ANDROID_ALARM_ELAPSED_REALTIME_WAKEUP); |
John Stultz | b8793260 | 2012-04-20 12:31:46 -0700 | [diff] [blame] | 72 | } |
| 73 | |
| 74 | |
| 75 | static void devalarm_start(struct devalarm *alrm, ktime_t exp) |
| 76 | { |
| 77 | if (is_wakeup(alrm->type)) |
| 78 | alarm_start(&alrm->u.alrm, exp); |
| 79 | else |
| 80 | hrtimer_start(&alrm->u.hrt, exp, HRTIMER_MODE_ABS); |
| 81 | } |
| 82 | |
| 83 | |
| 84 | static int devalarm_try_to_cancel(struct devalarm *alrm) |
| 85 | { |
John Stultz | b8793260 | 2012-04-20 12:31:46 -0700 | [diff] [blame] | 86 | if (is_wakeup(alrm->type)) |
Dae S. Kim | 147cd16 | 2012-08-29 17:08:33 +0200 | [diff] [blame] | 87 | return alarm_try_to_cancel(&alrm->u.alrm); |
| 88 | return hrtimer_try_to_cancel(&alrm->u.hrt); |
John Stultz | b8793260 | 2012-04-20 12:31:46 -0700 | [diff] [blame] | 89 | } |
| 90 | |
| 91 | static void devalarm_cancel(struct devalarm *alrm) |
| 92 | { |
| 93 | if (is_wakeup(alrm->type)) |
| 94 | alarm_cancel(&alrm->u.alrm); |
| 95 | else |
| 96 | hrtimer_cancel(&alrm->u.hrt); |
| 97 | } |
| 98 | |
Arve Hjønnevåg | 841cb11 | 2012-02-09 14:24:30 -0800 | [diff] [blame] | 99 | |
| 100 | static long alarm_ioctl(struct file *file, unsigned int cmd, unsigned long arg) |
| 101 | { |
| 102 | int rv = 0; |
| 103 | unsigned long flags; |
| 104 | struct timespec new_alarm_time; |
| 105 | struct timespec new_rtc_time; |
| 106 | struct timespec tmp_time; |
John Stultz | b8793260 | 2012-04-20 12:31:46 -0700 | [diff] [blame] | 107 | struct rtc_time new_rtc_tm; |
| 108 | struct rtc_device *rtc_dev; |
Arve Hjønnevåg | 841cb11 | 2012-02-09 14:24:30 -0800 | [diff] [blame] | 109 | enum android_alarm_type alarm_type = ANDROID_ALARM_IOCTL_TO_TYPE(cmd); |
| 110 | uint32_t alarm_type_mask = 1U << alarm_type; |
| 111 | |
| 112 | if (alarm_type >= ANDROID_ALARM_TYPE_COUNT) |
| 113 | return -EINVAL; |
| 114 | |
| 115 | if (ANDROID_ALARM_BASE_CMD(cmd) != ANDROID_ALARM_GET_TIME(0)) { |
| 116 | if ((file->f_flags & O_ACCMODE) == O_RDONLY) |
| 117 | return -EPERM; |
| 118 | if (file->private_data == NULL && |
| 119 | cmd != ANDROID_ALARM_SET_RTC) { |
| 120 | spin_lock_irqsave(&alarm_slock, flags); |
| 121 | if (alarm_opened) { |
| 122 | spin_unlock_irqrestore(&alarm_slock, flags); |
| 123 | return -EBUSY; |
| 124 | } |
| 125 | alarm_opened = 1; |
| 126 | file->private_data = (void *)1; |
| 127 | spin_unlock_irqrestore(&alarm_slock, flags); |
| 128 | } |
| 129 | } |
| 130 | |
| 131 | switch (ANDROID_ALARM_BASE_CMD(cmd)) { |
| 132 | case ANDROID_ALARM_CLEAR(0): |
| 133 | spin_lock_irqsave(&alarm_slock, flags); |
Joe Perches | 8a7245e | 2012-05-20 14:06:36 -0700 | [diff] [blame] | 134 | alarm_dbg(IO, "alarm %d clear\n", alarm_type); |
John Stultz | b8793260 | 2012-04-20 12:31:46 -0700 | [diff] [blame] | 135 | devalarm_try_to_cancel(&alarms[alarm_type]); |
Arve Hjønnevåg | 841cb11 | 2012-02-09 14:24:30 -0800 | [diff] [blame] | 136 | if (alarm_pending) { |
| 137 | alarm_pending &= ~alarm_type_mask; |
| 138 | if (!alarm_pending && !wait_pending) |
John Stultz | a180c0d | 2012-04-24 10:57:16 -0700 | [diff] [blame] | 139 | __pm_relax(&alarm_wake_lock); |
Arve Hjønnevåg | 841cb11 | 2012-02-09 14:24:30 -0800 | [diff] [blame] | 140 | } |
| 141 | alarm_enabled &= ~alarm_type_mask; |
| 142 | spin_unlock_irqrestore(&alarm_slock, flags); |
| 143 | break; |
| 144 | |
| 145 | case ANDROID_ALARM_SET_OLD: |
| 146 | case ANDROID_ALARM_SET_AND_WAIT_OLD: |
| 147 | if (get_user(new_alarm_time.tv_sec, (int __user *)arg)) { |
| 148 | rv = -EFAULT; |
| 149 | goto err1; |
| 150 | } |
| 151 | new_alarm_time.tv_nsec = 0; |
| 152 | goto from_old_alarm_set; |
| 153 | |
| 154 | case ANDROID_ALARM_SET_AND_WAIT(0): |
| 155 | case ANDROID_ALARM_SET(0): |
| 156 | if (copy_from_user(&new_alarm_time, (void __user *)arg, |
| 157 | sizeof(new_alarm_time))) { |
| 158 | rv = -EFAULT; |
| 159 | goto err1; |
| 160 | } |
| 161 | from_old_alarm_set: |
| 162 | spin_lock_irqsave(&alarm_slock, flags); |
Joe Perches | 8a7245e | 2012-05-20 14:06:36 -0700 | [diff] [blame] | 163 | alarm_dbg(IO, "alarm %d set %ld.%09ld\n", |
| 164 | alarm_type, |
| 165 | new_alarm_time.tv_sec, new_alarm_time.tv_nsec); |
Arve Hjønnevåg | 841cb11 | 2012-02-09 14:24:30 -0800 | [diff] [blame] | 166 | alarm_enabled |= alarm_type_mask; |
John Stultz | b8793260 | 2012-04-20 12:31:46 -0700 | [diff] [blame] | 167 | devalarm_start(&alarms[alarm_type], |
Arve Hjønnevåg | 841cb11 | 2012-02-09 14:24:30 -0800 | [diff] [blame] | 168 | timespec_to_ktime(new_alarm_time)); |
| 169 | spin_unlock_irqrestore(&alarm_slock, flags); |
| 170 | if (ANDROID_ALARM_BASE_CMD(cmd) != ANDROID_ALARM_SET_AND_WAIT(0) |
| 171 | && cmd != ANDROID_ALARM_SET_AND_WAIT_OLD) |
| 172 | break; |
| 173 | /* fall though */ |
| 174 | case ANDROID_ALARM_WAIT: |
| 175 | spin_lock_irqsave(&alarm_slock, flags); |
Joe Perches | 8a7245e | 2012-05-20 14:06:36 -0700 | [diff] [blame] | 176 | alarm_dbg(IO, "alarm wait\n"); |
Arve Hjønnevåg | 841cb11 | 2012-02-09 14:24:30 -0800 | [diff] [blame] | 177 | if (!alarm_pending && wait_pending) { |
John Stultz | a180c0d | 2012-04-24 10:57:16 -0700 | [diff] [blame] | 178 | __pm_relax(&alarm_wake_lock); |
Arve Hjønnevåg | 841cb11 | 2012-02-09 14:24:30 -0800 | [diff] [blame] | 179 | wait_pending = 0; |
| 180 | } |
| 181 | spin_unlock_irqrestore(&alarm_slock, flags); |
| 182 | rv = wait_event_interruptible(alarm_wait_queue, alarm_pending); |
| 183 | if (rv) |
| 184 | goto err1; |
| 185 | spin_lock_irqsave(&alarm_slock, flags); |
| 186 | rv = alarm_pending; |
| 187 | wait_pending = 1; |
| 188 | alarm_pending = 0; |
| 189 | spin_unlock_irqrestore(&alarm_slock, flags); |
| 190 | break; |
| 191 | case ANDROID_ALARM_SET_RTC: |
| 192 | if (copy_from_user(&new_rtc_time, (void __user *)arg, |
| 193 | sizeof(new_rtc_time))) { |
| 194 | rv = -EFAULT; |
| 195 | goto err1; |
| 196 | } |
John Stultz | b8793260 | 2012-04-20 12:31:46 -0700 | [diff] [blame] | 197 | rtc_time_to_tm(new_rtc_time.tv_sec, &new_rtc_tm); |
| 198 | rtc_dev = alarmtimer_get_rtcdev(); |
| 199 | rv = do_settimeofday(&new_rtc_time); |
| 200 | if (rv < 0) |
| 201 | goto err1; |
| 202 | if (rtc_dev) |
| 203 | rv = rtc_set_time(rtc_dev, &new_rtc_tm); |
Arve Hjønnevåg | 841cb11 | 2012-02-09 14:24:30 -0800 | [diff] [blame] | 204 | spin_lock_irqsave(&alarm_slock, flags); |
| 205 | alarm_pending |= ANDROID_ALARM_TIME_CHANGE_MASK; |
| 206 | wake_up(&alarm_wait_queue); |
| 207 | spin_unlock_irqrestore(&alarm_slock, flags); |
| 208 | if (rv < 0) |
| 209 | goto err1; |
| 210 | break; |
| 211 | case ANDROID_ALARM_GET_TIME(0): |
| 212 | switch (alarm_type) { |
| 213 | case ANDROID_ALARM_RTC_WAKEUP: |
| 214 | case ANDROID_ALARM_RTC: |
| 215 | getnstimeofday(&tmp_time); |
| 216 | break; |
| 217 | case ANDROID_ALARM_ELAPSED_REALTIME_WAKEUP: |
| 218 | case ANDROID_ALARM_ELAPSED_REALTIME: |
John Stultz | e2d8cce | 2012-04-20 12:31:44 -0700 | [diff] [blame] | 219 | get_monotonic_boottime(&tmp_time); |
Arve Hjønnevåg | 841cb11 | 2012-02-09 14:24:30 -0800 | [diff] [blame] | 220 | break; |
Arve Hjønnevåg | 841cb11 | 2012-02-09 14:24:30 -0800 | [diff] [blame] | 221 | case ANDROID_ALARM_SYSTEMTIME: |
| 222 | ktime_get_ts(&tmp_time); |
| 223 | break; |
Dae S. Kim | 147cd16 | 2012-08-29 17:08:33 +0200 | [diff] [blame] | 224 | default: |
| 225 | rv = -EINVAL; |
| 226 | goto err1; |
Arve Hjønnevåg | 841cb11 | 2012-02-09 14:24:30 -0800 | [diff] [blame] | 227 | } |
| 228 | if (copy_to_user((void __user *)arg, &tmp_time, |
| 229 | sizeof(tmp_time))) { |
| 230 | rv = -EFAULT; |
| 231 | goto err1; |
| 232 | } |
| 233 | break; |
| 234 | |
| 235 | default: |
| 236 | rv = -EINVAL; |
Arve Hjønnevåg | 841cb11 | 2012-02-09 14:24:30 -0800 | [diff] [blame] | 237 | } |
| 238 | err1: |
| 239 | return rv; |
| 240 | } |
| 241 | |
| 242 | static int alarm_open(struct inode *inode, struct file *file) |
| 243 | { |
| 244 | file->private_data = NULL; |
| 245 | return 0; |
| 246 | } |
| 247 | |
| 248 | static int alarm_release(struct inode *inode, struct file *file) |
| 249 | { |
| 250 | int i; |
| 251 | unsigned long flags; |
| 252 | |
| 253 | spin_lock_irqsave(&alarm_slock, flags); |
Sachin Kamat | 592314e | 2012-06-05 15:05:13 +0530 | [diff] [blame] | 254 | if (file->private_data) { |
Arve Hjønnevåg | 841cb11 | 2012-02-09 14:24:30 -0800 | [diff] [blame] | 255 | for (i = 0; i < ANDROID_ALARM_TYPE_COUNT; i++) { |
| 256 | uint32_t alarm_type_mask = 1U << i; |
| 257 | if (alarm_enabled & alarm_type_mask) { |
Joe Perches | 8a7245e | 2012-05-20 14:06:36 -0700 | [diff] [blame] | 258 | alarm_dbg(INFO, |
| 259 | "%s: clear alarm, pending %d\n", |
| 260 | __func__, |
| 261 | !!(alarm_pending & alarm_type_mask)); |
Arve Hjønnevåg | 841cb11 | 2012-02-09 14:24:30 -0800 | [diff] [blame] | 262 | alarm_enabled &= ~alarm_type_mask; |
| 263 | } |
| 264 | spin_unlock_irqrestore(&alarm_slock, flags); |
John Stultz | b8793260 | 2012-04-20 12:31:46 -0700 | [diff] [blame] | 265 | devalarm_cancel(&alarms[i]); |
Arve Hjønnevåg | 841cb11 | 2012-02-09 14:24:30 -0800 | [diff] [blame] | 266 | spin_lock_irqsave(&alarm_slock, flags); |
| 267 | } |
| 268 | if (alarm_pending | wait_pending) { |
| 269 | if (alarm_pending) |
Joe Perches | 8a7245e | 2012-05-20 14:06:36 -0700 | [diff] [blame] | 270 | alarm_dbg(INFO, "%s: clear pending alarms %x\n", |
| 271 | __func__, alarm_pending); |
John Stultz | a180c0d | 2012-04-24 10:57:16 -0700 | [diff] [blame] | 272 | __pm_relax(&alarm_wake_lock); |
Arve Hjønnevåg | 841cb11 | 2012-02-09 14:24:30 -0800 | [diff] [blame] | 273 | wait_pending = 0; |
| 274 | alarm_pending = 0; |
| 275 | } |
| 276 | alarm_opened = 0; |
| 277 | } |
| 278 | spin_unlock_irqrestore(&alarm_slock, flags); |
| 279 | return 0; |
| 280 | } |
| 281 | |
John Stultz | b8793260 | 2012-04-20 12:31:46 -0700 | [diff] [blame] | 282 | static void devalarm_triggered(struct devalarm *alarm) |
Arve Hjønnevåg | 841cb11 | 2012-02-09 14:24:30 -0800 | [diff] [blame] | 283 | { |
| 284 | unsigned long flags; |
| 285 | uint32_t alarm_type_mask = 1U << alarm->type; |
| 286 | |
Joe Perches | 8a7245e | 2012-05-20 14:06:36 -0700 | [diff] [blame] | 287 | alarm_dbg(INT, "%s: type %d\n", __func__, alarm->type); |
Arve Hjønnevåg | 841cb11 | 2012-02-09 14:24:30 -0800 | [diff] [blame] | 288 | spin_lock_irqsave(&alarm_slock, flags); |
| 289 | if (alarm_enabled & alarm_type_mask) { |
John Stultz | a180c0d | 2012-04-24 10:57:16 -0700 | [diff] [blame] | 290 | __pm_wakeup_event(&alarm_wake_lock, 5000); /* 5secs */ |
Arve Hjønnevåg | 841cb11 | 2012-02-09 14:24:30 -0800 | [diff] [blame] | 291 | alarm_enabled &= ~alarm_type_mask; |
| 292 | alarm_pending |= alarm_type_mask; |
| 293 | wake_up(&alarm_wait_queue); |
| 294 | } |
| 295 | spin_unlock_irqrestore(&alarm_slock, flags); |
| 296 | } |
| 297 | |
John Stultz | b8793260 | 2012-04-20 12:31:46 -0700 | [diff] [blame] | 298 | |
| 299 | static enum hrtimer_restart devalarm_hrthandler(struct hrtimer *hrt) |
| 300 | { |
| 301 | struct devalarm *devalrm = container_of(hrt, struct devalarm, u.hrt); |
| 302 | |
| 303 | devalarm_triggered(devalrm); |
| 304 | return HRTIMER_NORESTART; |
| 305 | } |
| 306 | |
| 307 | static enum alarmtimer_restart devalarm_alarmhandler(struct alarm *alrm, |
| 308 | ktime_t now) |
| 309 | { |
| 310 | struct devalarm *devalrm = container_of(alrm, struct devalarm, u.alrm); |
| 311 | |
| 312 | devalarm_triggered(devalrm); |
| 313 | return ALARMTIMER_NORESTART; |
| 314 | } |
| 315 | |
| 316 | |
Arve Hjønnevåg | 841cb11 | 2012-02-09 14:24:30 -0800 | [diff] [blame] | 317 | static const struct file_operations alarm_fops = { |
| 318 | .owner = THIS_MODULE, |
| 319 | .unlocked_ioctl = alarm_ioctl, |
| 320 | .open = alarm_open, |
| 321 | .release = alarm_release, |
| 322 | }; |
| 323 | |
| 324 | static struct miscdevice alarm_device = { |
| 325 | .minor = MISC_DYNAMIC_MINOR, |
| 326 | .name = "alarm", |
| 327 | .fops = &alarm_fops, |
| 328 | }; |
| 329 | |
| 330 | static int __init alarm_dev_init(void) |
| 331 | { |
| 332 | int err; |
| 333 | int i; |
| 334 | |
| 335 | err = misc_register(&alarm_device); |
| 336 | if (err) |
| 337 | return err; |
| 338 | |
John Stultz | b8793260 | 2012-04-20 12:31:46 -0700 | [diff] [blame] | 339 | alarm_init(&alarms[ANDROID_ALARM_RTC_WAKEUP].u.alrm, |
| 340 | ALARM_REALTIME, devalarm_alarmhandler); |
| 341 | hrtimer_init(&alarms[ANDROID_ALARM_RTC].u.hrt, |
| 342 | CLOCK_REALTIME, HRTIMER_MODE_ABS); |
| 343 | alarm_init(&alarms[ANDROID_ALARM_ELAPSED_REALTIME_WAKEUP].u.alrm, |
| 344 | ALARM_BOOTTIME, devalarm_alarmhandler); |
| 345 | hrtimer_init(&alarms[ANDROID_ALARM_ELAPSED_REALTIME].u.hrt, |
| 346 | CLOCK_BOOTTIME, HRTIMER_MODE_ABS); |
| 347 | hrtimer_init(&alarms[ANDROID_ALARM_SYSTEMTIME].u.hrt, |
| 348 | CLOCK_MONOTONIC, HRTIMER_MODE_ABS); |
| 349 | |
| 350 | for (i = 0; i < ANDROID_ALARM_TYPE_COUNT; i++) { |
| 351 | alarms[i].type = i; |
| 352 | if (!is_wakeup(i)) |
| 353 | alarms[i].u.hrt.function = devalarm_hrthandler; |
| 354 | } |
| 355 | |
John Stultz | a180c0d | 2012-04-24 10:57:16 -0700 | [diff] [blame] | 356 | wakeup_source_init(&alarm_wake_lock, "alarm"); |
Arve Hjønnevåg | 841cb11 | 2012-02-09 14:24:30 -0800 | [diff] [blame] | 357 | return 0; |
| 358 | } |
| 359 | |
| 360 | static void __exit alarm_dev_exit(void) |
| 361 | { |
| 362 | misc_deregister(&alarm_device); |
John Stultz | a180c0d | 2012-04-24 10:57:16 -0700 | [diff] [blame] | 363 | wakeup_source_trash(&alarm_wake_lock); |
Arve Hjønnevåg | 841cb11 | 2012-02-09 14:24:30 -0800 | [diff] [blame] | 364 | } |
| 365 | |
| 366 | module_init(alarm_dev_init); |
| 367 | module_exit(alarm_dev_exit); |
| 368 | |