Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 40239
b: refs/heads/master
c: 089d813
h: refs/heads/master
i:
  40237: fc6cff1
  40235: f016dce
  40231: d940ae4
  40223: 4fbd5fd
v: v3
  • Loading branch information
Samuel Tardieu authored and Wim Van Sebroeck committed Oct 4, 2006
1 parent ca024b8 commit 3fa5a29
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 10 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: d46ab596e251e35a7e27c95e4e4d01921f3e579e
refs/heads/master: 089d8139f4c19c2f4d6984323e9d8a6e77cc92f7
31 changes: 22 additions & 9 deletions trunk/drivers/char/watchdog/w83697hf_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -156,31 +156,44 @@ w83697hf_init(void)
w83697hf_unselect_wd_register();
}

static void
wdt_ctrl(int timeout)
static int
wdt_ping(void)
{
spin_lock(&io_lock);

w83697hf_select_wdt();

w83697hf_write_timeout(timeout);

w83697hf_deselect_wdt();

spin_unlock(&io_lock);
return 0;
}

static int
wdt_ping(void)
wdt_enable(void)
{
wdt_ctrl(timeout);
spin_lock(&io_lock);
w83697hf_select_wdt();

w83697hf_write_timeout(timeout);
w83697hf_set_reg(0x30, 1); /* Enable timer */

w83697hf_deselect_wdt();
spin_unlock(&io_lock);
return 0;
}

static int
wdt_disable(void)
{
wdt_ctrl(0);
spin_lock(&io_lock);
w83697hf_select_wdt();

w83697hf_set_reg(0x30, 0); /* Disable timer */
w83697hf_write_timeout(0);

w83697hf_deselect_wdt();
spin_unlock(&io_lock);
return 0;
}

Expand Down Expand Up @@ -267,7 +280,7 @@ wdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
}

if (options & WDIOS_ENABLECARD) {
wdt_ping();
wdt_enable();
retval = 0;
}

Expand All @@ -289,7 +302,7 @@ wdt_open(struct inode *inode, struct file *file)
* Activate
*/

wdt_ping();
wdt_enable();
return nonseekable_open(inode, file);
}

Expand Down

0 comments on commit 3fa5a29

Please sign in to comment.