Lines Matching full:wdd
70 * @wdd - hold watchdog device as is in WDT core
75 struct watchdog_device wdd; member
78 static int rti_wdt_start(struct watchdog_device *wdd) in rti_wdt_start() argument
81 struct rti_wdt_device *wdt = watchdog_get_drvdata(wdd); in rti_wdt_start()
84 ret = pm_runtime_resume_and_get(wdd->parent); in rti_wdt_start()
89 timer_margin = (u64)wdd->timeout * wdt->freq; in rti_wdt_start()
102 wdd->min_hw_heartbeat_ms = 520 * wdd->timeout + MAX_HW_ERROR; in rti_wdt_start()
117 static int rti_wdt_ping(struct watchdog_device *wdd) in rti_wdt_ping() argument
119 struct rti_wdt_device *wdt = watchdog_get_drvdata(wdd); in rti_wdt_ping()
129 static int rti_wdt_setup_hw_hb(struct watchdog_device *wdd, u32 wsize) in rti_wdt_setup_hw_hb() argument
142 wdd->min_hw_heartbeat_ms = 520 * heartbeat + MAX_HW_ERROR; in rti_wdt_setup_hw_hb()
147 wdd->min_hw_heartbeat_ms = 770 * heartbeat + MAX_HW_ERROR; in rti_wdt_setup_hw_hb()
152 wdd->min_hw_heartbeat_ms = 895 * heartbeat + MAX_HW_ERROR; in rti_wdt_setup_hw_hb()
157 wdd->min_hw_heartbeat_ms = 955 * heartbeat + MAX_HW_ERROR; in rti_wdt_setup_hw_hb()
162 wdd->min_hw_heartbeat_ms = 989 * heartbeat + MAX_HW_ERROR; in rti_wdt_setup_hw_hb()
172 static unsigned int rti_wdt_get_timeleft_ms(struct watchdog_device *wdd) in rti_wdt_get_timeleft_ms() argument
176 struct rti_wdt_device *wdt = watchdog_get_drvdata(wdd); in rti_wdt_get_timeleft_ms()
192 static unsigned int rti_wdt_get_timeleft(struct watchdog_device *wdd) in rti_wdt_get_timeleft() argument
194 return rti_wdt_get_timeleft_ms(wdd) / 1000; in rti_wdt_get_timeleft()
213 struct watchdog_device *wdd; in rti_wdt_probe() local
249 wdd = &wdt->wdd; in rti_wdt_probe()
250 wdd->info = &rti_wdt_info; in rti_wdt_probe()
251 wdd->ops = &rti_wdt_ops; in rti_wdt_probe()
252 wdd->min_timeout = 1; in rti_wdt_probe()
253 wdd->max_hw_heartbeat_ms = (WDT_PRELOAD_MAX << WDT_PRELOAD_SHIFT) / in rti_wdt_probe()
255 wdd->timeout = DEFAULT_HEARTBEAT; in rti_wdt_probe()
256 wdd->parent = dev; in rti_wdt_probe()
258 watchdog_set_drvdata(wdd, wdt); in rti_wdt_probe()
259 watchdog_set_nowayout(wdd, 1); in rti_wdt_probe()
260 watchdog_set_restart_priority(wdd, 128); in rti_wdt_probe()
274 set_bit(WDOG_HW_RUNNING, &wdd->status); in rti_wdt_probe()
275 time_left_ms = rti_wdt_get_timeleft_ms(wdd); in rti_wdt_probe()
288 ret = rti_wdt_setup_hw_hb(wdd, wsize); in rti_wdt_probe()
331 wdd->bootstatus |= WDIOF_CARDRESET; in rti_wdt_probe()
337 watchdog_init_timeout(wdd, heartbeat, dev); in rti_wdt_probe()
339 ret = watchdog_register_device(wdd); in rti_wdt_probe()
346 watchdog_set_last_hw_keepalive(wdd, last_ping); in rti_wdt_probe()
348 if (!watchdog_hw_running(wdd)) in rti_wdt_probe()
364 watchdog_unregister_device(&wdt->wdd); in rti_wdt_remove()