Lines Matching +full:row +full:- +full:offset
3 * SPDX-License-Identifier: Apache-2.0
5 * This barebones driver enables the use of the PC AT-style RTC
6 * (the so-called "CMOS" clock) as a primitive, 1Hz monotonic counter.
33 * type-punning to compare states will break.
49 * values in 'struct state' are BCD-encoded.
65 #define STATUS_B_24HR 0x02 /* 24-hour (vs 12-hour) mode */
101 /* Convert 8-bit (2-digit) BCD to binary equivalent. */
109 * Hinnant's algorithm to calculate the number of days offset from the epoch.
119 y -= (m <= 2); in hinnant()
120 era = ((y >= 0) ? y : (y - 399)) / 400; in hinnant()
121 yoe = y - era * 400; in hinnant()
122 doy = (153 * (m + ((m > 2) ? -3 : 9)) + 2)/5 + d - 1; in hinnant()
123 doe = yoe * 365 + yoe / 4 - yoe / 100 + doy; in hinnant()
125 return era * 146097 + ((int) doe) - 719468; in hinnant()
144 * Read the state until we see the same state twice in a row. in get_value()
154 * Normalize the state; 12hr -> 24hr, BCD -> decimal. in get_value()