Lines Matching refs:wdd
44 struct watchdog_device wdd; member
48 static inline struct npcm_wdt *to_npcm_wdt(struct watchdog_device *wdd) in to_npcm_wdt() argument
50 return container_of(wdd, struct npcm_wdt, wdd); in to_npcm_wdt()
53 static int npcm_wdt_ping(struct watchdog_device *wdd) in npcm_wdt_ping() argument
55 struct npcm_wdt *wdt = to_npcm_wdt(wdd); in npcm_wdt_ping()
64 static int npcm_wdt_start(struct watchdog_device *wdd) in npcm_wdt_start() argument
66 struct npcm_wdt *wdt = to_npcm_wdt(wdd); in npcm_wdt_start()
69 if (wdd->timeout < 2) in npcm_wdt_start()
71 else if (wdd->timeout < 3) in npcm_wdt_start()
73 else if (wdd->timeout < 6) in npcm_wdt_start()
75 else if (wdd->timeout < 11) in npcm_wdt_start()
77 else if (wdd->timeout < 22) in npcm_wdt_start()
79 else if (wdd->timeout < 44) in npcm_wdt_start()
81 else if (wdd->timeout < 87) in npcm_wdt_start()
83 else if (wdd->timeout < 173) in npcm_wdt_start()
85 else if (wdd->timeout < 688) in npcm_wdt_start()
97 static int npcm_wdt_stop(struct watchdog_device *wdd) in npcm_wdt_stop() argument
99 struct npcm_wdt *wdt = to_npcm_wdt(wdd); in npcm_wdt_stop()
106 static int npcm_wdt_set_timeout(struct watchdog_device *wdd, in npcm_wdt_set_timeout() argument
110 wdd->timeout = 1; in npcm_wdt_set_timeout()
112 wdd->timeout = 2; in npcm_wdt_set_timeout()
114 wdd->timeout = 5; in npcm_wdt_set_timeout()
116 wdd->timeout = 10; in npcm_wdt_set_timeout()
118 wdd->timeout = 21; in npcm_wdt_set_timeout()
120 wdd->timeout = 43; in npcm_wdt_set_timeout()
122 wdd->timeout = 86; in npcm_wdt_set_timeout()
124 wdd->timeout = 172; in npcm_wdt_set_timeout()
126 wdd->timeout = 687; in npcm_wdt_set_timeout()
128 wdd->timeout = 2750; in npcm_wdt_set_timeout()
130 if (watchdog_active(wdd)) in npcm_wdt_set_timeout()
131 npcm_wdt_start(wdd); in npcm_wdt_set_timeout()
140 watchdog_notify_pretimeout(&wdt->wdd); in npcm_wdt_interrupt()
145 static int npcm_wdt_restart(struct watchdog_device *wdd, in npcm_wdt_restart() argument
148 struct npcm_wdt *wdt = to_npcm_wdt(wdd); in npcm_wdt_restart()
156 static bool npcm_is_running(struct watchdog_device *wdd) in npcm_is_running() argument
158 struct npcm_wdt *wdt = to_npcm_wdt(wdd); in npcm_is_running()
198 wdt->wdd.info = &npcm_wdt_info; in npcm_wdt_probe()
199 wdt->wdd.ops = &npcm_wdt_ops; in npcm_wdt_probe()
200 wdt->wdd.min_timeout = 1; in npcm_wdt_probe()
201 wdt->wdd.max_timeout = 2750; in npcm_wdt_probe()
202 wdt->wdd.parent = dev; in npcm_wdt_probe()
204 wdt->wdd.timeout = 86; in npcm_wdt_probe()
205 watchdog_init_timeout(&wdt->wdd, 0, dev); in npcm_wdt_probe()
208 npcm_wdt_set_timeout(&wdt->wdd, wdt->wdd.timeout); in npcm_wdt_probe()
210 if (npcm_is_running(&wdt->wdd)) { in npcm_wdt_probe()
212 npcm_wdt_start(&wdt->wdd); in npcm_wdt_probe()
213 set_bit(WDOG_HW_RUNNING, &wdt->wdd.status); in npcm_wdt_probe()
221 ret = devm_watchdog_register_device(dev, &wdt->wdd); in npcm_wdt_probe()