Lines Matching full:wdd

79 	struct watchdog_device	wdd;  member
97 static int stm32_iwdg_start(struct watchdog_device *wdd) in stm32_iwdg_start() argument
99 struct stm32_iwdg *wdt = watchdog_get_drvdata(wdd); in stm32_iwdg_start()
103 dev_dbg(wdd->parent, "%s\n", __func__); in stm32_iwdg_start()
105 if (!wdd->pretimeout) in stm32_iwdg_start()
106 wdd->pretimeout = 3 * wdd->timeout / 4; in stm32_iwdg_start()
108 tout = clamp_t(unsigned int, wdd->timeout, in stm32_iwdg_start()
109 wdd->min_timeout, wdd->max_hw_heartbeat_ms / 1000); in stm32_iwdg_start()
110 ptot = clamp_t(unsigned int, tout - wdd->pretimeout, in stm32_iwdg_start()
111 wdd->min_timeout, tout); in stm32_iwdg_start()
136 dev_err(wdd->parent, "Fail to set prescaler, reload regs\n"); in stm32_iwdg_start()
146 static int stm32_iwdg_ping(struct watchdog_device *wdd) in stm32_iwdg_ping() argument
148 struct stm32_iwdg *wdt = watchdog_get_drvdata(wdd); in stm32_iwdg_ping()
150 dev_dbg(wdd->parent, "%s\n", __func__); in stm32_iwdg_ping()
158 static int stm32_iwdg_set_timeout(struct watchdog_device *wdd, in stm32_iwdg_set_timeout() argument
161 dev_dbg(wdd->parent, "%s timeout: %d sec\n", __func__, timeout); in stm32_iwdg_set_timeout()
163 wdd->timeout = timeout; in stm32_iwdg_set_timeout()
165 if (watchdog_active(wdd)) in stm32_iwdg_set_timeout()
166 return stm32_iwdg_start(wdd); in stm32_iwdg_set_timeout()
171 static int stm32_iwdg_set_pretimeout(struct watchdog_device *wdd, in stm32_iwdg_set_pretimeout() argument
174 dev_dbg(wdd->parent, "%s pretimeout: %d sec\n", __func__, pretimeout); in stm32_iwdg_set_pretimeout()
176 wdd->pretimeout = pretimeout; in stm32_iwdg_set_pretimeout()
178 if (watchdog_active(wdd)) in stm32_iwdg_set_pretimeout()
179 return stm32_iwdg_start(wdd); in stm32_iwdg_set_pretimeout()
186 struct watchdog_device *wdd = wdog_arg; in stm32_iwdg_isr() local
187 struct stm32_iwdg *wdt = watchdog_get_drvdata(wdd); in stm32_iwdg_isr()
194 watchdog_notify_pretimeout(wdd); in stm32_iwdg_isr()
282 struct watchdog_device *wdd = &wdt->wdd; in stm32_iwdg_irq_init() local
304 dev_name(dev), wdd); in stm32_iwdg_irq_init()
308 wdd->info = &stm32_iwdg_preinfo; in stm32_iwdg_irq_init()
315 struct watchdog_device *wdd; in stm32_iwdg_probe() local
337 wdd = &wdt->wdd; in stm32_iwdg_probe()
338 wdd->parent = dev; in stm32_iwdg_probe()
339 wdd->info = &stm32_iwdg_info; in stm32_iwdg_probe()
340 wdd->ops = &stm32_iwdg_ops; in stm32_iwdg_probe()
341 wdd->timeout = DEFAULT_TIMEOUT; in stm32_iwdg_probe()
342 wdd->min_timeout = DIV_ROUND_UP((RLR_MIN + 1) * PR_MIN, wdt->rate); in stm32_iwdg_probe()
343 wdd->max_hw_heartbeat_ms = ((RLR_MAX + 1) * wdt->data->max_prescaler * in stm32_iwdg_probe()
346 /* Initialize IRQ, this might override wdd->info, hence it is here. */ in stm32_iwdg_probe()
351 watchdog_set_drvdata(wdd, wdt); in stm32_iwdg_probe()
352 watchdog_set_nowayout(wdd, WATCHDOG_NOWAYOUT); in stm32_iwdg_probe()
353 watchdog_init_timeout(wdd, 0, dev); in stm32_iwdg_probe()
365 ret = stm32_iwdg_start(wdd); in stm32_iwdg_probe()
370 set_bit(WDOG_HW_RUNNING, &wdd->status); in stm32_iwdg_probe()
373 ret = devm_watchdog_register_device(dev, wdd); in stm32_iwdg_probe()