11 #include <linux/module.h>
13 #include <linux/types.h>
14 #include <linux/kernel.h>
15 #include <linux/slab.h>
17 #include <linux/watchdog.h>
28 "Watchdog cannot be stopped once started (default="
44 } wm831x_wdt_cfgs[] = {
68 dev_err(wm831x->
dev,
"Failed to unlock security key: %d\n",
80 struct wm831x *wm831x = driver_data->
wm831x;
91 dev_err(wm831x->
dev,
"Failed to unlock security key: %d\n",
103 struct wm831x *wm831x = driver_data->
wm831x;
120 dev_err(wm831x->
dev,
"Hardware watchdog update unsupported\n");
132 dev_err(wm831x->
dev,
"Failed to unlock security key: %d\n",
143 unsigned int timeout)
146 struct wm831x *wm831x = driver_data->
wm831x;
149 for (i = 0; i <
ARRAY_SIZE(wm831x_wdt_cfgs); i++)
150 if (wm831x_wdt_cfgs[i].
time == timeout)
159 wm831x_wdt_cfgs[i].
val);
162 dev_err(wm831x->
dev,
"Failed to unlock security key: %d\n",
173 .identity =
"WM831x Watchdog",
178 .start = wm831x_wdt_start,
179 .stop = wm831x_wdt_stop,
180 .ping = wm831x_wdt_ping,
181 .set_timeout = wm831x_wdt_set_timeout,
195 dev_err(wm831x->
dev,
"Failed to read watchdog status: %d\n",
207 dev_err(wm831x->
dev,
"Unable to alloacate watchdog device\n");
213 driver_data->
wm831x = wm831x;
215 wm831x_wdt = &driver_data->
wdt;
217 wm831x_wdt->
info = &wm831x_wdt_info;
218 wm831x_wdt->
ops = &wm831x_wdt_ops;
219 watchdog_set_nowayout(wm831x_wdt, nowayout);
220 watchdog_set_drvdata(wm831x_wdt, driver_data);
224 for (i = 0; i <
ARRAY_SIZE(wm831x_wdt_cfgs); i++)
225 if (wm831x_wdt_cfgs[i].
val == reg)
229 "Unknown watchdog timeout: %x\n", reg);
231 wm831x_wdt->
timeout = wm831x_wdt_cfgs[
i].time;
234 if (pdev->
dev.parent->platform_data) {
235 chip_pdata = pdev->
dev.parent->platform_data;
255 "Failed to request update GPIO: %d\n",
272 "Failed to unlock security key: %d\n", ret);
279 dev_err(wm831x->
dev,
"watchdog_register_device() failed: %d\n",
308 .probe = wm831x_wdt_probe,
311 .name =
"wm831x-watchdog",