Lines Matching +full:watchdog +full:- +full:enable

1 // SPDX-License-Identifier: GPL-2.0+
3 * NS pc87413-wdt Watchdog Timer driver for Linux 2.6.x.x
12 * This material is provided "AS-IS" and at no charge.
22 #include <linux/watchdog.h>
42 #define DPFX MODNAME " - DEBUG: "
48 #define WDCTL 0x10 /* Watchdog-Timer-Control-Register */
49 #define WDTO 0x11 /* Watchdog timeout register */
50 #define WDCFG 0x12 /* Watchdog config register */
55 static int swc_base_addr = -1;
66 /* -- Low level function ----------------------------------------*/
68 /* Select pins for Watchdog output */
92 /* Enable SWC functions */
98 /* Step 2: Enable SWC functions */ in pc87413_enable_swc()
110 pr_info(DPFX "pc87413 - Enable SWC functions\n"); in pc87413_enable_swc()
148 /* Set watchdog timeout to x minutes */
159 /* Enable WDEN */
163 /* Step 6: Enable WDEN */ in pc87413_enable_wden()
166 pr_info(DPFX "Enable WDEN\n"); in pc87413_enable_wden()
170 /* Enable SW_WD_TREN */
173 /* Enable SW_WD_TREN */ in pc87413_enable_sw_wd_tren()
176 pr_info(DPFX "Enable SW_WD_TREN\n"); in pc87413_enable_sw_wd_tren()
187 pr_info(DPFX "pc87413 - Disable SW_WD_TREN\n"); in pc87413_disable_sw_wd_tren()
191 /* Enable SW_WD_TRG */
195 /* Enable SW_WD_TRG */ in pc87413_enable_sw_wd_trg()
198 pr_info(DPFX "pc87413 - Enable SW_WD_TRG\n"); in pc87413_enable_sw_wd_trg()
213 /* -- Higher level functions ------------------------------------*/
215 /* Enable the watchdog */
230 /* Disable the watchdog */
244 /* Refresh the watchdog */
261 /* -- File operations -------------------------------------------*/
272 /* /dev/watchdog can only be opened once */ in pc87413_open()
275 return -EBUSY; in pc87413_open()
283 pr_info("Watchdog enabled. Timeout set to %d minute(s).\n", timeout); in pc87413_open()
293 * The watchdog has a configurable API. There is a religious dispute
294 * between people who want their watchdog to be able to shut down and
295 * those who want to be sure if the watchdog manager dies the machine
306 pr_info("Watchdog disabled, sleeping again...\n"); in pc87413_release()
308 pr_crit("Unexpected close, not stopping watchdog!\n"); in pc87413_release()
319 * return, if the watchdog is enabled (timeout is set...)
330 * @file: file handle to the watchdog
335 * A write to a watchdog device is defined as a keepalive signal. Any
355 return -EFAULT; in pc87413_write()
370 * @cmd: watchdog command
373 * The watchdog API defines a common set of functions for all watchdogs
393 .identity = "PC87413(HF/F) watchdog", in pc87413_ioctl()
401 sizeof(ident)) ? -EFAULT : 0; in pc87413_ioctl()
408 int options, retval = -EINVAL; in pc87413_ioctl()
410 return -EFAULT; in pc87413_ioctl()
429 return -EFAULT; in pc87413_ioctl()
433 return -EINVAL; in pc87413_ioctl()
441 return -ENOTTY; in pc87413_ioctl()
445 /* -- Notifier functions -----------------------------------------*/
456 * trust me - if it happens it does suck.
469 /* -- Module's structures ---------------------------------------*/
486 .name = "watchdog",
490 /* -- Module init functions -------------------------------------*/
495 * Set up the WDT watchdog board. All we have to do is grab the
508 return -EBUSY; in pc87413_init()
528 ret = -EBUSY; in pc87413_init()
548 * Unload the watchdog. You cannot do this with any file handles open.
549 * If your watchdog is set to continue ticking on close and you unload
560 pr_info("Watchdog disabled\n"); in pc87413_exit()
567 pr_info("watchdog component driver removed\n"); in pc87413_exit()
584 "Watchdog timeout in minutes (default="
589 "Watchdog cannot be stopped once started (default="