aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char
diff options
context:
space:
mode:
authorSamuel Tardieu <sam@rfc1149.net>2006-09-07 05:57:00 -0400
committerWim Van Sebroeck <wim@iguana.be>2006-10-04 16:46:11 -0400
commitb7b9868ba6f528d60e5869b4a6aad1fe49838b03 (patch)
treea362f6c67867cdaed94868260b14d62e3359fe02 /drivers/char
parentfa69afd3c224252890cb30864dc648d1399dd9fe (diff)
[WATCHDOG] w83697hf/hg WDT driver - patch 15
This is patch 15 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 2: * the line reading "set second mode & disable keyboard ..." is plain wrong, the register being manipulated (CRF4) is the counter itself, not the control byte (CRF3) -- looks like it has been copied from another driver. * I think garbage is being written in CRF3 (the control word) as the timeout value is being stored in this register (such as 60 for 60 seconds). * We only want to set pin 119 to WDTO# mode and leave the rest of CR29 like it is. * Set count mode to seconds and not minutes. Signed-off-by: Samuel Tardieu <sam@rfc1149.net> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
Diffstat (limited to 'drivers/char')
-rw-r--r--drivers/char/watchdog/w83697hf_wdt.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/drivers/char/watchdog/w83697hf_wdt.c b/drivers/char/watchdog/w83697hf_wdt.c
index 1ea43bf2c35d..78b6540e8747 100644
--- a/drivers/char/watchdog/w83697hf_wdt.c
+++ b/drivers/char/watchdog/w83697hf_wdt.c
@@ -123,20 +123,18 @@ w83697hf_deselect_wdt(void)
123static void 123static void
124w83697hf_init(void) 124w83697hf_init(void)
125{ 125{
126 unsigned char t; 126 unsigned char bbuf;
127 127
128 w83697hf_select_wdt(); 128 w83697hf_select_wdt();
129 129
130 w83697hf_set_reg(0x29, 0x20); /* Set pin 119 to WDTO# mode (= CR29, WDT0) */ 130 bbuf = w83697hf_get_reg(0x29);
131 bbuf &= ~0x60;
132 bbuf |= 0x20;
133 w83697hf_set_reg(0x29, bbuf); /* Set pin 119 to WDTO# mode (= CR29, WDT0) */
131 134
132 t = w83697hf_get_reg(0xF3); /* Read CRF3 */ 135 bbuf = w83697hf_get_reg(0xF3);
133 if (t != 0) { 136 bbuf &= ~0x04;
134 printk (KERN_INFO PFX "Watchdog already running. Resetting timeout to %d sec\n", timeout); 137 w83697hf_set_reg(0xF3, bbuf); /* Count mode is seconds */
135 w83697hf_set_reg(0xF3, timeout); /* Write new timeout */
136 }
137 t = w83697hf_get_reg(0xF4); /* Read CRF4 */
138 t&=~0x0C; /* set second mode & disable keyboard turning off watchdog */
139 w83697hf_set_reg(0xF4, t); /* Write back to CRF4 */
140 138
141 w83697hf_deselect_wdt(); 139 w83697hf_deselect_wdt();
142} 140}