Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 40240
b: refs/heads/master
c: fa69afd
h: refs/heads/master
v: v3
  • Loading branch information
Samuel Tardieu authored and Wim Van Sebroeck committed Oct 4, 2006
1 parent 3fa5a29 commit e9d4e98
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 22 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 089d8139f4c19c2f4d6984323e9d8a6e77cc92f7
refs/heads/master: fa69afd3c224252890cb30864dc648d1399dd9fe
27 changes: 6 additions & 21 deletions trunk/drivers/char/watchdog/w83697hf_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,29 +120,14 @@ w83697hf_deselect_wdt(void)
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
w83697hf_init(void)
{
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 */
if (t != 0) {
Expand All @@ -153,7 +138,7 @@ w83697hf_init(void)
t&=~0x0C; /* set second mode & disable keyboard turning off watchdog */
w83697hf_set_reg(0xF4, t); /* Write back to CRF4 */

w83697hf_unselect_wd_register();
w83697hf_deselect_wdt();
}

static int
Expand Down Expand Up @@ -412,15 +397,15 @@ wdt_init(void)
goto out;

found:
w83697hf_init();
wdt_disable(); /* Disable watchdog until first use */

if (wdt_set_heartbeat(timeout)) {
wdt_set_heartbeat(WATCHDOG_TIMEOUT);
printk (KERN_INFO PFX "timeout value must be 1<=timeout<=255, using %d\n",
WATCHDOG_TIMEOUT);
}

w83697hf_init();

ret = register_reboot_notifier(&wdt_notifier);
if (ret != 0) {
printk (KERN_ERR PFX "cannot register reboot notifier (err=%d)\n",
Expand Down

0 comments on commit e9d4e98

Please sign in to comment.