aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/watchdog/it8712f_wdt.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/watchdog/it8712f_wdt.c')
-rw-r--r--drivers/watchdog/it8712f_wdt.c27
1 files changed, 18 insertions, 9 deletions
diff --git a/drivers/watchdog/it8712f_wdt.c b/drivers/watchdog/it8712f_wdt.c
index f52c162b1bea..6143f52ba6b8 100644
--- a/drivers/watchdog/it8712f_wdt.c
+++ b/drivers/watchdog/it8712f_wdt.c
@@ -69,21 +69,29 @@ static unsigned short address;
69#define IT8712F_DEVID 0x8712 69#define IT8712F_DEVID 0x8712
70 70
71#define LDN_GPIO 0x07 /* GPIO and Watch Dog Timer */ 71#define LDN_GPIO 0x07 /* GPIO and Watch Dog Timer */
72#define LDN_GAME 0x09 /* Game Port */ 72#define LDN_GAME 0x09 /* Game Port */
73 73
74#define WDT_CONTROL 0x71 /* WDT Register: Control */ 74#define WDT_CONTROL 0x71 /* WDT Register: Control */
75#define WDT_CONFIG 0x72 /* WDT Register: Configuration */ 75#define WDT_CONFIG 0x72 /* WDT Register: Configuration */
76#define WDT_TIMEOUT 0x73 /* WDT Register: Timeout Value */ 76#define WDT_TIMEOUT 0x73 /* WDT Register: Timeout Value */
77 77
78#define WDT_RESET_GAME 0x10 78#define WDT_RESET_GAME 0x10 /* Reset timer on read or write to game port */
79#define WDT_RESET_KBD 0x20 79#define WDT_RESET_KBD 0x20 /* Reset timer on keyboard interrupt */
80#define WDT_RESET_MOUSE 0x40 80#define WDT_RESET_MOUSE 0x40 /* Reset timer on mouse interrupt */
81#define WDT_RESET_CIR 0x80 81#define WDT_RESET_CIR 0x80 /* Reset timer on consumer IR interrupt */
82 82
83#define WDT_UNIT_SEC 0x80 /* If 0 in MINUTES */ 83#define WDT_UNIT_SEC 0x80 /* If 0 in MINUTES */
84 84
85#define WDT_OUT_PWROK 0x10 85#define WDT_OUT_PWROK 0x10 /* Pulse PWROK on timeout */
86#define WDT_OUT_KRST 0x40 86#define WDT_OUT_KRST 0x40 /* Pulse reset on timeout */
87
88static int wdt_control_reg = WDT_RESET_GAME;
89module_param(wdt_control_reg, int, 0);
90MODULE_PARM_DESC(wdt_control_reg, "Value to write to watchdog control "
91 "register. The default WDT_RESET_GAME resets the timer on "
92 "game port reads that this driver generates. You can also "
93 "use KBD, MOUSE or CIR if you have some external way to "
94 "generate those interrupts.");
87 95
88static int superio_inb(int reg) 96static int superio_inb(int reg)
89{ 97{
@@ -131,7 +139,8 @@ static inline void superio_exit(void)
131 139
132static inline void it8712f_wdt_ping(void) 140static inline void it8712f_wdt_ping(void)
133{ 141{
134 inb(address); 142 if (wdt_control_reg & WDT_RESET_GAME)
143 inb(address);
135} 144}
136 145
137static void it8712f_wdt_update_margin(void) 146static void it8712f_wdt_update_margin(void)
@@ -170,7 +179,7 @@ static void it8712f_wdt_enable(void)
170 superio_enter(); 179 superio_enter();
171 superio_select(LDN_GPIO); 180 superio_select(LDN_GPIO);
172 181
173 superio_outb(WDT_RESET_GAME, WDT_CONTROL); 182 superio_outb(wdt_control_reg, WDT_CONTROL);
174 183
175 it8712f_wdt_update_margin(); 184 it8712f_wdt_update_margin();
176 185