Lines Matching +full:timeout +full:- +full:period
1 /* SPDX-License-Identifier: Apache-2.0 */
35 uint32_t period; in dw_wdt_configure() local
38 LOG_ERR("Timeout not installed."); in dw_wdt_configure()
39 return -ENOTSUP; in dw_wdt_configure()
42 /* Configure timeout */ in dw_wdt_configure()
43 period = config & ~WDT_DW_FLAG_CONFIGURED; in dw_wdt_configure()
46 dw_wdt_timeout_period_init_set(base, period); in dw_wdt_configure()
49 dw_wdt_timeout_period_set(base, period); in dw_wdt_configure()
62 uint32_t period; in dw_wdt_calc_period() local
64 /* Window timeout is not supported by this driver */ in dw_wdt_calc_period()
65 if (config->window.min) { in dw_wdt_calc_period()
66 LOG_ERR("Window timeout is not supported."); in dw_wdt_calc_period()
67 return -ENOTSUP; in dw_wdt_calc_period()
70 period64 = (uint64_t)clk_freq * config->window.max; in dw_wdt_calc_period()
74 return -EINVAL; in dw_wdt_calc_period()
77 period = period64 - 1; in dw_wdt_calc_period()
78 period = ilog2(period); in dw_wdt_calc_period()
80 if (period >= dw_wdt_cnt_width_get(base)) { in dw_wdt_calc_period()
81 LOG_ERR("Watchdog timeout too long."); in dw_wdt_calc_period()
82 return -EINVAL; in dw_wdt_calc_period()
86 *period_out = WDT_DW_FLAG_CONFIGURED | (period >= 15 ? period - 15 : 0); in dw_wdt_calc_period()
97 return -ENODEV; in dw_wdt_probe()