All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Paul Louvel" <paul.louvel@bootlin.com>
To: "Guenter Roeck" <linux@roeck-us.net>,
	"Paul Louvel" <paul.louvel@bootlin.com>,
	"Wim Van Sebroeck" <wim@linux-watchdog.org>
Cc: <linux-watchdog@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	"Thomas Petazzoni" <thomas.petazzoni@bootlin.com>
Subject: Re: [PATCH v3 1/2] watchdog: w83627hf_wdt: Add support for Nuvoton NCT6126
Date: Mon, 06 Jul 2026 17:37:11 +0200	[thread overview]
Message-ID: <DJRLLTA2T6NG.2WD00RJ8IECW9@bootlin.com> (raw)
In-Reply-To: <22a92049-0ff2-4ebf-b286-1e1e7ae9b3cb@roeck-us.net>

On Mon Jul 6, 2026 at 4:14 PM CEST, Guenter Roeck wrote:
> On 7/6/26 03:29, Paul Louvel wrote:
>> Add support for the hardware watchdog integrated in the Nuvoton NCT6126
>> Super I/O chip. This device is used on a number of x86 single-board
>> computers and is compatible with the w83627hf_wdt driver.
>> 
>> Unlike most supported chips, the NCT6126 shares the same high-byte chip
>> ID as the NCT6116. Read the low byte of the chip ID as well to
>> distinguish between the two devices and identify the NCT6126 correctly.
>> 
>
> Doesn't that (and the code below) mean that the driver already supports
> the chip, only it identifies it as NCT6116 instead of NCT6126 ?

Yes, because they have the same high-byte chip ID.

>
> This means that the commit message is misleading: It should say that
> the chip is already supported but misidentified, and that the added
> code helps to correctly identify the chip.

Indeed. My bad !

>
> Guenter
>
>> Signed-off-by: Paul Louvel <paul.louvel@bootlin.com>
>> ---
>>   drivers/watchdog/w83627hf_wdt.c | 15 ++++++++++++---
>>   1 file changed, 12 insertions(+), 3 deletions(-)
>> 
>> diff --git a/drivers/watchdog/w83627hf_wdt.c b/drivers/watchdog/w83627hf_wdt.c
>> index bc33b63c5a5d..a6dfa9d01702 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, nct6116 };
>> +	     nct6795, nct6796, nct6102, nct6116, nct6126 };
>>   
>>   static int timeout;			/* in seconds */
>>   module_param(timeout, int, 0);
>> @@ -94,7 +94,9 @@ 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 NCT6116_ID		0xd2	/* also NCT6126D */
>> +#define NCT6126_VER_A_LOW_ID	0x83	/* ... version A */
>> +#define NCT6126_VER_B_LOW_ID	0x84	/* ... version B */
>>   #define NCT6779_ID		0xc5
>>   #define NCT6791_ID		0xc8
>>   #define NCT6792_ID		0xc9
>> @@ -217,6 +219,7 @@ static int w83627hf_init(struct watchdog_device *wdog, enum chips chip)
>>   	case nct6796:
>>   	case nct6102:
>>   	case nct6116:
>> +	case nct6126:
>>   		/*
>>   		 * These chips have a fixed WDTO# output pin (W83627UHG),
>>   		 * or support more than one WDTO# output pin.
>> @@ -428,7 +431,12 @@ static int wdt_find(int addr)
>>   		cr_wdt_csr = NCT6102D_WDT_CSR;
>>   		break;
>>   	case NCT6116_ID:
>> -		ret = nct6116;
>> +		val = superio_inb(0x21);
>> +		if (val == NCT6126_VER_A_LOW_ID || val == NCT6126_VER_B_LOW_ID)
>> +			ret = nct6126;
>> +		else
>> +			ret = nct6116;
>> +
>>   		cr_wdt_timeout = NCT6102D_WDT_TIMEOUT;
>>   		cr_wdt_control = NCT6102D_WDT_CONTROL;
>>   		cr_wdt_csr = NCT6102D_WDT_CSR;
>> @@ -499,6 +507,7 @@ static int __init wdt_init(void)
>>   		"NCT6796",
>>   		"NCT6102",
>>   		"NCT6116",
>> +		"NCT6126"
>>   	};
>>   
>>   	/* Apply system-specific quirks */
>> 

Paul.




-- 
Paul Louvel, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com


  reply	other threads:[~2026-07-06 15:37 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-06 10:29 [PATCH v3 0/2] watchdog: w83627hf_wdt: Add NCT6126 support and improve handling of running watchdog Paul Louvel
2026-07-06 10:29 ` [PATCH v3 1/2] watchdog: w83627hf_wdt: Add support for Nuvoton NCT6126 Paul Louvel
2026-07-06 14:14   ` Guenter Roeck
2026-07-06 15:37     ` Paul Louvel [this message]
2026-07-06 10:29 ` [PATCH v3 2/2] watchdog: w83627hf_wdt: Use WDOG_HW_RUNNING for running chip on boot Paul Louvel
2026-07-06 10:40   ` sashiko-bot
2026-07-06 11:15     ` Paul Louvel
2026-07-06 14:22       ` Guenter Roeck
2026-07-06 15:44         ` Paul Louvel
2026-07-06 16:12           ` Guenter Roeck
2026-07-06 21:42             ` Paul Louvel
2026-07-06 21:48               ` Guenter Roeck
2026-07-07  7:47                 ` Paul Louvel
2026-07-07 13:28                   ` Guenter Roeck
2026-07-07 13:33                     ` Paul Louvel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DJRLLTA2T6NG.2WD00RJ8IECW9@bootlin.com \
    --to=paul.louvel@bootlin.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=thomas.petazzoni@bootlin.com \
    --cc=wim@linux-watchdog.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.