Linux Hardware Monitor development
 help / color / mirror / Atom feed
* [PATCH] hwmon: (nct6683) Support NCT6687D.
@ 2020-12-01 19:09 David Bartley
  2020-12-01 22:16 ` Guenter Roeck
  0 siblings, 1 reply; 2+ messages in thread
From: David Bartley @ 2020-12-01 19:09 UTC (permalink / raw)
  To: linux-hwmon; +Cc: David Bartley

This is found on many MSI motherboards.

Signed-off-by: David Bartley <andareed@gmail.com>
---
 Documentation/hwmon/nct6683.rst | 3 ++-
 drivers/hwmon/nct6683.c         | 7 +++++++
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/Documentation/hwmon/nct6683.rst b/Documentation/hwmon/nct6683.rst
index efbf7e9703ec..7ceab770ae4e 100644
--- a/Documentation/hwmon/nct6683.rst
+++ b/Documentation/hwmon/nct6683.rst
@@ -3,7 +3,7 @@ Kernel driver nct6683
 
 Supported chips:
 
-  * Nuvoton NCT6683D
+  * Nuvoton NCT6683D/NCT6687D
 
     Prefix: 'nct6683'
 
@@ -61,4 +61,5 @@ Board		Firmware version
 Intel DH87RL	NCT6683D EC firmware version 1.0 build 04/03/13
 Intel DH87MC	NCT6683D EC firmware version 1.0 build 04/03/13
 Intel DB85FL	NCT6683D EC firmware version 1.0 build 04/03/13
+MSI B550	N/A
 =============== ===============================================
diff --git a/drivers/hwmon/nct6683.c b/drivers/hwmon/nct6683.c
index 2d299149f4d2..53e8d0cb3231 100644
--- a/drivers/hwmon/nct6683.c
+++ b/drivers/hwmon/nct6683.c
@@ -63,6 +63,7 @@ static const char * const nct6683_chip_names[] = {
 
 #define SIO_NCT6681_ID		0xb270	/* for later */
 #define SIO_NCT6683_ID		0xc730
+#define SIO_NCT6687_ID		0xd590
 #define SIO_ID_MASK		0xFFF0
 
 static inline void
@@ -164,6 +165,7 @@ superio_exit(int ioreg)
 #define NCT6683_REG_CUSTOMER_ID		0x602
 #define NCT6683_CUSTOMER_ID_INTEL	0x805
 #define NCT6683_CUSTOMER_ID_MITAC	0xa0e
+#define NCT6683_CUSTOMER_ID_MSI		0x201
 
 #define NCT6683_REG_BUILD_YEAR		0x604
 #define NCT6683_REG_BUILD_MONTH		0x605
@@ -1218,6 +1220,8 @@ static int nct6683_probe(struct platform_device *pdev)
 		break;
 	case NCT6683_CUSTOMER_ID_MITAC:
 		break;
+	case NCT6683_CUSTOMER_ID_MSI:
+		break;
 	default:
 		if (!force)
 			return -ENODEV;
@@ -1352,6 +1356,9 @@ static int __init nct6683_find(int sioaddr, struct nct6683_sio_data *sio_data)
 	case SIO_NCT6683_ID:
 		sio_data->kind = nct6683;
 		break;
+	case SIO_NCT6687_ID:
+		sio_data->kind = nct6683;
+		break;
 	default:
 		if (val != 0xffff)
 			pr_debug("unsupported chip ID: 0x%04x\n", val);
-- 
2.27.0


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

* Re: [PATCH] hwmon: (nct6683) Support NCT6687D.
  2020-12-01 19:09 [PATCH] hwmon: (nct6683) Support NCT6687D David Bartley
@ 2020-12-01 22:16 ` Guenter Roeck
  0 siblings, 0 replies; 2+ messages in thread
From: Guenter Roeck @ 2020-12-01 22:16 UTC (permalink / raw)
  To: David Bartley; +Cc: linux-hwmon

On Tue, Dec 01, 2020 at 11:09:31AM -0800, David Bartley wrote:
> This is found on many MSI motherboards.
> 
> Signed-off-by: David Bartley <andareed@gmail.com>
> ---
>  Documentation/hwmon/nct6683.rst | 3 ++-
>  drivers/hwmon/nct6683.c         | 7 +++++++
>  2 files changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/Documentation/hwmon/nct6683.rst b/Documentation/hwmon/nct6683.rst
> index efbf7e9703ec..7ceab770ae4e 100644
> --- a/Documentation/hwmon/nct6683.rst
> +++ b/Documentation/hwmon/nct6683.rst
> @@ -3,7 +3,7 @@ Kernel driver nct6683
>  
>  Supported chips:
>  
> -  * Nuvoton NCT6683D
> +  * Nuvoton NCT6683D/NCT6687D
>  
>      Prefix: 'nct6683'
>  
> @@ -61,4 +61,5 @@ Board		Firmware version
>  Intel DH87RL	NCT6683D EC firmware version 1.0 build 04/03/13
>  Intel DH87MC	NCT6683D EC firmware version 1.0 build 04/03/13
>  Intel DB85FL	NCT6683D EC firmware version 1.0 build 04/03/13
> +MSI B550	N/A

		NCT6687D

>  =============== ===============================================
> diff --git a/drivers/hwmon/nct6683.c b/drivers/hwmon/nct6683.c
> index 2d299149f4d2..53e8d0cb3231 100644
> --- a/drivers/hwmon/nct6683.c
> +++ b/drivers/hwmon/nct6683.c
> @@ -63,6 +63,7 @@ static const char * const nct6683_chip_names[] = {
>  
>  #define SIO_NCT6681_ID		0xb270	/* for later */
>  #define SIO_NCT6683_ID		0xc730
> +#define SIO_NCT6687_ID		0xd590
>  #define SIO_ID_MASK		0xFFF0
>  
>  static inline void
> @@ -164,6 +165,7 @@ superio_exit(int ioreg)
>  #define NCT6683_REG_CUSTOMER_ID		0x602
>  #define NCT6683_CUSTOMER_ID_INTEL	0x805
>  #define NCT6683_CUSTOMER_ID_MITAC	0xa0e
> +#define NCT6683_CUSTOMER_ID_MSI		0x201
>  
>  #define NCT6683_REG_BUILD_YEAR		0x604
>  #define NCT6683_REG_BUILD_MONTH		0x605
> @@ -1218,6 +1220,8 @@ static int nct6683_probe(struct platform_device *pdev)
>  		break;
>  	case NCT6683_CUSTOMER_ID_MITAC:
>  		break;
> +	case NCT6683_CUSTOMER_ID_MSI:
> +		break;
>  	default:
>  		if (!force)
>  			return -ENODEV;
> @@ -1352,6 +1356,9 @@ static int __init nct6683_find(int sioaddr, struct nct6683_sio_data *sio_data)
>  	case SIO_NCT6683_ID:
>  		sio_data->kind = nct6683;
>  		break;
> +	case SIO_NCT6687_ID:
> +		sio_data->kind = nct6683;
> +		break;

There should be a separate kind (in enum kinds). Also, the description in
the header should be updated to indicate nct6687 and list the number of
supported sensors. nct6683_device_names[] and nct6683_chip_names[] should
also be updated.

>  	default:
>  		if (val != 0xffff)
>  			pr_debug("unsupported chip ID: 0x%04x\n", val);
> -- 
> 2.27.0
> 

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

end of thread, other threads:[~2020-12-01 22:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-12-01 19:09 [PATCH] hwmon: (nct6683) Support NCT6687D David Bartley
2020-12-01 22:16 ` Guenter Roeck

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox