From: Huaro Tomita Date: Thu, 20 Jan 2011 22:37:51 +0000 (+0900) Subject: watchdog: it87_wdt: Add support for IT8721F watchdog X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=4bc30272a15c58fc358bde093703d23bc0cf8e66;p=linux-beck.git 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 Signed-off-by: Wim Van Sebroeck --- diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig index 322b36a9c0e6..229a9c1506b6 100644 --- a/drivers/watchdog/Kconfig +++ b/drivers/watchdog/Kconfig @@ -580,7 +580,7 @@ config IT87_WDT depends on X86 && EXPERIMENTAL ---help--- 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 freeze, and if it does, it reboots your computer after a certain amount of time. diff --git a/drivers/watchdog/it87_wdt.c b/drivers/watchdog/it87_wdt.c index dad29245a6a7..e5c8b37bf739 100644 --- a/drivers/watchdog/it87_wdt.c +++ b/drivers/watchdog/it87_wdt.c @@ -12,7 +12,7 @@ * http://www.ite.com.tw/ * * 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 * modify it under the terms of the GNU General Public License @@ -45,7 +45,7 @@ #include -#define WATCHDOG_VERSION "1.13" +#define WATCHDOG_VERSION "1.14" #define WATCHDOG_NAME "IT87 WDT" #define PFX WATCHDOG_NAME ": " #define DRIVER_VERSION WATCHDOG_NAME " driver, v" WATCHDOG_VERSION "\n" @@ -82,6 +82,7 @@ #define IT8716_ID 0x8716 #define IT8718_ID 0x8718 #define IT8720_ID 0x8720 +#define IT8721_ID 0x8721 #define IT8726_ID 0x8726 /* the data sheet suggest wrongly 0x8716 */ /* GPIO Configuration Registers LDN=0x07 */ @@ -94,7 +95,7 @@ #define WDT_CIRINT 0x80 #define WDT_MOUSEINT 0x40 #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_ZERO 0x01 @@ -102,7 +103,7 @@ #define WDT_TOV1 0x80 #define WDT_KRST 0x40 #define WDT_TOVE 0x20 -#define WDT_PWROK 0x10 +#define WDT_PWROK 0x10 /* not in it8721 */ #define WDT_INT_MASK 0x0f /* CIR Configuration Register LDN=0x0a */ @@ -134,7 +135,7 @@ #define WDTS_USE_GP 4 #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 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) */ static void wdt_update_timeout(void) { - unsigned char cfg = WDT_KRST | WDT_PWROK; + unsigned char cfg = WDT_KRST; int tm = timeout; if (testmode) @@ -226,6 +227,9 @@ static void wdt_update_timeout(void) else tm /= 60; + if (chip_type != IT8721_ID) + cfg |= WDT_PWROK; + superio_outb(cfg, WDTCFG); superio_outb(tm, WDTVALLSB); if (max_units > 255) @@ -555,7 +559,6 @@ static int __init it87_wdt_init(void) { int rc = 0; int try_gameport = !nogameport; - u16 chip_type; u8 chip_rev; unsigned long flags; @@ -581,6 +584,7 @@ static int __init it87_wdt_init(void) break; case IT8718_ID: case IT8720_ID: + case IT8721_ID: max_units = 65535; try_gameport = 0; break;