Lines Matching refs:wdd
66 struct watchdog_device wdd; member
69 static int rti_wdt_start(struct watchdog_device *wdd) in rti_wdt_start() argument
72 struct rti_wdt_device *wdt = watchdog_get_drvdata(wdd); in rti_wdt_start()
75 timer_margin = (u64)wdd->timeout * wdt->freq; in rti_wdt_start()
88 wdd->min_hw_heartbeat_ms = 500 * wdd->timeout; in rti_wdt_start()
103 static int rti_wdt_ping(struct watchdog_device *wdd) in rti_wdt_ping() argument
105 struct rti_wdt_device *wdt = watchdog_get_drvdata(wdd); in rti_wdt_ping()
115 static int rti_wdt_setup_hw_hb(struct watchdog_device *wdd, u32 wsize) in rti_wdt_setup_hw_hb() argument
126 wdd->min_hw_heartbeat_ms = 500 * heartbeat; in rti_wdt_setup_hw_hb()
131 wdd->min_hw_heartbeat_ms = 750 * heartbeat; in rti_wdt_setup_hw_hb()
136 wdd->min_hw_heartbeat_ms = 875 * heartbeat; in rti_wdt_setup_hw_hb()
141 wdd->min_hw_heartbeat_ms = 935 * heartbeat; in rti_wdt_setup_hw_hb()
146 wdd->min_hw_heartbeat_ms = 969 * heartbeat; in rti_wdt_setup_hw_hb()
156 static unsigned int rti_wdt_get_timeleft_ms(struct watchdog_device *wdd) in rti_wdt_get_timeleft_ms() argument
160 struct rti_wdt_device *wdt = watchdog_get_drvdata(wdd); in rti_wdt_get_timeleft_ms()
176 static unsigned int rti_wdt_get_timeleft(struct watchdog_device *wdd) in rti_wdt_get_timeleft() argument
178 return rti_wdt_get_timeleft_ms(wdd) / 1000; in rti_wdt_get_timeleft()
197 struct watchdog_device *wdd; in rti_wdt_probe() local
236 wdd = &wdt->wdd; in rti_wdt_probe()
237 wdd->info = &rti_wdt_info; in rti_wdt_probe()
238 wdd->ops = &rti_wdt_ops; in rti_wdt_probe()
239 wdd->min_timeout = 1; in rti_wdt_probe()
240 wdd->max_hw_heartbeat_ms = (WDT_PRELOAD_MAX << WDT_PRELOAD_SHIFT) / in rti_wdt_probe()
242 wdd->parent = dev; in rti_wdt_probe()
244 watchdog_set_drvdata(wdd, wdt); in rti_wdt_probe()
245 watchdog_set_nowayout(wdd, 1); in rti_wdt_probe()
246 watchdog_set_restart_priority(wdd, 128); in rti_wdt_probe()
260 set_bit(WDOG_HW_RUNNING, &wdd->status); in rti_wdt_probe()
261 time_left_ms = rti_wdt_get_timeleft_ms(wdd); in rti_wdt_probe()
274 ret = rti_wdt_setup_hw_hb(wdd, wsize); in rti_wdt_probe()
287 watchdog_init_timeout(wdd, heartbeat, dev); in rti_wdt_probe()
289 ret = watchdog_register_device(wdd); in rti_wdt_probe()
296 watchdog_set_last_hw_keepalive(wdd, last_ping); in rti_wdt_probe()
311 watchdog_unregister_device(&wdt->wdd); in rti_wdt_remove()