Linux-Watchdog Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] watchdog: w83627hf_wdt: Support NCT6116D
@ 2019-09-18 13:42 Srikanth_Krishnakar
  2019-09-18 14:57 ` Guenter Roeck
  0 siblings, 1 reply; 4+ messages in thread
From: Srikanth_Krishnakar @ 2019-09-18 13:42 UTC (permalink / raw)
  To: linux-watchdog, linux, wim; +Cc: Cedric_Hombourger, Srikanth_Krishnakar

From: Srikanth Krishnakar <Srikanth_Krishnakar@mentor.com>

The watchdog controller on NCT6116D is compatible with NCT6102D.
Extend the support to enable SuperIO based NCT6116D watchdog device.

Signed-off-by: Srikanth Krishnakar <Srikanth_Krishnakar@mentor.com>
---
 drivers/watchdog/Kconfig        |  1 +
 drivers/watchdog/w83627hf_wdt.c | 11 ++++++++++-
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
index a45f9e3e442b..4affadda5185 100644
--- a/drivers/watchdog/Kconfig
+++ b/drivers/watchdog/Kconfig
@@ -1488,6 +1488,7 @@ config W83627HF_WDT
 		NCT6791
 		NCT6792
 		NCT6102D/04D/06D
+		NCT6116D
 
 	  This watchdog simply watches your kernel to make sure it doesn't
 	  freeze, and if it does, it reboots your computer after a certain
diff --git a/drivers/watchdog/w83627hf_wdt.c b/drivers/watchdog/w83627hf_wdt.c
index 38b31e9947aa..fdf533fe0bb2 100644
--- a/drivers/watchdog/w83627hf_wdt.c
+++ b/drivers/watchdog/w83627hf_wdt.c
@@ -49,7 +49,7 @@ static int wdt_cfg_leave = 0xAA;/* key to lock configuration space */
 enum chips { w83627hf, w83627s, w83697hf, w83697ug, w83637hf, w83627thf,
 	     w83687thf, w83627ehf, w83627dhg, w83627uhg, w83667hg, w83627dhg_p,
 	     w83667hg_b, nct6775, nct6776, nct6779, nct6791, nct6792, nct6793,
-	     nct6795, nct6796, nct6102 };
+	     nct6795, nct6796, nct6102, nct6116 };
 
 static int timeout;			/* in seconds */
 module_param(timeout, int, 0);
@@ -94,6 +94,7 @@ MODULE_PARM_DESC(early_disable, "Disable watchdog at boot time (default=0)");
 #define NCT6775_ID		0xb4
 #define NCT6776_ID		0xc3
 #define NCT6102_ID		0xc4
+#define NCT6116_ID		0xd2
 #define NCT6779_ID		0xc5
 #define NCT6791_ID		0xc8
 #define NCT6792_ID		0xc9
@@ -211,6 +212,7 @@ static int w83627hf_init(struct watchdog_device *wdog, enum chips chip)
 	case nct6795:
 	case nct6796:
 	case nct6102:
+	case nct6116:
 		/*
 		 * These chips have a fixed WDTO# output pin (W83627UHG),
 		 * or support more than one WDTO# output pin.
@@ -417,6 +419,12 @@ static int wdt_find(int addr)
 		cr_wdt_control = NCT6102D_WDT_CONTROL;
 		cr_wdt_csr = NCT6102D_WDT_CSR;
 		break;
+	case NCT6116_ID:
+		ret = nct6102;
+		cr_wdt_timeout = NCT6102D_WDT_TIMEOUT;
+		cr_wdt_control = NCT6102D_WDT_CONTROL;
+		cr_wdt_csr = NCT6102D_WDT_CSR;
+		break;
 	case 0xff:
 		ret = -ENODEV;
 		break;
@@ -482,6 +490,7 @@ static int __init wdt_init(void)
 		"NCT6795",
 		"NCT6796",
 		"NCT6102",
+		"NCT6116",
 	};
 
 	/* Apply system-specific quirks */
-- 
2.17.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] watchdog: w83627hf_wdt: Support NCT6116D
  2019-09-18 13:42 [PATCH] watchdog: w83627hf_wdt: Support NCT6116D Srikanth_Krishnakar
@ 2019-09-18 14:57 ` Guenter Roeck
  2019-09-18 16:04   ` [PATCH v2] " Srikanth Krishnakar
  0 siblings, 1 reply; 4+ messages in thread
From: Guenter Roeck @ 2019-09-18 14:57 UTC (permalink / raw)
  To: Srikanth_Krishnakar
  Cc: linux-watchdog, wim, Cedric_Hombourger, Srikanth_Krishnakar

On Wed, Sep 18, 2019 at 07:12:15PM +0530, Srikanth_Krishnakar wrote:
> From: Srikanth Krishnakar <Srikanth_Krishnakar@mentor.com>
> 
> The watchdog controller on NCT6116D is compatible with NCT6102D.
> Extend the support to enable SuperIO based NCT6116D watchdog device.
> 
> Signed-off-by: Srikanth Krishnakar <Srikanth_Krishnakar@mentor.com>
> ---
>  drivers/watchdog/Kconfig        |  1 +
>  drivers/watchdog/w83627hf_wdt.c | 11 ++++++++++-
>  2 files changed, 11 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
> index a45f9e3e442b..4affadda5185 100644
> --- a/drivers/watchdog/Kconfig
> +++ b/drivers/watchdog/Kconfig
> @@ -1488,6 +1488,7 @@ config W83627HF_WDT
>  		NCT6791
>  		NCT6792
>  		NCT6102D/04D/06D
> +		NCT6116D
>  
>  	  This watchdog simply watches your kernel to make sure it doesn't
>  	  freeze, and if it does, it reboots your computer after a certain
> diff --git a/drivers/watchdog/w83627hf_wdt.c b/drivers/watchdog/w83627hf_wdt.c
> index 38b31e9947aa..fdf533fe0bb2 100644
> --- a/drivers/watchdog/w83627hf_wdt.c
> +++ b/drivers/watchdog/w83627hf_wdt.c
> @@ -49,7 +49,7 @@ static int wdt_cfg_leave = 0xAA;/* key to lock configuration space */
>  enum chips { w83627hf, w83627s, w83697hf, w83697ug, w83637hf, w83627thf,
>  	     w83687thf, w83627ehf, w83627dhg, w83627uhg, w83667hg, w83627dhg_p,
>  	     w83667hg_b, nct6775, nct6776, nct6779, nct6791, nct6792, nct6793,
> -	     nct6795, nct6796, nct6102 };
> +	     nct6795, nct6796, nct6102, nct6116 };
>  
>  static int timeout;			/* in seconds */
>  module_param(timeout, int, 0);
> @@ -94,6 +94,7 @@ MODULE_PARM_DESC(early_disable, "Disable watchdog at boot time (default=0)");
>  #define NCT6775_ID		0xb4
>  #define NCT6776_ID		0xc3
>  #define NCT6102_ID		0xc4
> +#define NCT6116_ID		0xd2
>  #define NCT6779_ID		0xc5
>  #define NCT6791_ID		0xc8
>  #define NCT6792_ID		0xc9
> @@ -211,6 +212,7 @@ static int w83627hf_init(struct watchdog_device *wdog, enum chips chip)
>  	case nct6795:
>  	case nct6796:
>  	case nct6102:
> +	case nct6116:
>  		/*
>  		 * These chips have a fixed WDTO# output pin (W83627UHG),
>  		 * or support more than one WDTO# output pin.
> @@ -417,6 +419,12 @@ static int wdt_find(int addr)
>  		cr_wdt_control = NCT6102D_WDT_CONTROL;
>  		cr_wdt_csr = NCT6102D_WDT_CSR;
>  		break;
> +	case NCT6116_ID:
> +		ret = nct6102;

What is the point of introducing a new id for the chip and then
ignoring it ?

Guenter

> +		cr_wdt_timeout = NCT6102D_WDT_TIMEOUT;
> +		cr_wdt_control = NCT6102D_WDT_CONTROL;
> +		cr_wdt_csr = NCT6102D_WDT_CSR;
> +		break;
>  	case 0xff:
>  		ret = -ENODEV;
>  		break;
> @@ -482,6 +490,7 @@ static int __init wdt_init(void)
>  		"NCT6795",
>  		"NCT6796",
>  		"NCT6102",
> +		"NCT6116",
>  	};
>  
>  	/* Apply system-specific quirks */
> -- 
> 2.17.1
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v2] watchdog: w83627hf_wdt: Support NCT6116D
  2019-09-18 14:57 ` Guenter Roeck
@ 2019-09-18 16:04   ` " Srikanth Krishnakar
  2019-09-18 20:15     ` Guenter Roeck
  0 siblings, 1 reply; 4+ messages in thread
From: Srikanth Krishnakar @ 2019-09-18 16:04 UTC (permalink / raw)
  To: linux-watchdog, linux; +Cc: Cedric_Hombourger, Srikanth_Krishnakar

The watchdog controller on NCT6116D is compatible with NCT6102D.
Extend the support to enable SuperIO based NCT6116D watchdog device.

Tested on Siemens SIMATIC IPC-527G.

Signed-off-by: Srikanth Krishnakar <Srikanth_Krishnakar@mentor.com>
---

Thanks for the catch Guenter!

That was not intentional. Fixed the typo of return ID. I could have 
merged return ID of 6116 into 6102D but that would display 6102D as
SuperIO Initialized in bootlog.

 drivers/watchdog/Kconfig        |  1 +
 drivers/watchdog/w83627hf_wdt.c | 11 ++++++++++-
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
index a45f9e3e442b..4affadda5185 100644
--- a/drivers/watchdog/Kconfig
+++ b/drivers/watchdog/Kconfig
@@ -1488,6 +1488,7 @@ config W83627HF_WDT
 		NCT6791
 		NCT6792
 		NCT6102D/04D/06D
+		NCT6116D
 
 	  This watchdog simply watches your kernel to make sure it doesn't
 	  freeze, and if it does, it reboots your computer after a certain
diff --git a/drivers/watchdog/w83627hf_wdt.c b/drivers/watchdog/w83627hf_wdt.c
index 38b31e9947aa..56a4a4030ca9 100644
--- a/drivers/watchdog/w83627hf_wdt.c
+++ b/drivers/watchdog/w83627hf_wdt.c
@@ -49,7 +49,7 @@ static int wdt_cfg_leave = 0xAA;/* key to lock configuration space */
 enum chips { w83627hf, w83627s, w83697hf, w83697ug, w83637hf, w83627thf,
 	     w83687thf, w83627ehf, w83627dhg, w83627uhg, w83667hg, w83627dhg_p,
 	     w83667hg_b, nct6775, nct6776, nct6779, nct6791, nct6792, nct6793,
-	     nct6795, nct6796, nct6102 };
+	     nct6795, nct6796, nct6102, nct6116 };
 
 static int timeout;			/* in seconds */
 module_param(timeout, int, 0);
@@ -94,6 +94,7 @@ MODULE_PARM_DESC(early_disable, "Disable watchdog at boot time (default=0)");
 #define NCT6775_ID		0xb4
 #define NCT6776_ID		0xc3
 #define NCT6102_ID		0xc4
+#define NCT6116_ID		0xd2
 #define NCT6779_ID		0xc5
 #define NCT6791_ID		0xc8
 #define NCT6792_ID		0xc9
@@ -211,6 +212,7 @@ static int w83627hf_init(struct watchdog_device *wdog, enum chips chip)
 	case nct6795:
 	case nct6796:
 	case nct6102:
+	case nct6116:
 		/*
 		 * These chips have a fixed WDTO# output pin (W83627UHG),
 		 * or support more than one WDTO# output pin.
@@ -417,6 +419,12 @@ static int wdt_find(int addr)
 		cr_wdt_control = NCT6102D_WDT_CONTROL;
 		cr_wdt_csr = NCT6102D_WDT_CSR;
 		break;
+	case NCT6116_ID:
+		ret = nct6116;
+		cr_wdt_timeout = NCT6102D_WDT_TIMEOUT;
+		cr_wdt_control = NCT6102D_WDT_CONTROL;
+		cr_wdt_csr = NCT6102D_WDT_CSR;
+		break;
 	case 0xff:
 		ret = -ENODEV;
 		break;
@@ -482,6 +490,7 @@ static int __init wdt_init(void)
 		"NCT6795",
 		"NCT6796",
 		"NCT6102",
+		"NCT6116",
 	};
 
 	/* Apply system-specific quirks */
-- 
2.17.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] watchdog: w83627hf_wdt: Support NCT6116D
  2019-09-18 16:04   ` [PATCH v2] " Srikanth Krishnakar
@ 2019-09-18 20:15     ` Guenter Roeck
  0 siblings, 0 replies; 4+ messages in thread
From: Guenter Roeck @ 2019-09-18 20:15 UTC (permalink / raw)
  To: Srikanth Krishnakar
  Cc: linux-watchdog, Cedric_Hombourger, Srikanth_Krishnakar

On Wed, Sep 18, 2019 at 09:34:58PM +0530, Srikanth Krishnakar wrote:
> The watchdog controller on NCT6116D is compatible with NCT6102D.
> Extend the support to enable SuperIO based NCT6116D watchdog device.
> 
> Tested on Siemens SIMATIC IPC-527G.
> 
> Signed-off-by: Srikanth Krishnakar <Srikanth_Krishnakar@mentor.com>

Reviewed-by: Guenter Roeck <linux@roeck-us.net>

> ---
> 
> Thanks for the catch Guenter!
> 
> That was not intentional. Fixed the typo of return ID. I could have 
> merged return ID of 6116 into 6102D but that would display 6102D as
> SuperIO Initialized in bootlog.
> 
>  drivers/watchdog/Kconfig        |  1 +
>  drivers/watchdog/w83627hf_wdt.c | 11 ++++++++++-
>  2 files changed, 11 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
> index a45f9e3e442b..4affadda5185 100644
> --- a/drivers/watchdog/Kconfig
> +++ b/drivers/watchdog/Kconfig
> @@ -1488,6 +1488,7 @@ config W83627HF_WDT
>  		NCT6791
>  		NCT6792
>  		NCT6102D/04D/06D
> +		NCT6116D
>  
>  	  This watchdog simply watches your kernel to make sure it doesn't
>  	  freeze, and if it does, it reboots your computer after a certain
> diff --git a/drivers/watchdog/w83627hf_wdt.c b/drivers/watchdog/w83627hf_wdt.c
> index 38b31e9947aa..56a4a4030ca9 100644
> --- a/drivers/watchdog/w83627hf_wdt.c
> +++ b/drivers/watchdog/w83627hf_wdt.c
> @@ -49,7 +49,7 @@ static int wdt_cfg_leave = 0xAA;/* key to lock configuration space */
>  enum chips { w83627hf, w83627s, w83697hf, w83697ug, w83637hf, w83627thf,
>  	     w83687thf, w83627ehf, w83627dhg, w83627uhg, w83667hg, w83627dhg_p,
>  	     w83667hg_b, nct6775, nct6776, nct6779, nct6791, nct6792, nct6793,
> -	     nct6795, nct6796, nct6102 };
> +	     nct6795, nct6796, nct6102, nct6116 };
>  
>  static int timeout;			/* in seconds */
>  module_param(timeout, int, 0);
> @@ -94,6 +94,7 @@ MODULE_PARM_DESC(early_disable, "Disable watchdog at boot time (default=0)");
>  #define NCT6775_ID		0xb4
>  #define NCT6776_ID		0xc3
>  #define NCT6102_ID		0xc4
> +#define NCT6116_ID		0xd2
>  #define NCT6779_ID		0xc5
>  #define NCT6791_ID		0xc8
>  #define NCT6792_ID		0xc9
> @@ -211,6 +212,7 @@ static int w83627hf_init(struct watchdog_device *wdog, enum chips chip)
>  	case nct6795:
>  	case nct6796:
>  	case nct6102:
> +	case nct6116:
>  		/*
>  		 * These chips have a fixed WDTO# output pin (W83627UHG),
>  		 * or support more than one WDTO# output pin.
> @@ -417,6 +419,12 @@ static int wdt_find(int addr)
>  		cr_wdt_control = NCT6102D_WDT_CONTROL;
>  		cr_wdt_csr = NCT6102D_WDT_CSR;
>  		break;
> +	case NCT6116_ID:
> +		ret = nct6116;
> +		cr_wdt_timeout = NCT6102D_WDT_TIMEOUT;
> +		cr_wdt_control = NCT6102D_WDT_CONTROL;
> +		cr_wdt_csr = NCT6102D_WDT_CSR;
> +		break;
>  	case 0xff:
>  		ret = -ENODEV;
>  		break;
> @@ -482,6 +490,7 @@ static int __init wdt_init(void)
>  		"NCT6795",
>  		"NCT6796",
>  		"NCT6102",
> +		"NCT6116",
>  	};
>  
>  	/* Apply system-specific quirks */
> -- 
> 2.17.1
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, back to index

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-18 13:42 [PATCH] watchdog: w83627hf_wdt: Support NCT6116D Srikanth_Krishnakar
2019-09-18 14:57 ` Guenter Roeck
2019-09-18 16:04   ` [PATCH v2] " Srikanth Krishnakar
2019-09-18 20:15     ` Guenter Roeck

Linux-Watchdog Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-watchdog/0 linux-watchdog/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-watchdog linux-watchdog/ https://lore.kernel.org/linux-watchdog \
		linux-watchdog@vger.kernel.org linux-watchdog@archiver.kernel.org
	public-inbox-index linux-watchdog

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-watchdog


AGPL code for this site: git clone https://public-inbox.org/ public-inbox