static struct platform_device *alarm_platform_dev;
struct alarm_queue alarms[ANDROID_ALARM_TYPE_COUNT];
static bool suspended;
-static struct rtc_wkalrm disable_alarm;
static int alarm_reboot_callback(struct notifier_block *nfb,
unsigned long event, void *data);
rtc_delta.tv_sec, rtc_delta.tv_nsec);
if (rtc_current_time + 1 >= rtc_alarm_time) {
pr_alarm(SUSPEND, "alarm about to go off\n");
- err = rtc_set_alarm(alarm_rtc_dev, &disable_alarm);
+ err = rtc_alarm_irq_enable(alarm_rtc_dev, false);
if (err != 0)
pr_alarm(ERROR,
"alarm_suspend: Failed to disable alarm\n");
pr_alarm(SUSPEND, "alarm_resume(%p)\n", dev);
- err = rtc_set_alarm(alarm_rtc_dev, &disable_alarm);
+ err = rtc_alarm_irq_enable(alarm_rtc_dev, false);
if (err != 0)
pr_alarm(ERROR, "alarm_resume: Failed to disable alarm\n");
timespec_to_ktime(timespec_sub(tmp_time, system_time));
spin_unlock_irqrestore(&alarm_slock, flags);
- rtc_time_to_tm(0, &disable_alarm.time);
- disable_alarm.enabled = 0;
- disable_alarm.pending = 0;
return 0;
}
#define mrst_procfs NULL
#endif
+static int mrst_alarm_irq_enable(struct device *dev, unsigned int enabled)
+{
+ struct mrst_rtc *mrst = dev_get_drvdata(dev);
+
+ if (enabled)
+ mrst_irq_enable(mrst, RTC_AIE);
+ else
+ mrst_irq_disable(mrst, RTC_AIE);
+
+ return 0;
+}
+
static const struct rtc_class_ops mrst_rtc_ops = {
- .ioctl = mrst_rtc_ioctl,
- .read_time = mrst_read_time,
- .set_time = mrst_set_time,
- .read_alarm = mrst_read_alarm,
- .set_alarm = mrst_set_alarm,
- .proc = mrst_procfs,
+ .ioctl = mrst_rtc_ioctl,
+ .read_time = mrst_read_time,
+ .set_time = mrst_set_time,
+ .read_alarm = mrst_read_alarm,
+ .set_alarm = mrst_set_alarm,
+ .proc = mrst_procfs,
+ .alarm_irq_enable = mrst_alarm_irq_enable,
};
static struct mrst_rtc mrst_rtc;