Lines Matching defs:wdev
67 struct watchdog_device wdev;
74 static int otto_wdt_start(struct watchdog_device *wdev)
76 struct otto_wdt_ctrl *ctrl = watchdog_get_drvdata(wdev);
86 static int otto_wdt_stop(struct watchdog_device *wdev)
88 struct otto_wdt_ctrl *ctrl = watchdog_get_drvdata(wdev);
98 static int otto_wdt_ping(struct watchdog_device *wdev)
100 struct otto_wdt_ctrl *ctrl = watchdog_get_drvdata(wdev);
123 static int otto_wdt_determine_timeouts(struct watchdog_device *wdev, unsigned int timeout,
126 struct otto_wdt_ctrl *ctrl = watchdog_get_drvdata(wdev);
161 ctrl->wdev.timeout = timeout_ms / 1000;
164 ctrl->wdev.pretimeout = pretimeout_ms / 1000;
169 static int otto_wdt_set_timeout(struct watchdog_device *wdev, unsigned int val)
171 return otto_wdt_determine_timeouts(wdev, val, min(wdev->pretimeout, val - 1));
174 static int otto_wdt_set_pretimeout(struct watchdog_device *wdev, unsigned int val)
176 return otto_wdt_determine_timeouts(wdev, wdev->timeout, val);
179 static int otto_wdt_restart(struct watchdog_device *wdev, unsigned long reboot_mode,
182 struct otto_wdt_ctrl *ctrl = watchdog_get_drvdata(wdev);
215 watchdog_notify_pretimeout(&ctrl->wdev);
327 ctrl->wdev.parent = dev;
328 ctrl->wdev.info = &otto_wdt_info;
329 ctrl->wdev.ops = &otto_wdt_ops;
335 ctrl->wdev.min_timeout = 2;
337 ctrl->wdev.max_hw_heartbeat_ms = max_tick_ms * OTTO_WDT_TIMEOUT_TICKS_MAX;
338 ctrl->wdev.timeout = min(30U, ctrl->wdev.max_hw_heartbeat_ms / 1000);
340 watchdog_set_drvdata(&ctrl->wdev, ctrl);
341 watchdog_init_timeout(&ctrl->wdev, 0, dev);
342 watchdog_stop_on_reboot(&ctrl->wdev);
343 watchdog_set_restart_priority(&ctrl->wdev, 128);
345 ret = otto_wdt_determine_timeouts(&ctrl->wdev, ctrl->wdev.timeout, 1);
349 return devm_watchdog_register_device(dev, &ctrl->wdev);