Lines Matching refs:wdd
57 struct watchdog_device wdd;
62 static struct apple_wdt *to_apple_wdt(struct watchdog_device *wdd)
64 return container_of(wdd, struct apple_wdt, wdd);
67 static int apple_wdt_start(struct watchdog_device *wdd)
69 struct apple_wdt *wdt = to_apple_wdt(wdd);
77 static int apple_wdt_stop(struct watchdog_device *wdd)
79 struct apple_wdt *wdt = to_apple_wdt(wdd);
86 static int apple_wdt_ping(struct watchdog_device *wdd)
88 struct apple_wdt *wdt = to_apple_wdt(wdd);
95 static int apple_wdt_set_timeout(struct watchdog_device *wdd, unsigned int s)
97 struct apple_wdt *wdt = to_apple_wdt(wdd);
102 wdd->timeout = s;
107 static unsigned int apple_wdt_get_timeleft(struct watchdog_device *wdd)
109 struct apple_wdt *wdt = to_apple_wdt(wdd);
118 static int apple_wdt_restart(struct watchdog_device *wdd, unsigned long mode,
121 struct apple_wdt *wdt = to_apple_wdt(wdd);
176 wdt->wdd.ops = &apple_wdt_ops;
177 wdt->wdd.info = &apple_wdt_info;
178 wdt->wdd.max_timeout = U32_MAX / wdt->clk_rate;
179 wdt->wdd.timeout = APPLE_WDT_TIMEOUT_DEFAULT;
183 set_bit(WDOG_HW_RUNNING, &wdt->wdd.status);
185 watchdog_init_timeout(&wdt->wdd, 0, dev);
186 apple_wdt_set_timeout(&wdt->wdd, wdt->wdd.timeout);
187 watchdog_stop_on_unregister(&wdt->wdd);
188 watchdog_set_restart_priority(&wdt->wdd, 128);
190 return devm_watchdog_register_device(dev, &wdt->wdd);