diff mbox series

[RESEND,1/1,SRU,H,I] UBUNTU: SAUCE: watchdog: f71808e_wdt: Add F81966 support

Message ID 20211206055710.348049-2-acelan.kao@canonical.com
State New
Headers show
Series Add F81966 watchdog support | expand

Commit Message

AceLan Kao Dec. 6, 2021, 5:57 a.m. UTC
From: AaeonIot <sophiehu@aaeon.com.tw>

BugLink: https://bugs.launchpad.net/bugs/1949063

This adds watchdog support the Fintek F81966 Super I/O chip.
Testing was done on the Aaeon SSE-OPTI

Signed-off-by: AaeonIot <sophiehu@aaeon.com.tw>
Signed-off-by: Chia-Lin Kao (AceLan) <acelan.kao@canonical.com>
---
 drivers/watchdog/f71808e_wdt.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
 mode change 100644 => 100755 drivers/watchdog/f71808e_wdt.c
diff mbox series

Patch

diff --git a/drivers/watchdog/f71808e_wdt.c b/drivers/watchdog/f71808e_wdt.c
old mode 100644
new mode 100755
index f60beec1bbae..0e009d167964
--- a/drivers/watchdog/f71808e_wdt.c
+++ b/drivers/watchdog/f71808e_wdt.c
@@ -54,6 +54,7 @@ 
 #define SIO_F81803_ID		0x1210	/* Chipset ID */
 #define SIO_F81865_ID		0x0704	/* Chipset ID */
 #define SIO_F81866_ID		0x1010	/* Chipset ID */
+#define SIO_F81966_ID		0x1502  /* F81804 chipset ID, same for f81966 */
 
 #define F71808FG_REG_WDO_CONF		0xf0
 #define F71808FG_REG_WDT_CONF		0xf5
@@ -111,7 +112,7 @@  MODULE_PARM_DESC(start_withtimeout, "Start watchdog timer on module load with"
 	" given initial timeout. Zero (default) disables this feature.");
 
 enum chips { f71808fg, f71858fg, f71862fg, f71868, f71869, f71882fg, f71889fg,
-	     f81803, f81865, f81866};
+	     f81803, f81865, f81866, f81966};
 
 static const char *f71808e_names[] = {
 	"f71808fg",
@@ -124,6 +125,7 @@  static const char *f71808e_names[] = {
 	"f81803",
 	"f81865",
 	"f81866",
+	"f81966"
 };
 
 /* Super-I/O Function prototypes */
@@ -371,6 +373,7 @@  static int watchdog_start(void)
 		break;
 
 	case f81866:
+	case f81966:
 		/*
 		 * GPIO1 Control Register when 27h BIT3:2 = 01 & BIT0 = 0.
 		 * The PIN 70(GPIO15/WDTRST) is controlled by 2Ch:
@@ -397,7 +400,7 @@  static int watchdog_start(void)
 	superio_select(watchdog.sioaddr, SIO_F71808FG_LD_WDT);
 	superio_set_bit(watchdog.sioaddr, SIO_REG_ENABLE, 0);
 
-	if (watchdog.type == f81865 || watchdog.type == f81866)
+	if (watchdog.type == f81865 || watchdog.type == f81866 || watchdog.type == f81966)
 		superio_set_bit(watchdog.sioaddr, F81865_REG_WDO_CONF,
 				F81865_FLAG_WDOUT_EN);
 	else
@@ -820,6 +823,9 @@  static int __init f71808e_find(int sioaddr)
 	case SIO_F81866_ID:
 		watchdog.type = f81866;
 		break;
+	case SIO_F81966_ID:
+		watchdog.type = f81966;
+		break;
 	default:
 		pr_info("Unrecognized Fintek device: %04x\n",
 			(unsigned int)devid);