Lines Matching refs:wdd
67 struct watchdog_device wdd; member
82 static bool wdt_is_running(struct watchdog_device *wdd) in wdt_is_running() argument
84 struct sp805_wdt *wdt = watchdog_get_drvdata(wdd); in wdt_is_running()
91 static int wdt_setload(struct watchdog_device *wdd, unsigned int timeout) in wdt_setload() argument
93 struct sp805_wdt *wdt = watchdog_get_drvdata(wdd); in wdt_setload()
112 wdd->timeout = div_u64((load + 1) * 2 + (rate / 2), rate); in wdt_setload()
119 static unsigned int wdt_timeleft(struct watchdog_device *wdd) in wdt_timeleft() argument
121 struct sp805_wdt *wdt = watchdog_get_drvdata(wdd); in wdt_timeleft()
136 wdt_restart(struct watchdog_device *wdd, unsigned long mode, void *cmd) in wdt_restart() argument
138 struct sp805_wdt *wdt = watchdog_get_drvdata(wdd); in wdt_restart()
151 static int wdt_config(struct watchdog_device *wdd, bool ping) in wdt_config() argument
153 struct sp805_wdt *wdt = watchdog_get_drvdata(wdd); in wdt_config()
184 static int wdt_ping(struct watchdog_device *wdd) in wdt_ping() argument
186 return wdt_config(wdd, true); in wdt_ping()
190 static int wdt_enable(struct watchdog_device *wdd) in wdt_enable() argument
192 return wdt_config(wdd, false); in wdt_enable()
196 static int wdt_disable(struct watchdog_device *wdd) in wdt_disable() argument
198 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()
281 wdt->wdd.timeout = DEFAULT_TIMEOUT; in sp805_wdt_probe()
282 watchdog_init_timeout(&wdt->wdd, 0, &adev->dev); in sp805_wdt_probe()
283 wdt_setload(&wdt->wdd, wdt->wdd.timeout); in sp805_wdt_probe()
289 if (wdt_is_running(&wdt->wdd)) { in sp805_wdt_probe()
290 wdt_enable(&wdt->wdd); in sp805_wdt_probe()
291 set_bit(WDOG_HW_RUNNING, &wdt->wdd.status); in sp805_wdt_probe()
294 ret = watchdog_register_device(&wdt->wdd); in sp805_wdt_probe()
311 watchdog_unregister_device(&wdt->wdd); in sp805_wdt_remove()
312 watchdog_set_drvdata(&wdt->wdd, NULL); in sp805_wdt_remove()
319 if (watchdog_active(&wdt->wdd)) in sp805_wdt_suspend()
320 return wdt_disable(&wdt->wdd); in sp805_wdt_suspend()
329 if (watchdog_active(&wdt->wdd)) in sp805_wdt_resume()
330 return wdt_enable(&wdt->wdd); in sp805_wdt_resume()