Lines Matching +full:watchdog +full:- +full:timer
1 // SPDX-License-Identifier: GPL-2.0-only
3 * ALi M7101 PMU Computer Watchdog Timer driver
6 * and the Cobalt kernel WDT timer driver by Tim Hockin
12 * drivers in that the driver will ping the watchdog by itself,
18 * Aug 23, 2004 - Added use_gpio module parameter for use on revision a1d PMUs
20 * -- Mike Waychison <michael.waychison@sun.com>
28 #include <linux/timer.h>
30 #include <linux/watchdog.h>
51 * If we reset the watchdog every ~250ms we should be safe. */
58 * char to /dev/watchdog every 30 seconds.
66 "Watchdog timeout in seconds. (1<=timeout<=3600, default="
72 "Use the gpio watchdog (required by old cobalt boards).");
75 static DEFINE_TIMER(timer, wdt_timer_ping);
84 "Watchdog cannot be stopped once started (default="
114 pr_warn("Heartbeat lost! Will not ping the watchdog\n"); in wdt_timer_ping()
116 /* Re-set the timer interval */ in wdt_timer_ping()
117 mod_timer(&timer, jiffies + WDT_INTERVAL); in wdt_timer_ping()
155 /* We must enable before we kick off the timer in case the timer in wdt_startup()
160 /* Start the timer */ in wdt_startup()
161 mod_timer(&timer, jiffies + WDT_INTERVAL); in wdt_startup()
163 pr_info("Watchdog timer is now enabled\n"); in wdt_startup()
168 /* Stop the timer */ in wdt_turnoff()
169 del_timer_sync(&timer); in wdt_turnoff()
171 pr_info("Watchdog timer is now disabled...\n"); in wdt_turnoff()
181 * /dev/watchdog handling
187 /* See if we got the magic character 'V' and reload the timer */ in fop_write()
200 return -EFAULT; in fop_write()
205 /* someone wrote to us, we should restart timer */ in fop_write()
215 return -EBUSY; in fop_open()
226 /* wim: shouldn't there be a: del_timer(&timer); */ in fop_close()
247 return copy_to_user(argp, &ident, sizeof(ident)) ? -EFAULT : 0; in fop_ioctl()
253 int new_options, retval = -EINVAL; in fop_ioctl()
256 return -EFAULT; in fop_ioctl()
275 return -EFAULT; in fop_ioctl()
278 return -EINVAL; in fop_ioctl()
286 return -ENOTTY; in fop_ioctl()
302 .name = "watchdog",
311 * than getting the watchdog to pull reset, so we restart the in wdt_restart_handle()
312 * watchdog on reboot with no heartbeat. in wdt_restart_handle()
316 /* loop until the watchdog fires */ in wdt_restart_handle()
362 int rc = -EBUSY; in alim7101_wdt_init()
370 pr_info("ALi M7101 PMU not present - WDT not set\n"); in alim7101_wdt_init()
371 return -EBUSY; in alim7101_wdt_init()
380 pr_info("ALi 1543 South-Bridge not present - WDT not set\n"); in alim7101_wdt_init()
392 …pr_info("ALi 1543 South-Bridge does not have the correct revision number (???1001?) - WDT not set\… in alim7101_wdt_init()
450 MODULE_DESCRIPTION("ALi M7101 PMU Computer Watchdog Timer driver");