omap2: Convert ARCH_OMAP24XX to ARCH_OMAP2
[safe/jmp/linux-2.6] / drivers / watchdog / w83627hf_wdt.c
index 59507f6..f201acc 100644 (file)
@@ -11,8 +11,8 @@
  *
  *     (c) Copyright 2000-2001 Marek Michalkiewicz <marekm@linux.org.pl>
  *
- *     (c) Copyright 1996 Alan Cox <alan@redhat.com>, All Rights Reserved.
- *                             http://www.redhat.com
+ *     (c) Copyright 1996 Alan Cox <alan@lxorguk.ukuu.org.uk>,
+ *                                             All Rights Reserved.
  *
  *     This program is free software; you can redistribute it and/or
  *     modify it under the terms of the GNU General Public License
@@ -23,7 +23,7 @@
  *     warranty for any of this software. This material is provided
  *     "AS-IS" and at no charge.
  *
- *     (c) Copyright 1995    Alan Cox <alan@redhat.com>
+ *     (c) Copyright 1995    Alan Cox <alan@lxorguk.ukuu.org.uk>
  */
 
 #include <linux/module.h>
@@ -89,6 +89,11 @@ static void w83627hf_select_wd_register(void)
                c = ((inb_p(WDT_EFDR) & 0xf7) | 0x04); /* select WDT0 */
                outb_p(0x2b, WDT_EFER);
                outb_p(c, WDT_EFDR);    /* set GPIO3 to WDT0 */
+       } else if (c == 0x88) { /* W83627EHF */
+               outb_p(0x2d, WDT_EFER); /* select GPIO5 */
+               c = inb_p(WDT_EFDR) & ~0x01; /* PIN77 -> WDT0# */
+               outb_p(0x2d, WDT_EFER);
+               outb_p(c, WDT_EFDR); /* set GPIO5 to WDT0 */
        }
 
        outb_p(0x07, WDT_EFER); /* point to logical device number reg */
@@ -180,7 +185,7 @@ static ssize_t wdt_write(struct file *file, const char __user *buf,
 
                        for (i = 0; i != count; i++) {
                                char c;
-                               if (get_user(c, buf+i))
+                               if (get_user(c, buf + i))
                                        return -EFAULT;
                                if (c == 'V')
                                        expect_close = 42;
@@ -278,10 +283,9 @@ static int wdt_close(struct inode *inode, struct file *file)
 static int wdt_notify_sys(struct notifier_block *this, unsigned long code,
        void *unused)
 {
-       if (code == SYS_DOWN || code == SYS_HALT) {
-               /* Turn the WDT off */
-               wdt_disable();
-       }
+       if (code == SYS_DOWN || code == SYS_HALT)
+               wdt_disable();  /* Turn the WDT off */
+
        return NOTIFY_DONE;
 }