Lines Matching +full:window +full:- +full:mode

3  * SPDX-License-Identifier: Apache-2.0
36 const struct wdt_npm2100_config *config = dev->config; in wdt_npm2100_setup()
37 struct wdt_npm2100_data *data = dev->data; in wdt_npm2100_setup()
39 if (!data->timeout_valid) { in wdt_npm2100_setup()
40 return -EINVAL; in wdt_npm2100_setup()
43 return mfd_npm2100_start_timer(config->mfd); in wdt_npm2100_setup()
48 const struct wdt_npm2100_config *config = dev->config; in wdt_npm2100_disable()
49 struct wdt_npm2100_data *data = dev->data; in wdt_npm2100_disable()
52 ret = i2c_reg_write_byte_dt(&config->i2c, TIMER_TASKS_STOP, 1U); in wdt_npm2100_disable()
57 data->timeout_valid = false; in wdt_npm2100_disable()
65 const struct wdt_npm2100_config *config = dev->config; in wdt_npm2100_install_timeout()
66 struct wdt_npm2100_data *data = dev->data; in wdt_npm2100_install_timeout()
67 uint8_t mode; in wdt_npm2100_install_timeout() local
70 if (data->timeout_valid) { in wdt_npm2100_install_timeout()
71 return -ENOMEM; in wdt_npm2100_install_timeout()
74 if (timeout->window.min != 0U) { in wdt_npm2100_install_timeout()
75 return -EINVAL; in wdt_npm2100_install_timeout()
78 switch (timeout->flags & WDT_FLAG_RESET_MASK) { in wdt_npm2100_install_timeout()
81 mode = NPM2100_TIMER_MODE_GENERAL_PURPOSE; in wdt_npm2100_install_timeout()
85 mode = NPM2100_TIMER_MODE_WDT_RESET; in wdt_npm2100_install_timeout()
89 mode = NPM2100_TIMER_MODE_WDT_POWER_CYCLE; in wdt_npm2100_install_timeout()
92 return -EINVAL; in wdt_npm2100_install_timeout()
95 ret = mfd_npm2100_set_timer(config->mfd, timeout->window.max, mode); in wdt_npm2100_install_timeout()
100 data->timeout_valid = true; in wdt_npm2100_install_timeout()
107 const struct wdt_npm2100_config *config = dev->config; in wdt_npm2100_feed()
110 return -EINVAL; in wdt_npm2100_feed()
113 return i2c_reg_write_byte_dt(&config->i2c, TIMER_TASKS_KICK, 1U); in wdt_npm2100_feed()
125 const struct wdt_npm2100_config *config = dev->config; in wdt_npm2100_init()
127 if (!i2c_is_ready_dt(&config->i2c)) { in wdt_npm2100_init()
128 return -ENODEV; in wdt_npm2100_init()