Lines Matching refs:wdd
69 struct watchdog_device wdd; member
87 static int stm32_iwdg_start(struct watchdog_device *wdd) in stm32_iwdg_start() argument
89 struct stm32_iwdg *wdt = watchdog_get_drvdata(wdd); in stm32_iwdg_start()
93 dev_dbg(wdd->parent, "%s\n", __func__); in stm32_iwdg_start()
95 tout = clamp_t(unsigned int, wdd->timeout, in stm32_iwdg_start()
96 wdd->min_timeout, wdd->max_hw_heartbeat_ms / 1000); in stm32_iwdg_start()
118 dev_err(wdd->parent, "Fail to set prescaler, reload regs\n"); in stm32_iwdg_start()
128 static int stm32_iwdg_ping(struct watchdog_device *wdd) in stm32_iwdg_ping() argument
130 struct stm32_iwdg *wdt = watchdog_get_drvdata(wdd); in stm32_iwdg_ping()
132 dev_dbg(wdd->parent, "%s\n", __func__); in stm32_iwdg_ping()
140 static int stm32_iwdg_set_timeout(struct watchdog_device *wdd, in stm32_iwdg_set_timeout() argument
143 dev_dbg(wdd->parent, "%s timeout: %d sec\n", __func__, timeout); in stm32_iwdg_set_timeout()
145 wdd->timeout = timeout; in stm32_iwdg_set_timeout()
147 if (watchdog_active(wdd)) in stm32_iwdg_set_timeout()
148 return stm32_iwdg_start(wdd); in stm32_iwdg_set_timeout()
229 struct watchdog_device *wdd; in stm32_iwdg_probe() local
253 wdd = &wdt->wdd; in stm32_iwdg_probe()
254 wdd->parent = dev; in stm32_iwdg_probe()
255 wdd->info = &stm32_iwdg_info; in stm32_iwdg_probe()
256 wdd->ops = &stm32_iwdg_ops; in stm32_iwdg_probe()
257 wdd->min_timeout = DIV_ROUND_UP((RLR_MIN + 1) * PR_MIN, wdt->rate); in stm32_iwdg_probe()
258 wdd->max_hw_heartbeat_ms = ((RLR_MAX + 1) * wdt->data->max_prescaler * in stm32_iwdg_probe()
261 watchdog_set_drvdata(wdd, wdt); in stm32_iwdg_probe()
262 watchdog_set_nowayout(wdd, WATCHDOG_NOWAYOUT); in stm32_iwdg_probe()
263 watchdog_init_timeout(wdd, 0, dev); in stm32_iwdg_probe()
275 ret = stm32_iwdg_start(wdd); in stm32_iwdg_probe()
280 set_bit(WDOG_HW_RUNNING, &wdd->status); in stm32_iwdg_probe()
283 ret = devm_watchdog_register_device(dev, wdd); in stm32_iwdg_probe()