aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/watchdog/w83697hf_wdt.c
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:43:23 -0400
commitdb16525e63f8cf554696045e0e360b81e2263279 (patch)
treefd7f491e8d9f2de522f850f27ddb30be5801fd1b /drivers/char/watchdog/w83697hf_wdt.c
parentb41a9f59d13a4c4c3f0e0b8d9ff15743607096a2 (diff)
[WATCHDOG] w83697hf/hg WDT driver - patch 3
This is patch 3 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: - Fix identation. Signed-off-by: Samuel Tardieu <sam@rfc1149.net> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
Diffstat (limited to 'drivers/char/watchdog/w83697hf_wdt.c')
-rw-r--r--drivers/char/watchdog/w83697hf_wdt.c66
1 files changed, 33 insertions, 33 deletions
diff --git a/drivers/char/watchdog/w83697hf_wdt.c b/drivers/char/watchdog/w83697hf_wdt.c
index 4f81943fe7fa..12bdcab17b9e 100644
--- a/drivers/char/watchdog/w83697hf_wdt.c
+++ b/drivers/char/watchdog/w83697hf_wdt.c
@@ -6,7 +6,7 @@
6 * Based on w83627hf_wdt.c advantechwdt.c which is based on wdt.c. 6 * Based on w83627hf_wdt.c advantechwdt.c which is based on wdt.c.
7 * Original copyright messages: 7 * Original copyright messages:
8 * 8 *
9 * (c) Copyright 2003 Pádraig Brady <P@draigBrady.com> 9 * (c) Copyright 2003 Pádraig Brady <P@draigBrady.com>
10 * 10 *
11 * (c) Copyright 2000-2001 Marek Michalkiewicz <marekm@linux.org.pl> 11 * (c) Copyright 2000-2001 Marek Michalkiewicz <marekm@linux.org.pl>
12 * 12 *
@@ -96,16 +96,16 @@ w83697hf_init(void)
96 96
97 w83697hf_select_wd_register(); 97 w83697hf_select_wd_register();
98 98
99 outb_p(0xF3, WDT_EFER); /* Select CRF3 */ 99 outb_p(0xF3, WDT_EFER); /* Select CRF3 */
100 100
101 t=inb_p(WDT_EFDR); /* read CRF3 */ 101 t=inb_p(WDT_EFDR); /* read CRF3 */
102 if (t != 0) { 102 if (t != 0) {
103 printk (KERN_INFO PFX "Watchdog already running. Resetting timeout to %d sec\n", timeout); 103 printk (KERN_INFO PFX "Watchdog already running. Resetting timeout to %d sec\n", timeout);
104 outb_p(timeout, WDT_EFDR); /* Write back to CRF3 */ 104 outb_p(timeout, WDT_EFDR); /* Write back to CRF3 */
105 } 105 }
106 outb_p(0xF4, WDT_EFER); /* Select CRF4 */ 106 outb_p(0xF4, WDT_EFER); /* Select CRF4 */
107 t=inb_p(WDT_EFDR); /* read CRF4 */ 107 t=inb_p(WDT_EFDR); /* read CRF4 */
108 t&=~0x0C; /* set second mode & disable keyboard turning off watchdog */ 108 t&=~0x0C; /* set second mode & disable keyboard turning off watchdog */
109 outb_p(t, WDT_EFDR); /* Write back to CRF4 */ 109 outb_p(t, WDT_EFDR); /* Write back to CRF4 */
110 110
111 w83697hf_unselect_wd_register(); 111 w83697hf_unselect_wd_register();
@@ -187,51 +187,51 @@ wdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
187 187
188 switch (cmd) { 188 switch (cmd) {
189 case WDIOC_GETSUPPORT: 189 case WDIOC_GETSUPPORT:
190 if (copy_to_user(argp, &ident, sizeof(ident))) 190 if (copy_to_user(argp, &ident, sizeof(ident)))
191 return -EFAULT; 191 return -EFAULT;
192 break; 192 break;
193 193
194 case WDIOC_GETSTATUS: 194 case WDIOC_GETSTATUS:
195 case WDIOC_GETBOOTSTATUS: 195 case WDIOC_GETBOOTSTATUS:
196 return put_user(0, p); 196 return put_user(0, p);
197 197
198 case WDIOC_KEEPALIVE: 198 case WDIOC_KEEPALIVE:
199 wdt_ping(); 199 wdt_ping();
200 break; 200 break;
201 201
202 case WDIOC_SETTIMEOUT: 202 case WDIOC_SETTIMEOUT:
203 if (get_user(new_timeout, p)) 203 if (get_user(new_timeout, p))
204 return -EFAULT; 204 return -EFAULT;
205 if (wdt_set_heartbeat(new_timeout)) 205 if (wdt_set_heartbeat(new_timeout))
206 return -EINVAL; 206 return -EINVAL;
207 wdt_ping(); 207 wdt_ping();
208 /* Fall */ 208 /* Fall */
209 209
210 case WDIOC_GETTIMEOUT: 210 case WDIOC_GETTIMEOUT:
211 return put_user(timeout, p); 211 return put_user(timeout, p);
212 212
213 case WDIOC_SETOPTIONS: 213 case WDIOC_SETOPTIONS:
214 { 214 {
215 int options, retval = -EINVAL; 215 int options, retval = -EINVAL;
216 216
217 if (get_user(options, p)) 217 if (get_user(options, p))
218 return -EFAULT; 218 return -EFAULT;
219 219
220 if (options & WDIOS_DISABLECARD) { 220 if (options & WDIOS_DISABLECARD) {
221 wdt_disable(); 221 wdt_disable();
222 retval = 0; 222 retval = 0;
223 } 223 }
224 224
225 if (options & WDIOS_ENABLECARD) { 225 if (options & WDIOS_ENABLECARD) {
226 wdt_ping(); 226 wdt_ping();
227 retval = 0; 227 retval = 0;
228 } 228 }
229 229
230 return retval; 230 return retval;
231 } 231 }
232 232
233 default: 233 default:
234 return -ENOTTY; 234 return -ENOTTY;
235 } 235 }
236 return 0; 236 return 0;
237} 237}
@@ -255,7 +255,7 @@ wdt_close(struct inode *inode, struct file *file)
255 if (expect_close == 42) { 255 if (expect_close == 42) {
256 wdt_disable(); 256 wdt_disable();
257 } else { 257 } else {
258 printk(KERN_CRIT PFX "Unexpected close, not stopping watchdog!\n"); 258 printk (KERN_CRIT PFX "Unexpected close, not stopping watchdog!\n");
259 wdt_ping(); 259 wdt_ping();
260 } 260 }
261 expect_close = 0; 261 expect_close = 0;
@@ -313,7 +313,7 @@ wdt_init(void)
313 313
314 spin_lock_init(&io_lock); 314 spin_lock_init(&io_lock);
315 315
316 printk(KERN_INFO "WDT driver for the Winbond(TM) W83697HF Super I/O chip initialising.\n"); 316 printk (KERN_INFO "WDT driver for the Winbond(TM) W83697HF Super I/O chip initialising.\n");
317 317
318 if (wdt_set_heartbeat(timeout)) { 318 if (wdt_set_heartbeat(timeout)) {
319 wdt_set_heartbeat(WATCHDOG_TIMEOUT); 319 wdt_set_heartbeat(WATCHDOG_TIMEOUT);