summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/watchdog/Kconfig7
-rw-r--r--drivers/watchdog/f71808e_wdt.c27
2 files changed, 24 insertions, 10 deletions
diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
index 124e9b87ab6b..2696493c808b 100644
--- a/drivers/watchdog/Kconfig
+++ b/drivers/watchdog/Kconfig
@@ -849,11 +849,12 @@ config EBC_C384_WDT
849 the timeout module parameter. 849 the timeout module parameter.
850 850
851config F71808E_WDT 851config F71808E_WDT
852 tristate "Fintek F71808E, F71862FG, F71869, F71882FG and F71889FG Watchdog" 852 tristate "Fintek F718xx, F818xx Super I/O Watchdog"
853 depends on X86 853 depends on X86
854 help 854 help
855 This is the driver for the hardware watchdog on the Fintek 855 This is the driver for the hardware watchdog on the Fintek F71808E,
856 F71808E, F71862FG, F71869, F71882FG and F71889FG Super I/O controllers. 856 F71862FG, F71868, F71869, F71882FG, F71889FG, F81865 and F81866
857 Super I/O controllers.
857 858
858 You can compile this driver directly into the kernel, or use 859 You can compile this driver directly into the kernel, or use
859 it as a module. The module will be called f71808e_wdt. 860 it as a module. The module will be called f71808e_wdt.
diff --git a/drivers/watchdog/f71808e_wdt.c b/drivers/watchdog/f71808e_wdt.c
index 1b7e9169072f..8658dba21768 100644
--- a/drivers/watchdog/f71808e_wdt.c
+++ b/drivers/watchdog/f71808e_wdt.c
@@ -57,6 +57,7 @@
57#define SIO_F71808_ID 0x0901 /* Chipset ID */ 57#define SIO_F71808_ID 0x0901 /* Chipset ID */
58#define SIO_F71858_ID 0x0507 /* Chipset ID */ 58#define SIO_F71858_ID 0x0507 /* Chipset ID */
59#define SIO_F71862_ID 0x0601 /* Chipset ID */ 59#define SIO_F71862_ID 0x0601 /* Chipset ID */
60#define SIO_F71868_ID 0x1106 /* Chipset ID */
60#define SIO_F71869_ID 0x0814 /* Chipset ID */ 61#define SIO_F71869_ID 0x0814 /* Chipset ID */
61#define SIO_F71869A_ID 0x1007 /* Chipset ID */ 62#define SIO_F71869A_ID 0x1007 /* Chipset ID */
62#define SIO_F71882_ID 0x0541 /* Chipset ID */ 63#define SIO_F71882_ID 0x0541 /* Chipset ID */
@@ -101,7 +102,7 @@ MODULE_PARM_DESC(timeout,
101static unsigned int pulse_width = WATCHDOG_PULSE_WIDTH; 102static unsigned int pulse_width = WATCHDOG_PULSE_WIDTH;
102module_param(pulse_width, uint, 0); 103module_param(pulse_width, uint, 0);
103MODULE_PARM_DESC(pulse_width, 104MODULE_PARM_DESC(pulse_width,
104 "Watchdog signal pulse width. 0(=level), 1 ms, 25 ms, 125 ms or 5000 ms" 105 "Watchdog signal pulse width. 0(=level), 1, 25, 30, 125, 150, 5000 or 6000 ms"
105 " (default=" __MODULE_STRING(WATCHDOG_PULSE_WIDTH) ")"); 106 " (default=" __MODULE_STRING(WATCHDOG_PULSE_WIDTH) ")");
106 107
107static unsigned int f71862fg_pin = WATCHDOG_F71862FG_PIN; 108static unsigned int f71862fg_pin = WATCHDOG_F71862FG_PIN;
@@ -119,13 +120,14 @@ module_param(start_withtimeout, uint, 0);
119MODULE_PARM_DESC(start_withtimeout, "Start watchdog timer on module load with" 120MODULE_PARM_DESC(start_withtimeout, "Start watchdog timer on module load with"
120 " given initial timeout. Zero (default) disables this feature."); 121 " given initial timeout. Zero (default) disables this feature.");
121 122
122enum chips { f71808fg, f71858fg, f71862fg, f71869, f71882fg, f71889fg, f81865, 123enum chips { f71808fg, f71858fg, f71862fg, f71868, f71869, f71882fg, f71889fg,
123 f81866}; 124 f81865, f81866};
124 125
125static const char *f71808e_names[] = { 126static const char *f71808e_names[] = {
126 "f71808fg", 127 "f71808fg",
127 "f71858fg", 128 "f71858fg",
128 "f71862fg", 129 "f71862fg",
130 "f71868",
129 "f71869", 131 "f71869",
130 "f71882fg", 132 "f71882fg",
131 "f71889fg", 133 "f71889fg",
@@ -252,16 +254,23 @@ static int watchdog_set_timeout(int timeout)
252static int watchdog_set_pulse_width(unsigned int pw) 254static int watchdog_set_pulse_width(unsigned int pw)
253{ 255{
254 int err = 0; 256 int err = 0;
257 unsigned int t1 = 25, t2 = 125, t3 = 5000;
258
259 if (watchdog.type == f71868) {
260 t1 = 30;
261 t2 = 150;
262 t3 = 6000;
263 }
255 264
256 mutex_lock(&watchdog.lock); 265 mutex_lock(&watchdog.lock);
257 266
258 if (pw <= 1) { 267 if (pw <= 1) {
259 watchdog.pulse_val = 0; 268 watchdog.pulse_val = 0;
260 } else if (pw <= 25) { 269 } else if (pw <= t1) {
261 watchdog.pulse_val = 1; 270 watchdog.pulse_val = 1;
262 } else if (pw <= 125) { 271 } else if (pw <= t2) {
263 watchdog.pulse_val = 2; 272 watchdog.pulse_val = 2;
264 } else if (pw <= 5000) { 273 } else if (pw <= t3) {
265 watchdog.pulse_val = 3; 274 watchdog.pulse_val = 3;
266 } else { 275 } else {
267 pr_err("pulse width out of range\n"); 276 pr_err("pulse width out of range\n");
@@ -354,6 +363,7 @@ static int watchdog_start(void)
354 goto exit_superio; 363 goto exit_superio;
355 break; 364 break;
356 365
366 case f71868:
357 case f71869: 367 case f71869:
358 /* GPIO14 --> WDTRST# */ 368 /* GPIO14 --> WDTRST# */
359 superio_clear_bit(watchdog.sioaddr, SIO_REG_MFUNCT1, 4); 369 superio_clear_bit(watchdog.sioaddr, SIO_REG_MFUNCT1, 4);
@@ -792,6 +802,9 @@ static int __init f71808e_find(int sioaddr)
792 watchdog.type = f71862fg; 802 watchdog.type = f71862fg;
793 err = f71862fg_pin_configure(0); /* validate module parameter */ 803 err = f71862fg_pin_configure(0); /* validate module parameter */
794 break; 804 break;
805 case SIO_F71868_ID:
806 watchdog.type = f71868;
807 break;
795 case SIO_F71869_ID: 808 case SIO_F71869_ID:
796 case SIO_F71869A_ID: 809 case SIO_F71869A_ID:
797 watchdog.type = f71869; 810 watchdog.type = f71869;