|
@@ -120,29 +120,14 @@ w83697hf_deselect_wdt(void)
|
|
w83697hf_lock();
|
|
w83697hf_lock();
|
|
}
|
|
}
|
|
|
|
|
|
-static void
|
|
|
|
-w83697hf_select_wd_register(void)
|
|
|
|
-{
|
|
|
|
- w83697hf_unlock();
|
|
|
|
-
|
|
|
|
- w83697hf_set_reg(0x29, 0x20); /* Set pin 119 to WDTO# mode (= CR29, WDT0) */
|
|
|
|
-
|
|
|
|
- w83697hf_set_reg(0x07, 0x08); /* Switch to logic device 8 (GPIO2) */
|
|
|
|
- w83697hf_set_reg(0x30, 0x01); /* Enable timer/activate GPIO2 via bit 0 */
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-static void
|
|
|
|
-w83697hf_unselect_wd_register(void)
|
|
|
|
-{
|
|
|
|
- w83697hf_lock();
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
static void
|
|
static void
|
|
w83697hf_init(void)
|
|
w83697hf_init(void)
|
|
{
|
|
{
|
|
unsigned char t;
|
|
unsigned char t;
|
|
|
|
|
|
- w83697hf_select_wd_register();
|
|
|
|
|
|
+ w83697hf_select_wdt();
|
|
|
|
+
|
|
|
|
+ w83697hf_set_reg(0x29, 0x20); /* Set pin 119 to WDTO# mode (= CR29, WDT0) */
|
|
|
|
|
|
t = w83697hf_get_reg(0xF3); /* Read CRF3 */
|
|
t = w83697hf_get_reg(0xF3); /* Read CRF3 */
|
|
if (t != 0) {
|
|
if (t != 0) {
|
|
@@ -153,7 +138,7 @@ w83697hf_init(void)
|
|
t&=~0x0C; /* set second mode & disable keyboard turning off watchdog */
|
|
t&=~0x0C; /* set second mode & disable keyboard turning off watchdog */
|
|
w83697hf_set_reg(0xF4, t); /* Write back to CRF4 */
|
|
w83697hf_set_reg(0xF4, t); /* Write back to CRF4 */
|
|
|
|
|
|
- w83697hf_unselect_wd_register();
|
|
|
|
|
|
+ w83697hf_deselect_wdt();
|
|
}
|
|
}
|
|
|
|
|
|
static int
|
|
static int
|
|
@@ -412,6 +397,8 @@ wdt_init(void)
|
|
goto out;
|
|
goto out;
|
|
|
|
|
|
found:
|
|
found:
|
|
|
|
+ w83697hf_init();
|
|
|
|
+ wdt_disable(); /* Disable watchdog until first use */
|
|
|
|
|
|
if (wdt_set_heartbeat(timeout)) {
|
|
if (wdt_set_heartbeat(timeout)) {
|
|
wdt_set_heartbeat(WATCHDOG_TIMEOUT);
|
|
wdt_set_heartbeat(WATCHDOG_TIMEOUT);
|
|
@@ -419,8 +406,6 @@ found:
|
|
WATCHDOG_TIMEOUT);
|
|
WATCHDOG_TIMEOUT);
|
|
}
|
|
}
|
|
|
|
|
|
- w83697hf_init();
|
|
|
|
-
|
|
|
|
ret = register_reboot_notifier(&wdt_notifier);
|
|
ret = register_reboot_notifier(&wdt_notifier);
|
|
if (ret != 0) {
|
|
if (ret != 0) {
|
|
printk (KERN_ERR PFX "cannot register reboot notifier (err=%d)\n",
|
|
printk (KERN_ERR PFX "cannot register reboot notifier (err=%d)\n",
|