Skip to contentSkip to conversation

x86, mrst: add explalation for using 1960 as the year offset for vrtc device

PATCH In review Alan Cox 2 participants 2 messages Nov 17, 2010 Real time clock (RTC)

lore
Share & tools
lore

Alan Cox

author
#0 lore raw

PATCH 1/1 x86, mrst: add explalation for using 1960 as the year offset for vrtc device

From: Feng Tang <[email protected]>

Explain the reason for the apparently odd choice of year offset so we don't get more questions about it.

---

 drivers/rtc/rtc-mrst.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
drivers/rtc/rtc-mrst.c +5 -1
index 67b6be2..bcd0cf6 100644
@@ -66,7 +66,11 @@ static inline int is_intr(u8 rtc_intr)
  * rtc_time's year contains the increment over 1900, but vRTC's YEAR
  * register can't be programmed to value larger than 0x64, so vRTC
  * driver chose to use 1960 (1970 is UNIX time start point) as the base,
- * and does the translation at read/write time
+ * and does the translation at read/write time.
+ *
+ * Why not just use 1970 as the offset? it's because using 1960 will
+ * make it consistent in leap year setting for both vrtc and low-level
+ * physical rtc devices.
  */
 static int mrst_read_time(struct device *dev, struct rtc_time *time)
 {
#1 lore raw

[tip:x86/platform] x86, mrst: Add explanation for using 1960 as the year offset for vrtc

Commit-ID:  d3e1884bc585a43674d2cb0d3f0aeeb0ae43bc04
Gitweb:     http://git.kernel.org/tip/d3e1884bc585a43674d2cb0d3f0aeeb0ae43bc04
Author:     Feng Tang <[email protected]>
AuthorDate: Wed, 17 Nov 2010 12:11:24 +0000
Committer:  Thomas Gleixner <[email protected]>
CommitDate: Wed, 17 Nov 2010 13:53:46 +0100

x86, mrst: Add explanation for using 1960 as the year offset for vrtc

Explain the reason for the apparently odd choice of year offset so we don't get more questions about it.

LKML-Reference: <[email protected]>

---
 drivers/rtc/rtc-mrst.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
drivers/rtc/rtc-mrst.c +5 -1
index 67b6be2..bcd0cf6 100644
@@ -66,7 +66,11 @@ static inline int is_intr(u8 rtc_intr)
  * rtc_time's year contains the increment over 1900, but vRTC's YEAR
  * register can't be programmed to value larger than 0x64, so vRTC
  * driver chose to use 1960 (1970 is UNIX time start point) as the base,
- * and does the translation at read/write time
+ * and does the translation at read/write time.
+ *
+ * Why not just use 1970 as the offset? it's because using 1960 will
+ * make it consistent in leap year setting for both vrtc and low-level
+ * physical rtc devices.
  */
 static int mrst_read_time(struct device *dev, struct rtc_time *time)
 {