Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

watchdog: f71808e_wdt: Add F71868 support

This adds support for watchdog part of Fintek F71868 Super I/O chip to
f71808e_wdt driver.

The F71868 chip is, in general, very similar to a F71869, however it has
slightly different set of available reset pulse widths.

Tested on MSI A55M-P33 motherboard.

Signed-off-by: Maciej S. Szmigiero <mail@maciej.szmigiero.name>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>

authored by

Maciej S. Szmigiero and committed by
Wim Van Sebroeck
166fbcf8 4332d113

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