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