Lines Matching +full:reset +full:- +full:n +full:- +full:io

1 // SPDX-License-Identifier: GPL-2.0-or-later
9 * any of this software. This material is provided "AS-IS" in
12 * (C) Copyright 2003-2006 Sven Anders <anders@anduras.de>
15 * 2003 - Created version 1.0 for Linux 2.4.x.
16 * 2006 - Ported to Linux 2.6, added nowayout and MAGICCLOSE
22 * reset the computer system in case of a software fault.
30 * for yet another little while to reset the system.
33 * reset the system (causing a reboot) after the timeout occurs.
38 * For an example userspace keep-alive daemon, see:
56 #include <linux/io.h>
82 static DEFINE_SPINLOCK(io_lock);/* to guard the watchdog from io races */
86 /* -- Low level function ----------------------------------------*/
88 /* unlock the IO chip */
97 /* lock the IO chip */
103 /* select the IO device */
124 /* -- Medium level functions ------------------------------------*/
128 /* -- General Purpose I/O Bit 1.2 -- in gpio_bit12()
142 /* -- General Purpose I/O Bit 1.3 -- in gpio_bit13()
147 * Bit 4-6 (Reserved) in gpio_bit13()
155 /* -- Watchdog timer units -- in wdt_timer_units()
156 * Bit 0-6 (Reserved) in wdt_timer_units()
157 * Bit 7, WDT Time-out Value Units Select in wdt_timer_units()
165 /* -- Watchdog Timer Time-out Value -- in wdt_timeout_value()
166 * Bit 0-7 Binary coded units (0=Disabled, 1..255) in wdt_timeout_value()
173 /* -- Watchdog timer configuration -- in wdt_timer_conf()
174 * Bit 0 Joystick enable: 0* = No Reset, 1 = Reset WDT upon in wdt_timer_conf()
176 * Bit 1 Keyboard enable: 0* = No Reset, 1 = Reset WDT upon KBD Intr. in wdt_timer_conf()
177 * Bit 2 Mouse enable: 0* = No Reset, 1 = Reset WDT upon Mouse Intr in wdt_timer_conf()
178 * Bit 3 Reset the timer in wdt_timer_conf()
181 * Bit 4-7 WDT Interrupt Mapping: (0000* = Disabled, in wdt_timer_conf()
189 /* -- Watchdog timer control -- in wdt_timer_ctrl()
192 * Bit 2 Force Timeout: 1 = Forces WD timeout event (self-cleaning) in wdt_timer_ctrl()
198 * -- Soft power management -- in wdt_timer_ctrl()
200 * set via register 0xB8, (self-cleaning) in wdt_timer_ctrl()
203 * set via register 0xB8, (self-cleaning) in wdt_timer_ctrl()
204 * Bit 7 SPOFF: 1 = Force software power down (self-cleaning) in wdt_timer_ctrl()
209 /* -- Higher level functions ------------------------------------*/
228 /* reset control register */ in wb_smsc_wdt_initialize()
231 /* reset configuration register */ in wb_smsc_wdt_initialize()
258 /* reset watchdog config register */ in wb_smsc_wdt_shutdown()
261 /* reset watchdog control register */ in wb_smsc_wdt_shutdown()
321 /* reset the timer */
329 /* reset the timer */ in wb_smsc_wdt_reset_timer()
345 /* -- File operations -------------------------------------------*/
354 return -EBUSY; in wb_smsc_wdt_open()
362 pr_info("Watchdog enabled. Timeout set to %d %s\n", in wb_smsc_wdt_open()
376 pr_info("Watchdog disabled, sleeping again...\n"); in wb_smsc_wdt_release()
378 pr_crit("Unexpected close, not stopping watchdog!\n"); in wb_smsc_wdt_release()
397 /* reset expect flag */ in wb_smsc_wdt_write()
405 return -EFAULT; in wb_smsc_wdt_write()
442 ? -EFAULT : 0; in wb_smsc_wdt_ioctl()
449 int options, retval = -EINVAL; in wb_smsc_wdt_ioctl()
452 return -EFAULT; in wb_smsc_wdt_ioctl()
469 return -EFAULT; in wb_smsc_wdt_ioctl()
474 return -EINVAL; in wb_smsc_wdt_ioctl()
484 return -ENOTTY; in wb_smsc_wdt_ioctl()
488 /* -- Notifier funtions -----------------------------------------*/
494 /* set timeout to 0, to avoid possible race-condition */ in wb_smsc_wdt_notify_sys()
501 /* -- Module's structures ---------------------------------------*/
523 /* -- Module init functions -------------------------------------*/
532 VERSION " initialising...\n"); in wb_smsc_wdt_init()
535 pr_err("Unable to register IO port %#x\n", IOPORT); in wb_smsc_wdt_init()
536 ret = -EBUSY; in wb_smsc_wdt_init()
549 pr_err("Unable to register reboot notifier err = %d\n", ret); in wb_smsc_wdt_init()
555 pr_err("Unable to register miscdev on minor %d\n", in wb_smsc_wdt_init()
561 pr_info("Timeout set to %d %s\n", in wb_smsc_wdt_init()
563 pr_info("Watchdog initialized and sleeping (nowayout=%d)...\n", in wb_smsc_wdt_init()
585 pr_info("Watchdog disabled\n"); in wb_smsc_wdt_exit()
592 pr_info("SMsC 37B787 watchdog component driver removed\n"); in wb_smsc_wdt_exit()
610 MODULE_PARM_DESC(timeout, "range is 1-255 units, default is 60");