Lines Matching defs:wdd

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