]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
alarm: Use system rtc for alarms
authorKrishna Yarlagadda <kyarlagadda@nvidia.com>
Wed, 3 Feb 2016 09:26:43 +0000 (14:56 +0530)
committermobile promotions <svcmobile_promotions@nvidia.com>
Wed, 24 Feb 2016 01:36:08 +0000 (17:36 -0800)
Alarm uses first registered rtc device for setting alarm
as of now. Changed this to use system rtc so time and
alarm are in sync

Bug 1698877

Change-Id: I8c04736230fb50b8fc77332549414e72e6b43bed
Signed-off-by: Krishna Yarlagadda <kyarlagadda@nvidia.com>
Reviewed-on: http://git-master/r/1012790
GVS: Gerrit_Virtual_Submit
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
kernel/time/alarmtimer.c

index 448515769cee424eb7d88e89f107bcb7212a1558..4f88bad4bc0f2c9be098fe7aea875b47db82304b 100644 (file)
@@ -1,6 +1,8 @@
 /*
  * Alarmtimer interface
  *
+ * Copyright (C) 2014 NVIDIA CORPORATION. All rights reserved.
+ *
  * This interface provides a timer which is similarto hrtimers,
  * but triggers a RTC alarm if the box is suspend.
  *
@@ -25,6 +27,7 @@
 #include <linux/posix-timers.h>
 #include <linux/workqueue.h>
 #include <linux/freezer.h>
+#include <linux/device.h>
 
 /**
  * struct alarm_base - Alarm timer bases
@@ -84,6 +87,11 @@ static int alarmtimer_rtc_add_device(struct device *dev,
        if (rtcdev)
                return -EBUSY;
 
+#ifdef CONFIG_RTC_HCTOSYS_DEVICE
+       if (strcmp(dev_name(&rtc->dev), CONFIG_RTC_HCTOSYS_DEVICE) != 0)
+               return -EINVAL;
+#endif
+
        if (!rtc->ops->set_alarm)
                return -1;