Lines Matching +full:cmd +full:- +full:timeout +full:- +full:ms
1 /*-
2 * SPDX-License-Identifier: BSD-2-Clause
4 * Copyright (c) 2020 Poul-Henning Kamp
47 ftwd_func(void *priv, u_int cmd, int *error) in ftwd_func() argument
50 uint64_t timeout; in ftwd_func() local
54 if (cmd != 0) { in ftwd_func()
55 cmd &= WD_INTERVAL; in ftwd_func()
57 /* Convert the requested timeout to seconds. */ in ftwd_func()
58 if (cmd >= WD_TO_1SEC) in ftwd_func()
59 timeout = (uint64_t)1 << (cmd - WD_TO_1SEC); in ftwd_func()
61 timeout = 1; in ftwd_func()
63 if (timeout <= UINT8_MAX) { in ftwd_func()
64 val = timeout; in ftwd_func()
66 } else if ((timeout / 60) <= UINT8_MAX) { in ftwd_func()
67 val = timeout / 60; in ftwd_func()
88 superio_write(dev, 0xf5, 0x7d); // minutes, act high, 125ms in ftwd_func()
90 superio_write(dev, 0xf5, 0x75); // seconds, act high, 125ms in ftwd_func()
121 sc->wd_ev = EVENTHANDLER_REGISTER(watchdog_list, ftwd_func, dev, 0); in ftwd_attach()
131 if (sc->wd_ev != NULL) in ftwd_detach()
132 EVENTHANDLER_DEREGISTER(watchdog_list, sc->wd_ev); in ftwd_detach()