Browse Source

watchdog: it87_wdt: Add support for IT8721F watchdog

This patch adds support for a watchdog in IT8721F Super IO
chip to it87_wdt driver.
This new chips differ from the older IT87xxxF chips 
in the following ways:

* WDT_GAMEPORT is not in IT8721F.
* WDT_PWROK is not in IT8721F.

Signed-off-by: Haruo Tomita <haruo.tomita@toshiba.co.jp>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
Huaro Tomita 14 years ago
parent
commit
4bc30272a1
2 changed files with 12 additions and 8 deletions
  1. 1 1
      drivers/watchdog/Kconfig
  2. 11 7
      drivers/watchdog/it87_wdt.c

+ 1 - 1
drivers/watchdog/Kconfig

@@ -580,7 +580,7 @@ config IT87_WDT
 	depends on X86 && EXPERIMENTAL
 	depends on X86 && EXPERIMENTAL
 	---help---
 	---help---
 	  This is the driver for the hardware watchdog on the ITE IT8702,
 	  This is the driver for the hardware watchdog on the ITE IT8702,
-	  IT8712, IT8716, IT8718, IT8720, IT8726, IT8712 Super I/O chips.
+	  IT8712, IT8716, IT8718, IT8720, IT8721, IT8726 Super I/O chips.
 	  This watchdog simply watches your kernel to make sure it doesn't
 	  This watchdog simply watches your kernel to make sure it doesn't
 	  freeze, and if it does, it reboots your computer after a certain
 	  freeze, and if it does, it reboots your computer after a certain
 	  amount of time.
 	  amount of time.

+ 11 - 7
drivers/watchdog/it87_wdt.c

@@ -12,7 +12,7 @@
  *		    http://www.ite.com.tw/
  *		    http://www.ite.com.tw/
  *
  *
  *	Support of the watchdog timers, which are available on
  *	Support of the watchdog timers, which are available on
- *	IT8702, IT8712, IT8716, IT8718, IT8720 and IT8726.
+ *	IT8702, IT8712, IT8716, IT8718, IT8720, IT8721 and IT8726.
  *
  *
  *	This program is free software; you can redistribute it and/or
  *	This program is free software; you can redistribute it and/or
  *	modify it under the terms of the GNU General Public License
  *	modify it under the terms of the GNU General Public License
@@ -45,7 +45,7 @@
 
 
 #include <asm/system.h>
 #include <asm/system.h>
 
 
-#define WATCHDOG_VERSION	"1.13"
+#define WATCHDOG_VERSION	"1.14"
 #define WATCHDOG_NAME		"IT87 WDT"
 #define WATCHDOG_NAME		"IT87 WDT"
 #define PFX			WATCHDOG_NAME ": "
 #define PFX			WATCHDOG_NAME ": "
 #define DRIVER_VERSION		WATCHDOG_NAME " driver, v" WATCHDOG_VERSION "\n"
 #define DRIVER_VERSION		WATCHDOG_NAME " driver, v" WATCHDOG_VERSION "\n"
@@ -82,6 +82,7 @@
 #define IT8716_ID	0x8716
 #define IT8716_ID	0x8716
 #define IT8718_ID	0x8718
 #define IT8718_ID	0x8718
 #define IT8720_ID	0x8720
 #define IT8720_ID	0x8720
+#define IT8721_ID	0x8721
 #define IT8726_ID	0x8726	/* the data sheet suggest wrongly 0x8716 */
 #define IT8726_ID	0x8726	/* the data sheet suggest wrongly 0x8716 */
 
 
 /* GPIO Configuration Registers LDN=0x07 */
 /* GPIO Configuration Registers LDN=0x07 */
@@ -94,7 +95,7 @@
 #define WDT_CIRINT	0x80
 #define WDT_CIRINT	0x80
 #define WDT_MOUSEINT	0x40
 #define WDT_MOUSEINT	0x40
 #define WDT_KYBINT	0x20
 #define WDT_KYBINT	0x20
-#define WDT_GAMEPORT	0x10 /* not in it8718, it8720 */
+#define WDT_GAMEPORT	0x10 /* not in it8718, it8720, it8721 */
 #define WDT_FORCE	0x02
 #define WDT_FORCE	0x02
 #define WDT_ZERO	0x01
 #define WDT_ZERO	0x01
 
 
@@ -102,7 +103,7 @@
 #define WDT_TOV1	0x80
 #define WDT_TOV1	0x80
 #define WDT_KRST	0x40
 #define WDT_KRST	0x40
 #define WDT_TOVE	0x20
 #define WDT_TOVE	0x20
-#define WDT_PWROK	0x10
+#define WDT_PWROK	0x10 /* not in it8721 */
 #define WDT_INT_MASK	0x0f
 #define WDT_INT_MASK	0x0f
 
 
 /* CIR Configuration Register LDN=0x0a */
 /* CIR Configuration Register LDN=0x0a */
@@ -134,7 +135,7 @@
 #define WDTS_USE_GP	4
 #define WDTS_USE_GP	4
 #define WDTS_EXPECTED	5
 #define WDTS_EXPECTED	5
 
 
-static	unsigned int base, gpact, ciract, max_units;
+static	unsigned int base, gpact, ciract, max_units, chip_type;
 static	unsigned long wdt_status;
 static	unsigned long wdt_status;
 static	DEFINE_SPINLOCK(spinlock);
 static	DEFINE_SPINLOCK(spinlock);
 
 
@@ -215,7 +216,7 @@ static inline void superio_outw(int val, int reg)
 /* Internal function, should be called after superio_select(GPIO) */
 /* Internal function, should be called after superio_select(GPIO) */
 static void wdt_update_timeout(void)
 static void wdt_update_timeout(void)
 {
 {
-	unsigned char cfg = WDT_KRST | WDT_PWROK;
+	unsigned char cfg = WDT_KRST;
 	int tm = timeout;
 	int tm = timeout;
 
 
 	if (testmode)
 	if (testmode)
@@ -226,6 +227,9 @@ static void wdt_update_timeout(void)
 	else
 	else
 		tm /= 60;
 		tm /= 60;
 
 
+	if (chip_type != IT8721_ID)
+		cfg |= WDT_PWROK;
+
 	superio_outb(cfg, WDTCFG);
 	superio_outb(cfg, WDTCFG);
 	superio_outb(tm, WDTVALLSB);
 	superio_outb(tm, WDTVALLSB);
 	if (max_units > 255)
 	if (max_units > 255)
@@ -555,7 +559,6 @@ static int __init it87_wdt_init(void)
 {
 {
 	int rc = 0;
 	int rc = 0;
 	int try_gameport = !nogameport;
 	int try_gameport = !nogameport;
-	u16 chip_type;
 	u8  chip_rev;
 	u8  chip_rev;
 	unsigned long flags;
 	unsigned long flags;
 
 
@@ -581,6 +584,7 @@ static int __init it87_wdt_init(void)
 		break;
 		break;
 	case IT8718_ID:
 	case IT8718_ID:
 	case IT8720_ID:
 	case IT8720_ID:
+	case IT8721_ID:
 		max_units = 65535;
 		max_units = 65535;
 		try_gameport = 0;
 		try_gameport = 0;
 		break;
 		break;