Lines Matching refs:wdd

69 	struct watchdog_device		wdd;  member
84 static bool wdt_is_running(struct watchdog_device *wdd) in wdt_is_running() argument
86 struct sp805_wdt *wdt = watchdog_get_drvdata(wdd); in wdt_is_running()
93 static int wdt_setload(struct watchdog_device *wdd, unsigned int timeout) in wdt_setload() argument
95 struct sp805_wdt *wdt = watchdog_get_drvdata(wdd); in wdt_setload()
114 wdd->timeout = div_u64((load + 1) * 2 + (rate / 2), rate); in wdt_setload()
121 static unsigned int wdt_timeleft(struct watchdog_device *wdd) in wdt_timeleft() argument
123 struct sp805_wdt *wdt = watchdog_get_drvdata(wdd); in wdt_timeleft()
138 wdt_restart(struct watchdog_device *wdd, unsigned long mode, void *cmd) in wdt_restart() argument
140 struct sp805_wdt *wdt = watchdog_get_drvdata(wdd); in wdt_restart()
153 static int wdt_config(struct watchdog_device *wdd, bool ping) in wdt_config() argument
155 struct sp805_wdt *wdt = watchdog_get_drvdata(wdd); in wdt_config()
186 static int wdt_ping(struct watchdog_device *wdd) in wdt_ping() argument
188 return wdt_config(wdd, true); in wdt_ping()
192 static int wdt_enable(struct watchdog_device *wdd) in wdt_enable() argument
194 return wdt_config(wdd, false); in wdt_enable()
198 static int wdt_disable(struct watchdog_device *wdd) in wdt_disable() argument
200 struct sp805_wdt *wdt = watchdog_get_drvdata(wdd); in wdt_disable()
276 wdt->wdd.info = &wdt_info; in sp805_wdt_probe()
277 wdt->wdd.ops = &wdt_ops; in sp805_wdt_probe()
278 wdt->wdd.parent = &adev->dev; in sp805_wdt_probe()
281 watchdog_set_nowayout(&wdt->wdd, nowayout); in sp805_wdt_probe()
282 watchdog_set_drvdata(&wdt->wdd, wdt); in sp805_wdt_probe()
283 watchdog_set_restart_priority(&wdt->wdd, 128); in sp805_wdt_probe()
284 watchdog_stop_on_unregister(&wdt->wdd); in sp805_wdt_probe()
290 wdt->wdd.timeout = DEFAULT_TIMEOUT; in sp805_wdt_probe()
291 watchdog_init_timeout(&wdt->wdd, 0, &adev->dev); in sp805_wdt_probe()
292 wdt_setload(&wdt->wdd, wdt->wdd.timeout); in sp805_wdt_probe()
298 if (wdt_is_running(&wdt->wdd)) { in sp805_wdt_probe()
299 wdt_enable(&wdt->wdd); in sp805_wdt_probe()
300 set_bit(WDOG_HW_RUNNING, &wdt->wdd.status); in sp805_wdt_probe()
303 watchdog_stop_on_reboot(&wdt->wdd); in sp805_wdt_probe()
304 ret = watchdog_register_device(&wdt->wdd); in sp805_wdt_probe()
321 watchdog_unregister_device(&wdt->wdd); in sp805_wdt_remove()
322 watchdog_set_drvdata(&wdt->wdd, NULL); in sp805_wdt_remove()
329 if (watchdog_active(&wdt->wdd)) in sp805_wdt_suspend()
330 return wdt_disable(&wdt->wdd); in sp805_wdt_suspend()
339 if (watchdog_active(&wdt->wdd)) in sp805_wdt_resume()
340 return wdt_enable(&wdt->wdd); in sp805_wdt_resume()