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

1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * Watchdog for the 7101 PMU version found in the ALi M1535 chipsets
12 #include <linux/watchdog.h>
36 "Watchdog timeout in seconds. (0 < timeout < 18000, default="
42 "Watchdog cannot be stopped once started (default="
46 * ali_start - start watchdog countdown
48 * Starts the timer running providing the timer has a counter
67 * ali_stop - stop the timer countdown
69 * Stop the ALi watchdog countdown
87 * ali_keepalive - send a keepalive to the watchdog
89 * Send a keepalive to the timer (actually we restart the timer).
98 * ali_settimer - compute the timer reload value
107 return -EINVAL; in ali_settimer()
115 return -EINVAL; in ali_settimer()
122 * /dev/watchdog handling
126 * ali_write - writes to ALi watchdog
132 * Handle a write to the ALi watchdog. Writing to the file pings
133 * the watchdog and resets it. Writing the magic 'V' sequence allows
134 * the next close to turn off the watchdog.
140 /* See if we got the magic character 'V' and reload the timer */ in ali_write()
154 return -EFAULT; in ali_write()
160 /* someone wrote to us, we should reload the timer */ in ali_write()
167 * ali_ioctl - handle watchdog ioctls
172 * Handle the watchdog ioctls supported by the ALi driver. Really
185 .identity = "ALi M1535 WatchDog Timer", in ali_ioctl()
190 return copy_to_user(argp, &ident, sizeof(ident)) ? -EFAULT : 0; in ali_ioctl()
197 int new_options, retval = -EINVAL; in ali_ioctl()
200 return -EFAULT; in ali_ioctl()
218 return -EFAULT; in ali_ioctl()
220 return -EINVAL; in ali_ioctl()
227 return -ENOTTY; in ali_ioctl()
232 * ali_open - handle open of ali watchdog
236 * Open the ALi watchdog device. Ensure only one person opens it
237 * at a time. Also start the watchdog running.
242 /* /dev/watchdog can only be opened once */ in ali_open()
244 return -EBUSY; in ali_open()
252 * ali_release - close an ALi watchdog
256 * Close the ALi watchdog device. Actual shutdown of the timer
263 * Shut off the timer. in ali_release()
268 pr_crit("Unexpected close, not stopping watchdog!\n"); in ali_release()
277 * ali_notify_sys - System down notifier
308 * ali_find_watchdog - find a 1535 and 7101
311 * watchdog device. This may be overtight but it is better to be safe
324 return -ENODEV; in ali_find_watchdog()
330 return -ENODEV; in ali_find_watchdog()
334 return -EIO; in ali_find_watchdog()
340 * Initialize the timer bits in ali_find_watchdog()
344 /* Timer bits */ in ali_find_watchdog()
371 .name = "watchdog",
380 * watchdog_init - module initialiser
382 * Scan for a suitable watchdog and if so initialize it. Return an error
390 /* Check whether or not the hardware watchdog is there */ in watchdog_init()
392 return -ENODEV; in watchdog_init()
402 /* Calculate the watchdog's timeout */ in watchdog_init()
429 * watchdog_exit - module de-initialiser
431 * Called while unloading a successfully installed watchdog module.
436 /* Stop the timer before we leave */ in watchdog_exit()
449 MODULE_DESCRIPTION("ALi M1535 PMU Watchdog Timer driver");