Lines Matching +full:timeout +full:- +full:enable
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
33 * reset the system (causing a reboot) after the timeout occurs.
38 * For an example userspace keep-alive daemon, see:
60 /* enable support for minutes as units? */
77 static int timeout = 60; /* timeout value: default is 60 "units" */ variable
86 /* -- Low level function ----------------------------------------*/
124 /* -- Medium level functions ------------------------------------*/
128 /* -- General Purpose I/O Bit 1.2 -- in gpio_bit12()
131 * Bit 2, Group Enable Intr.: 0 = Disable, 1 = Enable in gpio_bit12()
142 /* -- General Purpose I/O Bit 1.3 -- in gpio_bit13()
145 * Bit 2, Group Enable Intr.: 0 = Disable, 1 = Enable 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()
181 * Bit 4-7 WDT Interrupt Mapping: (0000* = Disabled, in wdt_timer_conf()
189 /* -- Watchdog timer control -- in wdt_timer_ctrl()
190 * Bit 0 Status Bit: 0 = Timer counting, 1 = Timeout occurred in wdt_timer_ctrl()
192 * Bit 2 Force Timeout: 1 = Forces WD timeout event (self-cleaning) in wdt_timer_ctrl()
193 * Bit 3 P20 Force Timeout enabled: in wdt_timer_ctrl()
194 * 0 = P20 activity does not generate the WD timeout event in wdt_timer_ctrl()
196 * controller, to force the WD timeout event. 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 ------------------------------------*/
221 /* enable the watchdog */ in wb_smsc_wdt_initialize()
225 /* disable the timeout */ in wb_smsc_wdt_initialize()
264 /* disable timeout */ in wb_smsc_wdt_shutdown()
271 /* set timeout => enable watchdog */
279 /* set Power LED to blink, if we enable the timeout */ in wb_smsc_wdt_set_timeout()
282 /* set timeout value */ in wb_smsc_wdt_set_timeout()
289 /* get timeout */
309 /* set the timeout to 0 to disable the watchdog */ in wb_smsc_wdt_disable()
313 /* enable watchdog by setting the current timeout */
317 /* set the current timeout... */ in wb_smsc_wdt_enable()
318 wb_smsc_wdt_set_timeout(timeout); in wb_smsc_wdt_enable()
330 wdt_timeout_value(timeout); in wb_smsc_wdt_reset_timer()
337 /* return, if the watchdog is enabled (timeout is set...) */
345 /* -- File operations -------------------------------------------*/
347 /* open => enable watchdog and set initial timeout */
354 return -EBUSY; in wb_smsc_wdt_open()
362 pr_info("Watchdog enabled. Timeout set to %d %s\n", in wb_smsc_wdt_open()
363 timeout, (unit == UNIT_SECOND) ? "second(s)" : "minute(s)"); in wb_smsc_wdt_open()
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()
475 timeout = new_timeout; in wb_smsc_wdt_ioctl()
476 wb_smsc_wdt_set_timeout(timeout); in wb_smsc_wdt_ioctl()
477 fallthrough; /* and return the new timeout */ in wb_smsc_wdt_ioctl()
479 new_timeout = timeout; 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()
495 timeout = 0; in wb_smsc_wdt_notify_sys()
501 /* -- Module's structures ---------------------------------------*/
522 /* -- Module init functions -------------------------------------*/
535 ret = -EBUSY; in wb_smsc_wdt_init()
540 if (timeout > MAX_TIMEOUT) in wb_smsc_wdt_init()
541 timeout = MAX_TIMEOUT; in wb_smsc_wdt_init()
560 pr_info("Timeout set to %d %s\n", in wb_smsc_wdt_init()
561 timeout, (unit == UNIT_SECOND) ? "second(s)" : "minute(s)"); in wb_smsc_wdt_init()
608 module_param(timeout, int, 0);
609 MODULE_PARM_DESC(timeout, "range is 1-255 units, default is 60");