diff options
author | Huaro Tomita <haruo.tomita@toshiba.co.jp> | 2011-01-20 17:37:51 -0500 |
---|---|---|
committer | Wim Van Sebroeck <wim@iguana.be> | 2011-03-15 12:01:35 -0400 |
commit | 4bc30272a15c58fc358bde093703d23bc0cf8e66 (patch) | |
tree | b3e8238913edae1b1edc17312488939e708d828c /drivers/watchdog/it87_wdt.c | |
parent | a4616153deae053b29a2b7dd9ec4b2a225accfc5 (diff) |
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>
Diffstat (limited to 'drivers/watchdog/it87_wdt.c')
-rw-r--r-- | drivers/watchdog/it87_wdt.c | 18 |
1 files changed, 11 insertions, 7 deletions
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 @@ | |||
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 | * IT8702, IT8712, IT8716, IT8718, IT8720 and IT8726. | 15 | * IT8702, IT8712, IT8716, IT8718, IT8720, IT8721 and IT8726. |
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.13" | 48 | #define WATCHDOG_VERSION "1.14" |
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" |
@@ -82,6 +82,7 @@ | |||
82 | #define IT8716_ID 0x8716 | 82 | #define IT8716_ID 0x8716 |
83 | #define IT8718_ID 0x8718 | 83 | #define IT8718_ID 0x8718 |
84 | #define IT8720_ID 0x8720 | 84 | #define IT8720_ID 0x8720 |
85 | #define IT8721_ID 0x8721 | ||
85 | #define IT8726_ID 0x8726 /* the data sheet suggest wrongly 0x8716 */ | 86 | #define IT8726_ID 0x8726 /* the data sheet suggest wrongly 0x8716 */ |
86 | 87 | ||
87 | /* GPIO Configuration Registers LDN=0x07 */ | 88 | /* GPIO Configuration Registers LDN=0x07 */ |
@@ -94,7 +95,7 @@ | |||
94 | #define WDT_CIRINT 0x80 | 95 | #define WDT_CIRINT 0x80 |
95 | #define WDT_MOUSEINT 0x40 | 96 | #define WDT_MOUSEINT 0x40 |
96 | #define WDT_KYBINT 0x20 | 97 | #define WDT_KYBINT 0x20 |
97 | #define WDT_GAMEPORT 0x10 /* not in it8718, it8720 */ | 98 | #define WDT_GAMEPORT 0x10 /* not in it8718, it8720, it8721 */ |
98 | #define WDT_FORCE 0x02 | 99 | #define WDT_FORCE 0x02 |
99 | #define WDT_ZERO 0x01 | 100 | #define WDT_ZERO 0x01 |
100 | 101 | ||
@@ -102,7 +103,7 @@ | |||
102 | #define WDT_TOV1 0x80 | 103 | #define WDT_TOV1 0x80 |
103 | #define WDT_KRST 0x40 | 104 | #define WDT_KRST 0x40 |
104 | #define WDT_TOVE 0x20 | 105 | #define WDT_TOVE 0x20 |
105 | #define WDT_PWROK 0x10 | 106 | #define WDT_PWROK 0x10 /* not in it8721 */ |
106 | #define WDT_INT_MASK 0x0f | 107 | #define WDT_INT_MASK 0x0f |
107 | 108 | ||
108 | /* CIR Configuration Register LDN=0x0a */ | 109 | /* CIR Configuration Register LDN=0x0a */ |
@@ -134,7 +135,7 @@ | |||
134 | #define WDTS_USE_GP 4 | 135 | #define WDTS_USE_GP 4 |
135 | #define WDTS_EXPECTED 5 | 136 | #define WDTS_EXPECTED 5 |
136 | 137 | ||
137 | static unsigned int base, gpact, ciract, max_units; | 138 | static unsigned int base, gpact, ciract, max_units, chip_type; |
138 | static unsigned long wdt_status; | 139 | static unsigned long wdt_status; |
139 | static DEFINE_SPINLOCK(spinlock); | 140 | static DEFINE_SPINLOCK(spinlock); |
140 | 141 | ||
@@ -215,7 +216,7 @@ static inline void superio_outw(int val, int reg) | |||
215 | /* Internal function, should be called after superio_select(GPIO) */ | 216 | /* Internal function, should be called after superio_select(GPIO) */ |
216 | static void wdt_update_timeout(void) | 217 | static void wdt_update_timeout(void) |
217 | { | 218 | { |
218 | unsigned char cfg = WDT_KRST | WDT_PWROK; | 219 | unsigned char cfg = WDT_KRST; |
219 | int tm = timeout; | 220 | int tm = timeout; |
220 | 221 | ||
221 | if (testmode) | 222 | if (testmode) |
@@ -226,6 +227,9 @@ static void wdt_update_timeout(void) | |||
226 | else | 227 | else |
227 | tm /= 60; | 228 | tm /= 60; |
228 | 229 | ||
230 | if (chip_type != IT8721_ID) | ||
231 | cfg |= WDT_PWROK; | ||
232 | |||
229 | superio_outb(cfg, WDTCFG); | 233 | superio_outb(cfg, WDTCFG); |
230 | superio_outb(tm, WDTVALLSB); | 234 | superio_outb(tm, WDTVALLSB); |
231 | if (max_units > 255) | 235 | if (max_units > 255) |
@@ -555,7 +559,6 @@ static int __init it87_wdt_init(void) | |||
555 | { | 559 | { |
556 | int rc = 0; | 560 | int rc = 0; |
557 | int try_gameport = !nogameport; | 561 | int try_gameport = !nogameport; |
558 | u16 chip_type; | ||
559 | u8 chip_rev; | 562 | u8 chip_rev; |
560 | unsigned long flags; | 563 | unsigned long flags; |
561 | 564 | ||
@@ -581,6 +584,7 @@ static int __init it87_wdt_init(void) | |||
581 | break; | 584 | break; |
582 | case IT8718_ID: | 585 | case IT8718_ID: |
583 | case IT8720_ID: | 586 | case IT8720_ID: |
587 | case IT8721_ID: | ||
584 | max_units = 65535; | 588 | max_units = 65535; |
585 | try_gameport = 0; | 589 | try_gameport = 0; |
586 | break; | 590 | break; |