rtc: Compensate for Rockchip calendar deviation on November In 1582 Pope Gregory XIII found that the existing Julian calendar insufficiently represented reality, and changed the rules about calculatin
2026-09-26 21:34
telegramthe_high_council_of_frens
OCR
Текст, распознанный с картинки.
rtc: Compensate for Rockchip calendar deviation on November In 1582 Pope Gregory XIII found that the existing Julian calendar insufficiently represented reality, and changed the rules about calculating leap years to account for this. Similarly, in 2013 Rockchip hardware engineers found that the new Gregorian calendar still contained flaws, and that the month of November should be counted up to 31 days instead. Unfortunately it takes a long time for calendar changes to gain widespread adoption, and just like more than 300 years went before the last Protestant nation implemented Greg's proposal, we will have to wait a while until all religions and operating system kernels acknowledge the inherent advantages of the Rockchip system. Until then we need to translate dates read from (and written to) Rockchip hardware back to the Gregorian format. This patch works defining Jan 2016 as the arbitrary anchor date on which Rockchip and Gregorian calendars are in sync. From that we can translate arbitrary later dates back and forth counting the number of November/December transitons since the anchor date to determine the offset between the calendars. We choose this method (rather than trying to regularly the date stored in hardware) since it's the only way to ensure perfect time-keeping even if the system may be shut down for an unknown number of years. The drawback is that other software reading the same hardware mainboard firmware} must use the same translation convention (including the same anchor date) to be able to read and write correct timestamps from/to the RTC. Signed-off-by: Julius Werner <[email protected]> Reviewed-by: Douglas Anderson <[email protected]> Signed-off-by: Alexandre Belloni <[email protected]> 48 diff --git a/drivers/rtc/rtc-rk808.c b/drivers/rtc/rtc-rk808.c index 100644 а/ я int irq; The Rockchip calendar used the counts Моуетрег with 31 days. We use these translation functions to convert its dates to/from the Gregorian calendar used the rest of the world. We arbitrarily define Jan ist, 2016 as the day when both calendars were in sync, and treat all other relative to that. NOTE: Other system software firmware) that reads the same hardware must implement this exact same conversion algorithm, with the same anchor дате. +static time64_t nov2dec_transitions(struct rtc_time
lang: ru+en
Пользовательские термины
Свои поисковые фразы (до 280 символов). При поиске по термину счётчик растёт.
Пока нет пользовательских терминов.