Lines Matching +full:pm +full:- +full:api

1 /*-
2 * SPDX-License-Identifier: BSD-2-Clause
30 * - ISL1209 = 2B sram, tamper/event timestamp
31 * - ISL1218 = 8B sram, DS13xx pin compatible (but not software compatible)
32 * - ISL1219 = 2B sram, tamper/event timestamp
33 * - ISL1220 = 8B sram, separate Fout
34 * - ISL1221 = 2B sram, separate Fout, tamper/event timestamp
63 * in 'B' that stands for "bar" and it is an active-low signal; something named
64 * "EVENB" implies 1=event-disable, 0=event-enable.
70 #define ISL12XX_SR_ARST (1u << 7) /* Auto-reset on status read */
109 #define ISL12XX_24HR_FLAG (1u << 7) /* Hours register 24-hr mode */
110 #define ISL12XX_PM_FLAG (1u << 5) /* Hours register PM flag */
111 #define ISL12xx_12HR_MASK 0x1f /* Hours mask in AM/PM mode */
112 #define ISL12xx_24HR_MASK 0x3f /* Hours mask in 24-hr mode */
143 * iicbus_acquire_bus() calls with a non-recursive wait at the entry of our API
153 return (iicdev_readfrom(sc->dev, reg, data, 1, WAITFLAGS)); in isl12xx_read1()
160 return (iicdev_writeto(sc->dev, reg, &val, 1, WAITFLAGS)); in isl12xx_write1()
169 config_intrhook_disestablish(&sc->init_hook); in isl12xx_init()
172 * Check the clock-stopped/power-fail bit, just so we can report it to in isl12xx_init()
177 device_printf(sc->dev, in isl12xx_init()
184 clock_register_flags(sc->dev, 1000000, CLOCKF_SETTIME_NO_ADJ); in isl12xx_init()
185 clock_schedule(sc->dev, 1); in isl12xx_init()
196 if (ofw_bus_search_compatible(dev, compat_data)->ocd_data != 0) { in isl12xx_probe()
209 sc->dev = dev; in isl12xx_attach()
210 sc->busdev = device_get_parent(sc->dev); in isl12xx_attach()
216 sc->init_hook.ich_func = isl12xx_init; in isl12xx_attach()
217 sc->init_hook.ich_arg = sc; in isl12xx_attach()
218 if (config_intrhook_establish(&sc->init_hook) != 0) in isl12xx_attach()
244 if ((err = iicbus_request_bus(sc->busdev, sc->dev, IIC_WAIT)) == 0) { in isl12xx_gettime()
246 err = iicdev_readfrom(sc->dev, ISL12XX_SC_REG, &tregs, in isl12xx_gettime()
249 iicbus_release_bus(sc->busdev, sc->dev); in isl12xx_gettime()
258 /* If chip is in AM/PM mode remember that for when we set time. */ in isl12xx_gettime()
262 sc->use_ampm = true; in isl12xx_gettime()
275 clock_dbgprint_bcd(sc->dev, CLOCK_DBG_READ, &bct); in isl12xx_gettime()
276 return (clock_bcd_to_ts(&bct, ts, sc->use_ampm)); in isl12xx_gettime()
289 * We request a timespec with no resolution-adjustment. That also in isl12xx_settime()
292 ts->tv_sec -= utc_offset(); in isl12xx_settime()
293 ts->tv_nsec = 0; in isl12xx_settime()
294 clock_ts_to_bcd(ts, &bct, sc->use_ampm); in isl12xx_settime()
295 clock_dbgprint_bcd(sc->dev, CLOCK_DBG_WRITE, &bct); in isl12xx_settime()
297 /* If the chip is in AM/PM mode, set flags as needed. */ in isl12xx_settime()
298 if (!sc->use_ampm) in isl12xx_settime()
316 * write a 1, so just always OR-in all the W0C bits to be sure we never in isl12xx_settime()
318 * whole read-modify-write sequence. in isl12xx_settime()
320 if ((err = iicbus_request_bus(sc->busdev, sc->dev, IIC_WAIT)) != 0) in isl12xx_settime()
325 err = iicdev_writeto(sc->dev, ISL12XX_SC_REG, &tregs, in isl12xx_settime()
331 iicbus_release_bus(sc->busdev, sc->dev); in isl12xx_settime()