Fedora kernel-2.6.17-1.2142_FC4 patched with stable patch-2.6.17.4-vs2.0.2-rc26.diff
[linux-2.6.git] / drivers / char / watchdog / w83627hf_wdt.c
index 813c970..d15ca9a 100644 (file)
@@ -54,12 +54,7 @@ static int timeout = WATCHDOG_TIMEOUT;       /* in seconds */
 module_param(timeout, int, 0);
 MODULE_PARM_DESC(timeout, "Watchdog timeout in seconds. 1<= timeout <=63, default=" __MODULE_STRING(WATCHDOG_TIMEOUT) ".");
 
-#ifdef CONFIG_WATCHDOG_NOWAYOUT
-static int nowayout = 1;
-#else
-static int nowayout = 0;
-#endif
-
+static int nowayout = WATCHDOG_NOWAYOUT;
 module_param(nowayout, int, 0);
 MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)");
 
@@ -98,6 +93,12 @@ w83627hf_init(void)
 
        w83627hf_select_wd_register();
 
+       outb_p(0xF6, WDT_EFER); /* Select CRF6 */
+       t=inb_p(WDT_EFDR);      /* read CRF6 */
+       if (t != 0) {
+               printk (KERN_INFO PFX "Watchdog already running. Resetting timeout to %d sec\n", timeout);
+               outb_p(timeout, WDT_EFDR);    /* Write back to CRF6 */
+       }
        outb_p(0xF5, WDT_EFER); /* Select CRF5 */
        t=inb_p(WDT_EFDR);      /* read CRF5 */
        t&=~0x0C;               /* set second mode & disable keyboard turning off watchdog */
@@ -358,5 +359,5 @@ module_exit(wdt_exit);
 
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR("Pádraig Brady <P@draigBrady.com>");
-MODULE_DESCRIPTION("w38627hf WDT driver");
+MODULE_DESCRIPTION("w83627hf WDT driver");
 MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);