Lines Matching refs:wdd

45 	struct watchdog_device  wdd;  member
50 static inline struct npcm_wdt *to_npcm_wdt(struct watchdog_device *wdd) in to_npcm_wdt() argument
52 return container_of(wdd, struct npcm_wdt, wdd); in to_npcm_wdt()
55 static int npcm_wdt_ping(struct watchdog_device *wdd) in npcm_wdt_ping() argument
57 struct npcm_wdt *wdt = to_npcm_wdt(wdd); in npcm_wdt_ping()
66 static int npcm_wdt_start(struct watchdog_device *wdd) in npcm_wdt_start() argument
68 struct npcm_wdt *wdt = to_npcm_wdt(wdd); in npcm_wdt_start()
74 if (wdd->timeout < 2) in npcm_wdt_start()
76 else if (wdd->timeout < 3) in npcm_wdt_start()
78 else if (wdd->timeout < 6) in npcm_wdt_start()
80 else if (wdd->timeout < 11) in npcm_wdt_start()
82 else if (wdd->timeout < 22) in npcm_wdt_start()
84 else if (wdd->timeout < 44) in npcm_wdt_start()
86 else if (wdd->timeout < 87) in npcm_wdt_start()
88 else if (wdd->timeout < 173) in npcm_wdt_start()
90 else if (wdd->timeout < 688) in npcm_wdt_start()
102 static int npcm_wdt_stop(struct watchdog_device *wdd) in npcm_wdt_stop() argument
104 struct npcm_wdt *wdt = to_npcm_wdt(wdd); in npcm_wdt_stop()
114 static int npcm_wdt_set_timeout(struct watchdog_device *wdd, in npcm_wdt_set_timeout() argument
118 wdd->timeout = 1; in npcm_wdt_set_timeout()
120 wdd->timeout = 2; in npcm_wdt_set_timeout()
122 wdd->timeout = 5; in npcm_wdt_set_timeout()
124 wdd->timeout = 10; in npcm_wdt_set_timeout()
126 wdd->timeout = 21; in npcm_wdt_set_timeout()
128 wdd->timeout = 43; in npcm_wdt_set_timeout()
130 wdd->timeout = 86; in npcm_wdt_set_timeout()
132 wdd->timeout = 172; in npcm_wdt_set_timeout()
134 wdd->timeout = 687; in npcm_wdt_set_timeout()
136 wdd->timeout = 2750; in npcm_wdt_set_timeout()
138 if (watchdog_active(wdd)) in npcm_wdt_set_timeout()
139 npcm_wdt_start(wdd); in npcm_wdt_set_timeout()
148 watchdog_notify_pretimeout(&wdt->wdd); in npcm_wdt_interrupt()
153 static int npcm_wdt_restart(struct watchdog_device *wdd, in npcm_wdt_restart() argument
156 struct npcm_wdt *wdt = to_npcm_wdt(wdd); in npcm_wdt_restart()
168 static bool npcm_is_running(struct watchdog_device *wdd) in npcm_is_running() argument
170 struct npcm_wdt *wdt = to_npcm_wdt(wdd); in npcm_is_running()
214 wdt->wdd.info = &npcm_wdt_info; in npcm_wdt_probe()
215 wdt->wdd.ops = &npcm_wdt_ops; in npcm_wdt_probe()
216 wdt->wdd.min_timeout = 1; in npcm_wdt_probe()
217 wdt->wdd.max_timeout = 2750; in npcm_wdt_probe()
218 wdt->wdd.parent = dev; in npcm_wdt_probe()
220 wdt->wdd.timeout = 86; in npcm_wdt_probe()
221 watchdog_init_timeout(&wdt->wdd, 0, dev); in npcm_wdt_probe()
224 npcm_wdt_set_timeout(&wdt->wdd, wdt->wdd.timeout); in npcm_wdt_probe()
226 if (npcm_is_running(&wdt->wdd)) { in npcm_wdt_probe()
228 npcm_wdt_start(&wdt->wdd); in npcm_wdt_probe()
229 set_bit(WDOG_HW_RUNNING, &wdt->wdd.status); in npcm_wdt_probe()
237 ret = devm_watchdog_register_device(dev, &wdt->wdd); in npcm_wdt_probe()