Lines Matching refs:wdd

90 	struct watchdog_device	wdd;  member
101 #define to_dw_wdt(wdd) container_of(wdd, struct dw_wdt, wdd) argument
189 static int dw_wdt_ping(struct watchdog_device *wdd) in dw_wdt_ping() argument
191 struct dw_wdt *dw_wdt = to_dw_wdt(wdd); in dw_wdt_ping()
199 static int dw_wdt_set_timeout(struct watchdog_device *wdd, unsigned int top_s) in dw_wdt_set_timeout() argument
201 struct dw_wdt *dw_wdt = to_dw_wdt(wdd); in dw_wdt_set_timeout()
216 wdd->pretimeout = timeout; in dw_wdt_set_timeout()
218 wdd->pretimeout = 0; in dw_wdt_set_timeout()
230 if (watchdog_active(wdd)) in dw_wdt_set_timeout()
231 dw_wdt_ping(wdd); in dw_wdt_set_timeout()
238 if (top_s * 1000 <= wdd->max_hw_heartbeat_ms) in dw_wdt_set_timeout()
239 wdd->timeout = timeout * dw_wdt->rmod; in dw_wdt_set_timeout()
241 wdd->timeout = top_s; in dw_wdt_set_timeout()
246 static int dw_wdt_set_pretimeout(struct watchdog_device *wdd, unsigned int req) in dw_wdt_set_pretimeout() argument
248 struct dw_wdt *dw_wdt = to_dw_wdt(wdd); in dw_wdt_set_pretimeout()
256 dw_wdt_set_timeout(wdd, wdd->timeout); in dw_wdt_set_pretimeout()
275 static int dw_wdt_start(struct watchdog_device *wdd) in dw_wdt_start() argument
277 struct dw_wdt *dw_wdt = to_dw_wdt(wdd); in dw_wdt_start()
279 dw_wdt_set_timeout(wdd, wdd->timeout); in dw_wdt_start()
280 dw_wdt_ping(&dw_wdt->wdd); in dw_wdt_start()
286 static int dw_wdt_stop(struct watchdog_device *wdd) in dw_wdt_stop() argument
288 struct dw_wdt *dw_wdt = to_dw_wdt(wdd); in dw_wdt_stop()
291 set_bit(WDOG_HW_RUNNING, &wdd->status); in dw_wdt_stop()
301 static int dw_wdt_restart(struct watchdog_device *wdd, in dw_wdt_restart() argument
304 struct dw_wdt *dw_wdt = to_dw_wdt(wdd); in dw_wdt_restart()
320 static unsigned int dw_wdt_get_timeleft(struct watchdog_device *wdd) in dw_wdt_get_timeleft() argument
322 struct dw_wdt *dw_wdt = to_dw_wdt(wdd); in dw_wdt_get_timeleft()
332 sec += wdd->pretimeout; in dw_wdt_get_timeleft()
374 watchdog_notify_pretimeout(&dw_wdt->wdd); in dw_wdt_irq()
410 dw_wdt_ping(&dw_wdt->wdd); in dw_wdt_resume()
523 struct device *dev = dw_wdt->wdd.parent; in dw_wdt_dbgfs_init()
554 struct watchdog_device *wdd; in dw_wdt_drv_probe() local
629 dw_wdt->wdd.info = &dw_wdt_pt_ident; in dw_wdt_drv_probe()
634 dw_wdt->wdd.info = &dw_wdt_ident; in dw_wdt_drv_probe()
643 wdd = &dw_wdt->wdd; in dw_wdt_drv_probe()
644 wdd->ops = &dw_wdt_ops; in dw_wdt_drv_probe()
645 wdd->min_timeout = dw_wdt_get_min_timeout(dw_wdt); in dw_wdt_drv_probe()
646 wdd->max_hw_heartbeat_ms = dw_wdt_get_max_timeout_ms(dw_wdt); in dw_wdt_drv_probe()
647 wdd->parent = dev; in dw_wdt_drv_probe()
649 watchdog_set_drvdata(wdd, dw_wdt); in dw_wdt_drv_probe()
650 watchdog_set_nowayout(wdd, nowayout); in dw_wdt_drv_probe()
651 watchdog_init_timeout(wdd, 0, dev); in dw_wdt_drv_probe()
659 wdd->timeout = dw_wdt_get_timeout(dw_wdt); in dw_wdt_drv_probe()
660 set_bit(WDOG_HW_RUNNING, &wdd->status); in dw_wdt_drv_probe()
662 wdd->timeout = DW_WDT_DEFAULT_SECONDS; in dw_wdt_drv_probe()
663 watchdog_init_timeout(wdd, 0, dev); in dw_wdt_drv_probe()
668 watchdog_set_restart_priority(wdd, 128); in dw_wdt_drv_probe()
670 ret = watchdog_register_device(wdd); in dw_wdt_drv_probe()
692 watchdog_unregister_device(&dw_wdt->wdd); in dw_wdt_drv_remove()