Lines Matching +full:5 +full:k +full:- +full:24 +full:k
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 */
77 k_spinlock_key_t k; in read_register() local
80 k = k_spin_lock(&lock); in read_register()
83 k_spin_unlock(&lock, k); in read_register()
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()
177 state.hour = (state.hour + 12) % 24; in get_value()