Lines Matching +full:bit +full:- +full:per +full:- +full:seconds
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 */
67 #define HOUR_PM 0x80 /* high bit of hour set = PM */
101 /* Convert 8-bit (2-digit) BCD to binary equivalent. */
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()
154 * Normalize the state; 12hr -> 24hr, BCD -> decimal. in get_value()
155 * The order is a bit awkward because we need to interpret in get_value()
188 epoch *= 86400; /* seconds per day */ in get_value()
189 epoch += state.hour * 3600; /* seconds per hour */ in get_value()
190 epoch += state.minute * 60; /* seconds per minute */ in get_value()