Lines Matching full:wdd
61 struct watchdog_device wdd; member
67 static inline struct sprd_wdt *to_sprd_wdt(struct watchdog_device *wdd) in to_sprd_wdt() argument
69 return container_of(wdd, struct sprd_wdt, wdd); in to_sprd_wdt()
89 watchdog_notify_pretimeout(&wdt->wdd); in sprd_wdt_isr()
178 static int sprd_wdt_start(struct watchdog_device *wdd) in sprd_wdt_start() argument
180 struct sprd_wdt *wdt = to_sprd_wdt(wdd); in sprd_wdt_start()
184 ret = sprd_wdt_load_value(wdt, wdd->timeout, wdd->pretimeout); in sprd_wdt_start()
193 set_bit(WDOG_HW_RUNNING, &wdd->status); in sprd_wdt_start()
198 static int sprd_wdt_stop(struct watchdog_device *wdd) in sprd_wdt_stop() argument
200 struct sprd_wdt *wdt = to_sprd_wdt(wdd); in sprd_wdt_stop()
212 static int sprd_wdt_set_timeout(struct watchdog_device *wdd, in sprd_wdt_set_timeout() argument
215 struct sprd_wdt *wdt = to_sprd_wdt(wdd); in sprd_wdt_set_timeout()
217 if (timeout == wdd->timeout) in sprd_wdt_set_timeout()
220 wdd->timeout = timeout; in sprd_wdt_set_timeout()
222 return sprd_wdt_load_value(wdt, timeout, wdd->pretimeout); in sprd_wdt_set_timeout()
225 static int sprd_wdt_set_pretimeout(struct watchdog_device *wdd, in sprd_wdt_set_pretimeout() argument
228 struct sprd_wdt *wdt = to_sprd_wdt(wdd); in sprd_wdt_set_pretimeout()
230 if (new_pretimeout < wdd->min_timeout) in sprd_wdt_set_pretimeout()
233 wdd->pretimeout = new_pretimeout; in sprd_wdt_set_pretimeout()
235 return sprd_wdt_load_value(wdt, wdd->timeout, new_pretimeout); in sprd_wdt_set_pretimeout()
238 static u32 sprd_wdt_get_timeleft(struct watchdog_device *wdd) in sprd_wdt_get_timeleft() argument
240 struct sprd_wdt *wdt = to_sprd_wdt(wdd); in sprd_wdt_get_timeleft()
301 wdt->wdd.info = &sprd_wdt_info; in sprd_wdt_probe()
302 wdt->wdd.ops = &sprd_wdt_ops; in sprd_wdt_probe()
303 wdt->wdd.parent = dev; in sprd_wdt_probe()
304 wdt->wdd.min_timeout = SPRD_WDT_MIN_TIMEOUT; in sprd_wdt_probe()
305 wdt->wdd.max_timeout = SPRD_WDT_MAX_TIMEOUT; in sprd_wdt_probe()
306 wdt->wdd.timeout = SPRD_WDT_MAX_TIMEOUT; in sprd_wdt_probe()
319 watchdog_set_nowayout(&wdt->wdd, WATCHDOG_NOWAYOUT); in sprd_wdt_probe()
320 watchdog_init_timeout(&wdt->wdd, 0, dev); in sprd_wdt_probe()
322 ret = devm_watchdog_register_device(dev, &wdt->wdd); in sprd_wdt_probe()
336 if (watchdog_active(&wdt->wdd)) in sprd_wdt_pm_suspend()
337 sprd_wdt_stop(&wdt->wdd); in sprd_wdt_pm_suspend()
352 if (watchdog_active(&wdt->wdd)) in sprd_wdt_pm_resume()
353 ret = sprd_wdt_start(&wdt->wdd); in sprd_wdt_pm_resume()