diff options
Diffstat (limited to 'kernel')
| -rw-r--r-- | kernel/time/alarmtimer.c | 33 |
1 files changed, 4 insertions, 29 deletions
diff --git a/kernel/time/alarmtimer.c b/kernel/time/alarmtimer.c index 714be6181..764f7588c 100644 --- a/kernel/time/alarmtimer.c +++ b/kernel/time/alarmtimer.c @@ -25,25 +25,9 @@ #include <linux/posix-timers.h> #include <linux/workqueue.h> #include <linux/freezer.h> -#include <linux/xlog.h> #include <linux/module.h> #include <mach/mtk_rtc.h> -#define XLOG_MYTAG "Power/Alarm" - -#define ANDROID_ALARM_PRINT_INFO (1U << 0) -#define ANDROID_ALARM_PRINT_IO (1U << 1) -#define ANDROID_ALARM_PRINT_INT (1U << 2) - -static int debug_mask = ANDROID_ALARM_PRINT_INFO; -module_param_named(debug_mask, debug_mask, int, S_IRUGO | S_IWUSR | S_IWGRP); - -#define alarm_dbg(debug_level_mask, fmt, args...) \ -do { \ - if (debug_mask & ANDROID_ALARM_PRINT_##debug_level_mask) \ - xlog_printk(ANDROID_LOG_INFO, XLOG_MYTAG, fmt, ##args); \ -} while (0) - /** * struct alarm_base - Alarm timer bases * @lock: Lock for syncrhonized access to the base @@ -102,8 +86,8 @@ static int alarmtimer_rtc_add_device(struct device *dev, if (!rtc->ops->set_alarm) return -1; - //if (!device_may_wakeup(rtc->dev.parent)) - // return -1; + /*if (!device_may_wakeup(rtc->dev.parent)) + return -1;*/ spin_lock_irqsave(&rtcdev_lock, flags); if (!rtcdev) { @@ -245,8 +229,6 @@ static enum hrtimer_restart alarmtimer_fired(struct hrtimer *timer) int ret = HRTIMER_NORESTART; int restart = ALARMTIMER_NORESTART; - alarm_dbg(INT, "alarmtimer_fired \n"); - spin_lock_irqsave(&base->lock, flags); alarmtimer_dequeue(base, alarm); spin_unlock_irqrestore(&base->lock, flags); @@ -318,12 +300,10 @@ static int alarmtimer_suspend(struct device *dev) if (!min.tv64 || (delta.tv64 < min.tv64)) min = delta; } - if (min.tv64 == 0) { - alarm_dbg(INT, "min.tv64 == 0\n"); + if (min.tv64 == 0) return 0; - } + if (ktime_to_ns(min) < 2 * NSEC_PER_SEC) { - alarm_dbg(INT, "min.tv64 < 2S, give up suspend\n"); __pm_wakeup_event(ws, 2 * MSEC_PER_SEC); return -EBUSY; } @@ -334,11 +314,6 @@ static int alarmtimer_suspend(struct device *dev) now = rtc_tm_to_ktime(tm); now = ktime_add(now, min); - alarm_dbg(INFO, "now:%02d=%02d:%02d %02d/%02d/%04d. min.tv64=%lld\n", - tm.tm_hour, tm.tm_min, - tm.tm_sec, tm.tm_mon + 1, - tm.tm_mday, - tm.tm_year + 1900, min.tv64); /* Set alarm, if in the past reject suspend briefly to handle */ ret = rtc_timer_start(rtc, &rtctimer, now, ktime_set(0, 0)); if (ret < 0) |
