aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/watchdog/it87_wdt.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/watchdog/it87_wdt.c')
-rw-r--r--drivers/watchdog/it87_wdt.c28
1 files changed, 16 insertions, 12 deletions
diff --git a/drivers/watchdog/it87_wdt.c b/drivers/watchdog/it87_wdt.c
index dad29245a6a7..b1bc72f9a209 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"
@@ -54,7 +54,7 @@
54/* Defaults for Module Parameter */ 54/* Defaults for Module Parameter */
55#define DEFAULT_NOGAMEPORT 0 55#define DEFAULT_NOGAMEPORT 0
56#define DEFAULT_EXCLUSIVE 1 56#define DEFAULT_EXCLUSIVE 1
57#define DEFAULT_TIMEOUT 60 57#define DEFAULT_TIMEOUT 60
58#define DEFAULT_TESTMODE 0 58#define DEFAULT_TESTMODE 0
59#define DEFAULT_NOWAYOUT WATCHDOG_NOWAYOUT 59#define DEFAULT_NOWAYOUT WATCHDOG_NOWAYOUT
60 60
@@ -70,9 +70,9 @@
70/* Configuration Registers and Functions */ 70/* Configuration Registers and Functions */
71#define LDNREG 0x07 71#define LDNREG 0x07
72#define CHIPID 0x20 72#define CHIPID 0x20
73#define CHIPREV 0x22 73#define CHIPREV 0x22
74#define ACTREG 0x30 74#define ACTREG 0x30
75#define BASEREG 0x60 75#define BASEREG 0x60
76 76
77/* Chip Id numbers */ 77/* Chip Id numbers */
78#define NO_DEV_ID 0xffff 78#define NO_DEV_ID 0xffff
@@ -82,10 +82,11 @@
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 */
88#define WDTCTRL 0x71 89#define WDTCTRL 0x71
89#define WDTCFG 0x72 90#define WDTCFG 0x72
90#define WDTVALLSB 0x73 91#define WDTVALLSB 0x73
91#define WDTVALMSB 0x74 92#define WDTVALMSB 0x74
@@ -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,11 +103,11 @@
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 */
109#define CIR_ILS 0x70 110#define CIR_ILS 0x70
110 111
111/* The default Base address is not always available, we use this */ 112/* The default Base address is not always available, we use this */
112#define CIR_BASE 0x0208 113#define CIR_BASE 0x0208
@@ -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
137static unsigned int base, gpact, ciract, max_units; 138static unsigned int base, gpact, ciract, max_units, chip_type;
138static unsigned long wdt_status; 139static unsigned long wdt_status;
139static DEFINE_SPINLOCK(spinlock); 140static 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) */
216static void wdt_update_timeout(void) 217static 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;