[PORT FROM R2] VRTC: Sync time to MSIC RTC when NTP enabled
authorShuoX Liu <shuox.liu@intel.com>
Mon, 14 Nov 2011 04:52:08 +0000 (12:52 +0800)
committerbuildbot <buildbot@intel.com>
Thu, 9 Feb 2012 22:30:42 +0000 (14:30 -0800)
BZ: 22580

NTP uses update_persistent_clock->...->vrtc_set_mmss to set vRTC.
We should sync the modified time to MSIC RTC.

Change-Id: I2376909e401f96c972c58de6bf2bfdfef1398d63
Signed-off-by: ShuoX Liu <shuox.liu@intel.com>
Reviewed-on: http://android.intel.com:8080/29665
Reviewed-by: Yang, Fei <fei.yang@intel.com>
Reviewed-by: Zhang, Yanmin <yanmin.zhang@intel.com>
Reviewed-by: Gross, Mark <mark.gross@intel.com>
Tested-by: Ng, Cheon-woei <cheon-woei.ng@intel.com>
Reviewed-by: buildbot <buildbot@intel.com>
Tested-by: buildbot <buildbot@intel.com>
arch/x86/kernel/rtc.c

index 30b9673..46350af 100644 (file)
@@ -8,6 +8,9 @@
 #include <linux/pnp.h>
 #include <linux/of.h>
 
+#ifdef CONFIG_X86_INTEL_MID
+#include <asm/intel_scu_ipc.h>
+#endif
 #include <asm/vsyscall.h>
 #include <asm/x86_init.h>
 #include <asm/time.h>
@@ -177,6 +180,11 @@ int update_persistent_clock(struct timespec now)
        retval = x86_platform.set_wallclock(now.tv_sec);
        spin_unlock_irqrestore(&rtc_lock, flags);
 
+#ifdef CONFIG_X86_INTEL_MID
+       if (!retval)
+               retval = intel_scu_ipc_simple_command(
+                               IPCMSG_VRTC, IPC_CMD_VRTC_SETTIME);
+#endif
        return retval;
 }