Home
last modified time | relevance | path

Searched refs:TOBCD (Results 1 – 23 of 23) sorted by relevance

/openbsd/sys/dev/i2c/
H A Dm41t8x.c136 data[M41T8X_SEC] = TOBCD(dt.dt_sec); in m41t8xrtc_settime()
137 data[M41T8X_MIN] = TOBCD(dt.dt_min); in m41t8xrtc_settime()
141 data[M41T8X_HR] |= TOBCD(dt.dt_hour); in m41t8xrtc_settime()
143 data[M41T8X_DOW] |= TOBCD(dt.dt_wday + 1); in m41t8xrtc_settime()
144 data[M41T8X_DAY] = TOBCD(dt.dt_day); in m41t8xrtc_settime()
145 data[M41T8X_MON] = TOBCD(dt.dt_mon); in m41t8xrtc_settime()
146 data[M41T8X_YEAR] = TOBCD(dt.dt_year % 100); in m41t8xrtc_settime()
H A Dpcf85063.c245 regs[0] = TOBCD(dt->dt_sec); in pcyrtc_clock_write()
246 regs[1] = TOBCD(dt->dt_min); in pcyrtc_clock_write()
247 regs[2] = TOBCD(dt->dt_hour); in pcyrtc_clock_write()
248 regs[3] = TOBCD(dt->dt_day); in pcyrtc_clock_write()
249 regs[4] = TOBCD(dt->dt_wday); in pcyrtc_clock_write()
250 regs[5] = TOBCD(dt->dt_mon); in pcyrtc_clock_write()
251 regs[6] = TOBCD(dt->dt_year - 2000); in pcyrtc_clock_write()
H A Dpcf8563.c238 regs[0] = TOBCD(dt->dt_sec); in pcxrtc_clock_write()
239 regs[1] = TOBCD(dt->dt_min); in pcxrtc_clock_write()
240 regs[2] = TOBCD(dt->dt_hour); in pcxrtc_clock_write()
241 regs[3] = TOBCD(dt->dt_day); in pcxrtc_clock_write()
242 regs[4] = TOBCD(dt->dt_wday); in pcxrtc_clock_write()
243 regs[5] = TOBCD(dt->dt_mon); in pcxrtc_clock_write()
244 regs[6] = TOBCD(dt->dt_year - 2000); in pcxrtc_clock_write()
H A Dds3231.c224 regs[0] = TOBCD(dt->dt_sec); in dsxrtc_clock_write()
225 regs[1] = TOBCD(dt->dt_min); in dsxrtc_clock_write()
226 regs[2] = TOBCD(dt->dt_hour); in dsxrtc_clock_write()
227 regs[3] = TOBCD(dt->dt_wday + 1); in dsxrtc_clock_write()
228 regs[4] = TOBCD(dt->dt_day); in dsxrtc_clock_write()
229 regs[5] = TOBCD(dt->dt_mon); in dsxrtc_clock_write()
230 regs[6] = TOBCD(dt->dt_year - 2000); in dsxrtc_clock_write()
H A Dds1307.c260 data[1] = TOBCD(dt.dt_sec); /* this will also enable the osc */ in maxrtc_settime()
261 data[2] = TOBCD(dt.dt_min); in maxrtc_settime()
262 data[3] = TOBCD(dt.dt_hour); /* this will also set 24h mode */ in maxrtc_settime()
263 data[4] = TOBCD(dt.dt_wday); in maxrtc_settime()
264 data[5] = TOBCD(dt.dt_day); in maxrtc_settime()
265 data[6] = TOBCD(dt.dt_mon); in maxrtc_settime()
266 data[7] = TOBCD(dt.dt_year - 2000); in maxrtc_settime()
H A Disl1208.c222 regs[0] = TOBCD(dt->dt_sec); in islrtc_clock_write()
223 regs[1] = TOBCD(dt->dt_min); in islrtc_clock_write()
224 regs[2] = TOBCD(dt->dt_hour) | ISL1208_HR_MIL; in islrtc_clock_write()
225 regs[3] = TOBCD(dt->dt_day); in islrtc_clock_write()
226 regs[4] = TOBCD(dt->dt_mon); in islrtc_clock_write()
227 regs[5] = TOBCD(dt->dt_year - 2000); in islrtc_clock_write()
228 regs[6] = TOBCD(dt->dt_wday); in islrtc_clock_write()
H A Dpcf8523.c270 regs[0] = TOBCD(dt->dt_sec); in pcfrtc_clock_write()
271 regs[1] = TOBCD(dt->dt_min); in pcfrtc_clock_write()
272 regs[2] = TOBCD(dt->dt_hour); in pcfrtc_clock_write()
273 regs[3] = TOBCD(dt->dt_day); in pcfrtc_clock_write()
274 regs[4] = TOBCD(dt->dt_wday); in pcfrtc_clock_write()
275 regs[5] = TOBCD(dt->dt_mon); in pcfrtc_clock_write()
276 regs[6] = TOBCD(dt->dt_year - 2000); in pcfrtc_clock_write()
H A Drs5c372.c282 bcd[RICOHRTC_SECONDS] = TOBCD(dt->dt_sec); in ricohrtc_clock_write()
283 bcd[RICOHRTC_MINUTES] = TOBCD(dt->dt_min); in ricohrtc_clock_write()
284 bcd[RICOHRTC_HOURS] = TOBCD(dt->dt_hour); in ricohrtc_clock_write()
285 bcd[RICOHRTC_DATE] = TOBCD(dt->dt_day); in ricohrtc_clock_write()
286 bcd[RICOHRTC_DAY] = TOBCD(dt->dt_wday); in ricohrtc_clock_write()
287 bcd[RICOHRTC_MONTH] = TOBCD(dt->dt_mon); in ricohrtc_clock_write()
288 bcd[RICOHRTC_YEAR] = TOBCD(dt->dt_year - POSIX_BASE_YEAR); in ricohrtc_clock_write()
H A Dmcp794xx.c223 regs[0] = TOBCD(dt->dt_sec); in mcprtc_clock_write()
224 regs[1] = TOBCD(dt->dt_min); in mcprtc_clock_write()
225 regs[2] = TOBCD(dt->dt_hour); in mcprtc_clock_write()
226 regs[3] = TOBCD(dt->dt_wday) | MCP794XX_DW_VBATEN; in mcprtc_clock_write()
227 regs[4] = TOBCD(dt->dt_day); in mcprtc_clock_write()
228 regs[5] = TOBCD(dt->dt_mon); in mcprtc_clock_write()
229 regs[6] = TOBCD(dt->dt_year - 2000); in mcprtc_clock_write()
H A Dabx80x.c260 regs[1] = TOBCD(dt->dt_sec); in abcrtc_clock_write()
261 regs[2] = TOBCD(dt->dt_min); in abcrtc_clock_write()
262 regs[3] = TOBCD(dt->dt_hour); in abcrtc_clock_write()
263 regs[4] = TOBCD(dt->dt_day); in abcrtc_clock_write()
264 regs[5] = TOBCD(dt->dt_mon); in abcrtc_clock_write()
265 regs[6] = TOBCD(dt->dt_year - 2000); in abcrtc_clock_write()
/openbsd/usr.sbin/vmd/
H A Dmc146818.c47 #define TOBCD(x) (((x) / 10 * 16) + ((x) % 10)) macro
98 rtc.regs[MC_SEC] = TOBCD(gnow->tm_sec); in rtc_updateregs()
99 rtc.regs[MC_MIN] = TOBCD(gnow->tm_min); in rtc_updateregs()
100 rtc.regs[MC_HOUR] = TOBCD(gnow->tm_hour); in rtc_updateregs()
101 rtc.regs[MC_DOW] = TOBCD(gnow->tm_wday + 1); in rtc_updateregs()
102 rtc.regs[MC_DOM] = TOBCD(gnow->tm_mday); in rtc_updateregs()
103 rtc.regs[MC_MONTH] = TOBCD(gnow->tm_mon + 1); in rtc_updateregs()
104 rtc.regs[MC_YEAR] = TOBCD((gnow->tm_year + 1900) % 100); in rtc_updateregs()
105 rtc.regs[NVRAM_CENTURY] = TOBCD((gnow->tm_year + 1900) / 100); in rtc_updateregs()
/openbsd/sys/arch/luna88k/dev/
H A Dtimekeeper.c62 #define TOBCD(x) (((x) / 10 * 16) + ((x) % 10)) macro
184 chiptime[MK_SEC] = TOBCD(dt->dt_sec) << 24; in mkclock_set()
185 chiptime[MK_MIN] = TOBCD(dt->dt_min) << 24; in mkclock_set()
186 chiptime[MK_HOUR] = TOBCD(dt->dt_hour) << 24; in mkclock_set()
187 chiptime[MK_DOW] = TOBCD(dt->dt_wday) << 24; in mkclock_set()
188 chiptime[MK_DOM] = TOBCD(dt->dt_day) << 24; in mkclock_set()
189 chiptime[MK_MONTH] = TOBCD(dt->dt_mon) << 24; in mkclock_set()
191 chiptime[MK_YEAR] = TOBCD(dt->dt_year - MK_YEAR0) << 24; in mkclock_set()
219 *chipdata = TOBCD((u_int8_t)(data)); \
/openbsd/sys/dev/fdt/
H A Dexrtc.c137 HWRITE4(sc, RTCSEC, TOBCD(dt.dt_sec)); in exrtc_settime()
138 HWRITE4(sc, RTCMIN, TOBCD(dt.dt_min)); in exrtc_settime()
139 HWRITE4(sc, RTCHOUR, TOBCD(dt.dt_hour)); in exrtc_settime()
140 HWRITE4(sc, RTCDAY, TOBCD(dt.dt_day)); in exrtc_settime()
141 HWRITE4(sc, RTCMON, TOBCD(dt.dt_mon)); in exrtc_settime()
142 HWRITE4(sc, RTCYEAR, TOBCD(dt.dt_year - 1900)); in exrtc_settime()
H A Dacrtc.c202 acrtc_write_reg(sc, RTC_SEC, TOBCD(dt->dt_sec)); in acrtc_clock_write()
203 acrtc_write_reg(sc, RTC_MIN, TOBCD(dt->dt_min)); in acrtc_clock_write()
204 acrtc_write_reg(sc, RTC_HOU, TOBCD(dt->dt_hour)); in acrtc_clock_write()
205 acrtc_write_reg(sc, RTC_WEE, TOBCD(dt->dt_wday)); in acrtc_clock_write()
206 acrtc_write_reg(sc, RTC_DAY, TOBCD(dt->dt_day)); in acrtc_clock_write()
207 acrtc_write_reg(sc, RTC_MON, TOBCD(dt->dt_mon)); in acrtc_clock_write()
208 acrtc_write_reg(sc, RTC_YEA, TOBCD(dt->dt_year - 2000) | leap); in acrtc_clock_write()
H A Drkpmic.c836 regs[0] = TOBCD(dt->dt_sec); in rkpmic_clock_write()
837 regs[1] = TOBCD(dt->dt_min); in rkpmic_clock_write()
838 regs[2] = TOBCD(dt->dt_hour); in rkpmic_clock_write()
839 regs[3] = TOBCD(dt->dt_day); in rkpmic_clock_write()
840 regs[4] = TOBCD(dt->dt_mon); in rkpmic_clock_write()
841 regs[5] = TOBCD(dt->dt_year - 2000); in rkpmic_clock_write()
842 regs[6] = TOBCD(dt->dt_wday); in rkpmic_clock_write()
/openbsd/sys/dev/ic/
H A Dmk48txx.c201 bus_space_write_1(bt, bh, clkoff + MK48TXX_ISEC, TOBCD(dt.dt_sec)); in mk48txx_settime()
202 bus_space_write_1(bt, bh, clkoff + MK48TXX_IMIN, TOBCD(dt.dt_min)); in mk48txx_settime()
203 bus_space_write_1(bt, bh, clkoff + MK48TXX_IHOUR, TOBCD(dt.dt_hour)); in mk48txx_settime()
204 bus_space_write_1(bt, bh, clkoff + MK48TXX_IWDAY, TOBCD(dt.dt_wday)); in mk48txx_settime()
205 bus_space_write_1(bt, bh, clkoff + MK48TXX_IDAY, TOBCD(dt.dt_day)); in mk48txx_settime()
206 bus_space_write_1(bt, bh, clkoff + MK48TXX_IMON, TOBCD(dt.dt_mon)); in mk48txx_settime()
207 bus_space_write_1(bt, bh, clkoff + MK48TXX_IYEAR, TOBCD(year)); in mk48txx_settime()
/openbsd/sys/arch/octeon/dev/
H A Doctrtc.c252 tod[0] = TOBCD(dt.dt_sec); in octrtc_settime()
253 tod[1] = TOBCD(dt.dt_min); in octrtc_settime()
254 tod[2] = TOBCD(dt.dt_hour); in octrtc_settime()
255 tod[3] = TOBCD(dt.dt_wday + 1); in octrtc_settime()
256 tod[4] = TOBCD(dt.dt_day); in octrtc_settime()
257 tod[5] = TOBCD(dt.dt_mon); in octrtc_settime()
260 tod[6] = TOBCD(dt.dt_year % 100); in octrtc_settime()
/openbsd/sys/arch/sparc64/dev/
H A Drtc.c388 bus_space_write_1(iot, ioh, BQ4802_SEC, TOBCD(dt.dt_sec)); in rtc_bq4802_settime()
389 bus_space_write_1(iot, ioh, BQ4802_MIN, TOBCD(dt.dt_min)); in rtc_bq4802_settime()
390 bus_space_write_1(iot, ioh, BQ4802_HOUR, TOBCD(dt.dt_hour)); in rtc_bq4802_settime()
391 bus_space_write_1(iot, ioh, BQ4802_DOW, TOBCD(dt.dt_wday)); in rtc_bq4802_settime()
392 bus_space_write_1(iot, ioh, BQ4802_DAY, TOBCD(dt.dt_day)); in rtc_bq4802_settime()
393 bus_space_write_1(iot, ioh, BQ4802_MONTH, TOBCD(dt.dt_mon)); in rtc_bq4802_settime()
394 bus_space_write_1(iot, ioh, BQ4802_YEAR, TOBCD(dt.dt_year % 100)); in rtc_bq4802_settime()
395 bus_space_write_1(iot, ioh, BQ4802_CENTURY, TOBCD(dt.dt_year / 100)); in rtc_bq4802_settime()
/openbsd/sys/arch/powerpc64/dev/
H A Dopal.c317 time |= (uint64_t)TOBCD(dt.dt_sec) << 40; in opal_settime()
318 time |= (uint64_t)TOBCD(dt.dt_min) << 48; in opal_settime()
319 time |= (uint64_t)TOBCD(dt.dt_hour) << 56; in opal_settime()
320 date |= (uint32_t)TOBCD(dt.dt_day); in opal_settime()
321 date |= (uint32_t)TOBCD(dt.dt_mon) << 8; in opal_settime()
322 date |= (uint32_t)TOBCD(dt.dt_year) << 16; in opal_settime()
323 date |= (uint32_t)TOBCD(dt.dt_year / 100) << 24; in opal_settime()
/openbsd/sys/arch/sh/sh/
H A Dclock.c432 _reg_write_1(SH3_RYRCNT, TOBCD(dt->dt_year % 100)); in sh_rtc_set()
434 _reg_write_2(SH4_RYRCNT, TOBCD(dt->dt_year % 100)); in sh_rtc_set()
435 #define RTCSET(x, y) _reg_write_1(SH_(R ## x ## CNT), TOBCD(dt->dt_ ## y)) in sh_rtc_set()
/openbsd/sys/arch/macppc/dev/
H A Dsmu.c591 cmd->data[1] = TOBCD(dt.dt_sec); in smu_time_write()
592 cmd->data[2] = TOBCD(dt.dt_min); in smu_time_write()
593 cmd->data[3] = TOBCD(dt.dt_hour); in smu_time_write()
594 cmd->data[4] = TOBCD(dt.dt_wday); in smu_time_write()
595 cmd->data[5] = TOBCD(dt.dt_day); in smu_time_write()
596 cmd->data[6] = TOBCD(dt.dt_mon); in smu_time_write()
597 cmd->data[7] = TOBCD(dt.dt_year - 2000); in smu_time_write()
/openbsd/sys/arch/landisk/dev/
H A Drs5c313.c269 t = TOBCD(dt->dt_ ## y) & 0xff; \ in rs5c313_settime()
283 t = TOBCD(t); in rs5c313_settime()
/openbsd/sys/sys/
H A Dtime.h360 #define TOBCD(x) (((x) / 10 * 16) + ((x) % 10)) macro