aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Tardieu <sam@rfc1149.net>2006-09-07 11:57:00 +0200
committerWim Van Sebroeck <wim@iguana.be>2006-10-04 22:46:00 +0200
commitfa69afd3c224252890cb30864dc648d1399dd9fe (patch)
tree7b9b3a780a5e8da3523b7caa33a11459506b2a02
parent089d8139f4c19c2f4d6984323e9d8a6e77cc92f7 (diff)
[WATCHDOG] w83697hf/hg WDT driver - patch 14
This is patch 14 in the series of patches that converts Marcus Junker's w83697hf watchdog driver to Samuel Tardieau's w83697hf/hg watchdog driver. This patch contains following changes: - Clean-up initialization code (part 1: remove w83697hf_select_wd_register() and w83697hf_unselect_wd_register() functions). - Make sure that the watchdog device is stopped as soon as we found it. Signed-off-by: Samuel Tardieu <sam@rfc1149.net> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
-rw-r--r--drivers/char/watchdog/w83697hf_wdt.c27
1 files changed, 6 insertions, 21 deletions
diff --git a/drivers/char/watchdog/w83697hf_wdt.c b/drivers/char/watchdog/w83697hf_wdt.c
index 2b3ce434c19..1ea43bf2c35 100644
--- a/drivers/char/watchdog/w83697hf_wdt.c
+++ b/drivers/char/watchdog/w83697hf_wdt.c
@@ -121,28 +121,13 @@ w83697hf_deselect_wdt(void)
}
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) {
@@ -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
@@ -412,6 +397,8 @@ 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);
@@ -419,8 +406,6 @@ found:
WATCHDOG_TIMEOUT);
}
- w83697hf_init();
-
ret = register_reboot_notifier(&wdt_notifier);
if (ret != 0) {
printk (KERN_ERR PFX "cannot register reboot notifier (err=%d)\n",