aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/watchdog
diff options
context:
space:
mode:
authorOndrej Zajicek <santiago@crfreenet.org>2010-09-13 20:47:28 -0400
committerWim Van Sebroeck <wim@iguana.be>2010-10-28 17:37:59 -0400
commitee3e96583e42dcb4bd406ce4e5f824bd5bb80013 (patch)
treecb9354622e01d57bd288603e01fa747717ddd61f /drivers/watchdog
parenta2b89cd85ed55029400521a93dde868ac7150b31 (diff)
watchdog: it87_wdt: Add support for IT8720F watchdog
This simple patch adds support for a watchdog in IT8720F Super IO chip to it87_wdt driver. Signed-off-by: Ondrej Zajicek <santiago@crfreenet.org> Signed-off-by: Wim Van Sebroeck <wim@iguana.be> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'drivers/watchdog')
-rw-r--r--drivers/watchdog/Kconfig9
-rw-r--r--drivers/watchdog/it87_wdt.c17
2 files changed, 16 insertions, 10 deletions
diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
index c356146bd712..cc53136122f9 100644
--- a/drivers/watchdog/Kconfig
+++ b/drivers/watchdog/Kconfig
@@ -565,10 +565,11 @@ config IT87_WDT
565 tristate "IT87 Watchdog Timer" 565 tristate "IT87 Watchdog Timer"
566 depends on X86 && EXPERIMENTAL 566 depends on X86 && EXPERIMENTAL
567 ---help--- 567 ---help---
568 This is the driver for the hardware watchdog on the ITE IT8716, 568 This is the driver for the hardware watchdog on the ITE
569 IT8718, IT8726, IT8712(Version J,K) Super I/O chips. This watchdog 569 IT8716, IT8718, IT8720, IT8726, IT8712(Version J,K) Super I/O
570 simply watches your kernel to make sure it doesn't freeze, and if 570 chips. This watchdog simply watches your kernel to make sure
571 it does, it reboots your computer after a certain amount of time. 571 it doesn't freeze, and if it does, it reboots your computer
572 after a certain amount of time.
572 573
573 To compile this driver as a module, choose M here: the module will 574 To compile this driver as a module, choose M here: the module will
574 be called it87_wdt. 575 be called it87_wdt.
diff --git a/drivers/watchdog/it87_wdt.c b/drivers/watchdog/it87_wdt.c
index b709b3b2d1ef..455de7714618 100644
--- a/drivers/watchdog/it87_wdt.c
+++ b/drivers/watchdog/it87_wdt.c
@@ -12,7 +12,7 @@
12 * http://www.ite.com.tw/ 12 * http://www.ite.com.tw/
13 * 13 *
14 * Support of the watchdog timers, which are available on 14 * Support of the watchdog timers, which are available on
15 * IT8716, IT8718, IT8726 and IT8712 (J,K version). 15 * IT8716, IT8718, IT8720, IT8726 and IT8712 (J,K version).
16 * 16 *
17 * This program is free software; you can redistribute it and/or 17 * This program is free software; you can redistribute it and/or
18 * modify it under the terms of the GNU General Public License 18 * modify it under the terms of the GNU General Public License
@@ -45,7 +45,7 @@
45 45
46#include <asm/system.h> 46#include <asm/system.h>
47 47
48#define WATCHDOG_VERSION "1.12" 48#define WATCHDOG_VERSION "1.13"
49#define WATCHDOG_NAME "IT87 WDT" 49#define WATCHDOG_NAME "IT87 WDT"
50#define PFX WATCHDOG_NAME ": " 50#define PFX WATCHDOG_NAME ": "
51#define DRIVER_VERSION WATCHDOG_NAME " driver, v" WATCHDOG_VERSION "\n" 51#define DRIVER_VERSION WATCHDOG_NAME " driver, v" WATCHDOG_VERSION "\n"
@@ -80,6 +80,7 @@
80#define IT8712_ID 0x8712 80#define IT8712_ID 0x8712
81#define IT8716_ID 0x8716 81#define IT8716_ID 0x8716
82#define IT8718_ID 0x8718 82#define IT8718_ID 0x8718
83#define IT8720_ID 0x8720
83#define IT8726_ID 0x8726 /* the data sheet suggest wrongly 0x8716 */ 84#define IT8726_ID 0x8726 /* the data sheet suggest wrongly 0x8716 */
84 85
85/* GPIO Configuration Registers LDN=0x07 */ 86/* GPIO Configuration Registers LDN=0x07 */
@@ -92,7 +93,7 @@
92#define WDT_CIRINT 0x80 93#define WDT_CIRINT 0x80
93#define WDT_MOUSEINT 0x40 94#define WDT_MOUSEINT 0x40
94#define WDT_KYBINT 0x20 95#define WDT_KYBINT 0x20
95#define WDT_GAMEPORT 0x10 /* not it8718 */ 96#define WDT_GAMEPORT 0x10 /* not in it8718, it8720 */
96#define WDT_FORCE 0x02 97#define WDT_FORCE 0x02
97#define WDT_ZERO 0x01 98#define WDT_ZERO 0x01
98 99
@@ -529,6 +530,7 @@ static struct notifier_block wdt_notifier = {
529static int __init it87_wdt_init(void) 530static int __init it87_wdt_init(void)
530{ 531{
531 int rc = 0; 532 int rc = 0;
533 int try_gameport = !nogameport;
532 u16 chip_type; 534 u16 chip_type;
533 u8 chip_rev; 535 u8 chip_rev;
534 unsigned long flags; 536 unsigned long flags;
@@ -542,9 +544,12 @@ static int __init it87_wdt_init(void)
542 544
543 switch (chip_type) { 545 switch (chip_type) {
544 case IT8716_ID: 546 case IT8716_ID:
545 case IT8718_ID:
546 case IT8726_ID: 547 case IT8726_ID:
547 break; 548 break;
549 case IT8718_ID:
550 case IT8720_ID:
551 try_gameport = 0;
552 break;
548 case IT8712_ID: 553 case IT8712_ID:
549 if (chip_rev > 7) 554 if (chip_rev > 7)
550 break; 555 break;
@@ -571,7 +576,7 @@ static int __init it87_wdt_init(void)
571 superio_outb(0x00, WDTCTRL); 576 superio_outb(0x00, WDTCTRL);
572 577
573 /* First try to get Gameport support */ 578 /* First try to get Gameport support */
574 if (chip_type != IT8718_ID && !nogameport) { 579 if (try_gameport) {
575 superio_select(GAMEPORT); 580 superio_select(GAMEPORT);
576 base = superio_inw(BASEREG); 581 base = superio_inw(BASEREG);
577 if (!base) { 582 if (!base) {
@@ -676,7 +681,7 @@ err_out_region:
676 spin_unlock_irqrestore(&spinlock, flags); 681 spin_unlock_irqrestore(&spinlock, flags);
677 } 682 }
678err_out: 683err_out:
679 if (chip_type != IT8718_ID && !nogameport) { 684 if (try_gameport) {
680 spin_lock_irqsave(&spinlock, flags); 685 spin_lock_irqsave(&spinlock, flags);
681 superio_enter(); 686 superio_enter();
682 superio_select(GAMEPORT); 687 superio_select(GAMEPORT);