Lines Matching refs:wdd
48 * @wdd: Underlying watchdog device
54 struct watchdog_device wdd;
60 static struct rave_sp_wdt *to_rave_sp_wdt(struct watchdog_device *wdd)
62 return container_of(wdd, struct rave_sp_wdt, wdd);
65 static int rave_sp_wdt_exec(struct watchdog_device *wdd, void *data,
68 return rave_sp_exec(to_rave_sp_wdt(wdd)->sp,
72 static int rave_sp_wdt_legacy_configure(struct watchdog_device *wdd, bool on)
79 [4] = on ? wdd->timeout : 0,
82 return rave_sp_wdt_exec(wdd, cmd, sizeof(cmd));
85 static int rave_sp_wdt_rdu_configure(struct watchdog_device *wdd, bool on)
91 [3] = (u8)wdd->timeout,
92 [4] = (u8)(wdd->timeout >> 8),
95 return rave_sp_wdt_exec(wdd, cmd, sizeof(cmd));
101 * @wdd: Device to configure
110 * the value of 'wdd->timeout'.
112 static int rave_sp_wdt_configure(struct watchdog_device *wdd, bool on)
114 return to_rave_sp_wdt(wdd)->variant->configure(wdd, on);
117 static int rave_sp_wdt_legacy_restart(struct watchdog_device *wdd)
125 return rave_sp_wdt_exec(wdd, cmd, sizeof(cmd));
128 static int rave_sp_wdt_rdu_restart(struct watchdog_device *wdd)
137 return rave_sp_wdt_exec(wdd, cmd, sizeof(cmd));
154 const int ret = sp_wd->variant->restart(&sp_wd->wdd);
157 dev_err(sp_wd->wdd.parent,
165 static int rave_sp_wdt_restart(struct watchdog_device *wdd,
179 static int rave_sp_wdt_start(struct watchdog_device *wdd)
183 ret = rave_sp_wdt_configure(wdd, true);
185 set_bit(WDOG_HW_RUNNING, &wdd->status);
190 static int rave_sp_wdt_stop(struct watchdog_device *wdd)
192 return rave_sp_wdt_configure(wdd, false);
195 static int rave_sp_wdt_set_timeout(struct watchdog_device *wdd,
198 wdd->timeout = timeout;
200 return rave_sp_wdt_configure(wdd, watchdog_active(wdd));
203 static int rave_sp_wdt_ping(struct watchdog_device *wdd)
210 return rave_sp_wdt_exec(wdd, cmd, sizeof(cmd));
256 struct watchdog_device *wdd;
269 wdd = &sp_wd->wdd;
270 wdd->parent = dev;
271 wdd->info = &rave_sp_wdt_info;
272 wdd->ops = &rave_sp_wdt_ops;
273 wdd->min_timeout = sp_wd->variant->min_timeout;
274 wdd->max_timeout = sp_wd->variant->max_timeout;
275 wdd->status = WATCHDOG_NOWAYOUT_INIT_STATUS;
276 wdd->timeout = 60;
289 watchdog_init_timeout(wdd, le16_to_cpu(timeout), dev);
290 watchdog_set_restart_priority(wdd, 255);
291 watchdog_stop_on_unregister(wdd);
304 wdd->max_hw_heartbeat_ms = wdd->max_timeout * 1000;
305 ret = rave_sp_wdt_start(wdd);
311 ret = devm_watchdog_register_device(dev, wdd);
313 rave_sp_wdt_stop(wdd);