Lines Matching +full:timer +full:- +full:watchdog

1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * 60xx Single Board Computer Watchdog Timer driver for Linux 2.2.x
8 * any of this software. This material is provided "AS-IS" in
13 * 12/4 - 2000 [Initial revision]
14 * 25/4 - 2000 Added /dev/watchdog support
15 * 09/5 - 2001 [smj@oro.net] fixed fop_write to "return 1"
17 * 12/4 - 2002 [rob@osinvestor.com] eliminate fop_read
28 * 09/8 - 2003 [wim@iguana.be] cleanup of trailing spaces
39 * *) The driver will ping the watchdog by itself, because this
50 #include <linux/timer.h>
53 #include <linux/watchdog.h>
67 * You must set these - The driver cannot probe for the settings
79 * The 60xx board can use watchdog timeout values from one second
81 * the watchdog every ~250ms we should be safe.
89 * char to /dev/watchdog every 30 seconds.
100 "Watchdog timeout in seconds. (1<=timeout<=3600, default="
106 "Watchdog cannot be stopped once started (default="
110 static DEFINE_TIMER(timer, wdt_timer_ping);
127 /* Re-set the timer interval */ in wdt_timer_ping()
128 mod_timer(&timer, jiffies + WDT_INTERVAL); in wdt_timer_ping()
130 pr_warn("Heartbeat lost! Will not ping the watchdog\n"); in wdt_timer_ping()
141 /* Start the timer */ in wdt_startup()
142 mod_timer(&timer, jiffies + WDT_INTERVAL); in wdt_startup()
143 pr_info("Watchdog timer is now enabled\n"); in wdt_startup()
148 /* Stop the timer */ in wdt_turnoff()
149 del_timer_sync(&timer); in wdt_turnoff()
151 pr_info("Watchdog timer is now disabled...\n"); in wdt_turnoff()
161 * /dev/watchdog handling
167 /* See if we got the magic character 'V' and reload the timer */ in fop_write()
181 return -EFAULT; in fop_write()
198 return -EBUSY; in fop_open()
213 del_timer(&timer); in fop_close()
234 return copy_to_user(argp, &ident, sizeof(ident)) ? -EFAULT : 0; in fop_ioctl()
240 int new_options, retval = -EINVAL; in fop_ioctl()
242 return -EFAULT; in fop_ioctl()
260 return -EFAULT; in fop_ioctl()
263 return -EINVAL; in fop_ioctl()
272 return -ENOTTY; in fop_ioctl()
287 .name = "watchdog",
327 int rc = -EBUSY; in sbc60xxwdt_init()
337 rc = -EIO; in sbc60xxwdt_init()
341 /* We cannot reserve 0x45 - the kernel already has! */ in sbc60xxwdt_init()
345 rc = -EIO; in sbc60xxwdt_init()
382 MODULE_DESCRIPTION("60xx Single Board Computer Watchdog Timer driver");