Skip to content

Commit

Permalink
watchdog: w83627hf_wdt: Add early_disable module parameter
Browse files Browse the repository at this point in the history
Add early_disable module parameter to match functionality previously
available in the w83697hf_wdt driver.

Signed-off-by: Guenter Roeck <[email protected]>
Signed-off-by: Wim Van Sebroeck <[email protected]>
  • Loading branch information
groeck authored and Wim Van Sebroeck committed Jun 10, 2014
1 parent ebc5e33 commit be28158
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions drivers/watchdog/w83627hf_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ MODULE_PARM_DESC(nowayout,
"Watchdog cannot be stopped once started (default="
__MODULE_STRING(WATCHDOG_NOWAYOUT) ")");

static int early_disable;
module_param(early_disable, int, 0);
MODULE_PARM_DESC(early_disable, "Disable watchdog at boot time (default=0)");

/*
* Kernel methods.
*/
Expand Down Expand Up @@ -208,9 +212,14 @@ static int w83627hf_init(struct watchdog_device *wdog, enum chips chip)

t = superio_inb(cr_wdt_timeout);
if (t != 0) {
pr_info("Watchdog already running. Resetting timeout to %d sec\n",
wdog->timeout);
superio_outb(cr_wdt_timeout, wdog->timeout);
if (early_disable) {
pr_warn("Stopping previously enabled watchdog until userland kicks in\n");
superio_outb(cr_wdt_timeout, 0);
} else {
pr_info("Watchdog already running. Resetting timeout to %d sec\n",
wdog->timeout);
superio_outb(cr_wdt_timeout, wdog->timeout);
}
}

/* set second mode & disable keyboard turning off watchdog */
Expand Down

0 comments on commit be28158

Please sign in to comment.