Lines Matching refs:wdd

68 	struct watchdog_device		wdd;  member
83 static bool wdt_is_running(struct watchdog_device *wdd) in wdt_is_running() argument
85 struct sp805_wdt *wdt = watchdog_get_drvdata(wdd); in wdt_is_running()
92 static int wdt_setload(struct watchdog_device *wdd, unsigned int timeout) in wdt_setload() argument
94 struct sp805_wdt *wdt = watchdog_get_drvdata(wdd); in wdt_setload()
113 wdd->timeout = div_u64((load + 1) * 2 + (rate / 2), rate); in wdt_setload()
120 static unsigned int wdt_timeleft(struct watchdog_device *wdd) in wdt_timeleft() argument
122 struct sp805_wdt *wdt = watchdog_get_drvdata(wdd); in wdt_timeleft()
137 wdt_restart(struct watchdog_device *wdd, unsigned long mode, void *cmd) in wdt_restart() argument
139 struct sp805_wdt *wdt = watchdog_get_drvdata(wdd); in wdt_restart()
152 static int wdt_config(struct watchdog_device *wdd, bool ping) in wdt_config() argument
154 struct sp805_wdt *wdt = watchdog_get_drvdata(wdd); in wdt_config()
185 static int wdt_ping(struct watchdog_device *wdd) in wdt_ping() argument
187 return wdt_config(wdd, true); in wdt_ping()
191 static int wdt_enable(struct watchdog_device *wdd) in wdt_enable() argument
193 return wdt_config(wdd, false); in wdt_enable()
197 static int wdt_disable(struct watchdog_device *wdd) in wdt_disable() argument
199 struct sp805_wdt *wdt = watchdog_get_drvdata(wdd); in wdt_disable()
268 wdt->wdd.info = &wdt_info; in sp805_wdt_probe()
269 wdt->wdd.ops = &wdt_ops; in sp805_wdt_probe()
270 wdt->wdd.parent = &adev->dev; in sp805_wdt_probe()
273 watchdog_set_nowayout(&wdt->wdd, nowayout); in sp805_wdt_probe()
274 watchdog_set_drvdata(&wdt->wdd, wdt); in sp805_wdt_probe()
275 watchdog_set_restart_priority(&wdt->wdd, 128); in sp805_wdt_probe()
276 watchdog_stop_on_unregister(&wdt->wdd); in sp805_wdt_probe()
282 wdt->wdd.timeout = DEFAULT_TIMEOUT; in sp805_wdt_probe()
283 watchdog_init_timeout(&wdt->wdd, 0, &adev->dev); in sp805_wdt_probe()
284 wdt_setload(&wdt->wdd, wdt->wdd.timeout); in sp805_wdt_probe()
290 if (wdt_is_running(&wdt->wdd)) { in sp805_wdt_probe()
291 wdt_enable(&wdt->wdd); in sp805_wdt_probe()
292 set_bit(WDOG_HW_RUNNING, &wdt->wdd.status); in sp805_wdt_probe()
295 watchdog_stop_on_reboot(&wdt->wdd); in sp805_wdt_probe()
296 ret = watchdog_register_device(&wdt->wdd); in sp805_wdt_probe()
313 watchdog_unregister_device(&wdt->wdd); in sp805_wdt_remove()
314 watchdog_set_drvdata(&wdt->wdd, NULL); in sp805_wdt_remove()
321 if (watchdog_active(&wdt->wdd)) in sp805_wdt_suspend()
322 return wdt_disable(&wdt->wdd); in sp805_wdt_suspend()
331 if (watchdog_active(&wdt->wdd)) in sp805_wdt_resume()
332 return wdt_enable(&wdt->wdd); in sp805_wdt_resume()