]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
rtc: clarify the RTC offset correction
authorRussell King <rmk+kernel@armlinux.org.uk>
Fri, 29 Sep 2017 10:23:25 +0000 (11:23 +0100)
committerAlexandre Belloni <alexandre.belloni@free-electrons.com>
Wed, 25 Oct 2017 21:05:52 +0000 (23:05 +0200)
The RTC offset correction documentation is not very clear about the
exact relationship between "offset" and the effect it has on the RTC.
Supplement the documentation with an equation giving the relationship.

Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
drivers/rtc/interface.c

index 9eb32ead63dbeaa8d675c4118ff48521fcda5949..672b192f8153aa00665daaefc541ebaf601cfe74 100644 (file)
@@ -1004,6 +1004,10 @@ int rtc_read_offset(struct rtc_device *rtc, long *offset)
  * to compensate for differences in the actual clock rate due to temperature,
  * the crystal, capacitor, etc.
  *
+ * The adjustment applied is as follows:
+ *   t = t0 * (1 + offset * 1e-9)
+ * where t0 is the measured length of 1 RTC second with offset = 0
+ *
  * Kernel interface to adjust an rtc clock offset.
  * Return 0 on success, or a negative number on error.
  * If the rtc offset is not setable (or not implemented), return -EINVAL