Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

rtc: clarify the RTC offset correction

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>

authored by

Russell King and committed by
Alexandre Belloni
8a25c8f6 9d7ed21f

+4
+4
drivers/rtc/interface.c
··· 1004 1004 * to compensate for differences in the actual clock rate due to temperature, 1005 1005 * the crystal, capacitor, etc. 1006 1006 * 1007 + * The adjustment applied is as follows: 1008 + * t = t0 * (1 + offset * 1e-9) 1009 + * where t0 is the measured length of 1 RTC second with offset = 0 1010 + * 1007 1011 * Kernel interface to adjust an rtc clock offset. 1008 1012 * Return 0 on success, or a negative number on error. 1009 1013 * If the rtc offset is not setable (or not implemented), return -EINVAL