[v4,2/2] hwmon: (nct6775) B650/B660/X670 ASUS boards support

Message ID 20230111212241.7456-2-pauk.denis@gmail.com
State New
Headers
Series [v4,1/2] hwmon: (nct6775) Directly call ASUS ACPI WMI method |

Commit Message

Denis Pauk Jan. 11, 2023, 9:22 p.m. UTC
  Boards such as:
  "EX-B660M-V5 PRO D4",
  "PRIME B650-PLUS",
  "PRIME B650M-A",
  "PRIME B650M-A AX",
  "PRIME B650M-A II",
  "PRIME B650M-A WIFI",
  "PRIME B650M-A WIFI II",
  "PRIME B660M-A D4",
  "PRIME B660M-A WIFI D4",
  "PRIME X670-P",
  "PRIME X670-P WIFI",
  "PRIME X670E-PRO WIFI",
  "Pro B660M-C-D4",
  "ProArt B660-CREATOR D4",
  "ProArt X670E-CREATOR WIFI",
  "ROG CROSSHAIR X670E EXTREME",
  "ROG CROSSHAIR X670E GENE",
  "ROG CROSSHAIR X670E HERO",
  "ROG MAXIMUS XIII EXTREME GLACIAL",
  "ROG MAXIMUS Z690 EXTREME",
  "ROG MAXIMUS Z690 EXTREME GLACIAL",
  "ROG STRIX B650-A GAMING WIFI",
  "ROG STRIX B650E-E GAMING WIFI",
  "ROG STRIX B650E-F GAMING WIFI",
  "ROG STRIX B650E-I GAMING WIFI",
  "ROG STRIX B660-A GAMING WIFI D4",
  "ROG STRIX B660-F GAMING WIFI",
  "ROG STRIX B660-G GAMING WIFI",
  "ROG STRIX B660-I GAMING WIFI",
  "ROG STRIX X670E-A GAMING WIFI",
  "ROG STRIX X670E-E GAMING WIFI",
  "ROG STRIX X670E-F GAMING WIFI",
  "ROG STRIX X670E-I GAMING WIFI",
  "ROG STRIX Z590-A GAMING WIFI II",
  "ROG STRIX Z690-A GAMING WIFI D4",
  "TUF GAMING B650-PLUS",
  "TUF GAMING B650-PLUS WIFI",
  "TUF GAMING B650M-PLUS",
  "TUF GAMING B650M-PLUS WIFI",
  "TUF GAMING B660M-PLUS WIFI",
  "TUF GAMING X670E-PLUS",
  "TUF GAMING X670E-PLUS WIFI",
  "TUF GAMING Z590-PLUS WIFI",
have got a NCT6799D chip, but by default there's no use of it
because of resource conflict with WMI method.

This commit adds such boards to the monitoring list with new ACPI device
UID.

BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=204807
Signed-off-by: Denis Pauk <pauk.denis@gmail.com>
Co-developed-by: Ahmad Khalifa <ahmad@khalifa.ws>
Signed-off-by: Ahmad Khalifa <ahmad@khalifa.ws>
Tested-by: Jeroen Beerstra <jeroen@beerstra.org>
Tested-by: Slawomir Stepien <sst@poczta.fm>
---
Changes:
v2: no changes
v3: no changes
v4: no changes

 drivers/hwmon/nct6775-platform.c | 52 ++++++++++++++++++++++++++++++++
 1 file changed, 52 insertions(+)
  

Comments

Sebastian Arnhold Jan. 20, 2023, 7:50 p.m. UTC | #1
Is it just me, or is the support for my mainboard "TUF GAMING X670E-PLUS 
WIFI" now implemented into the latest "linux-next" kernel (I verified 
this by looking at the source code at /drivers/hwmon/nct6775-core.c), 
but the actual patch that contains the NCT6799D driver is still missing?

I had to patch my linux-next kernel with the patch from 
https://patchwork.kernel.org/project/linux-hwmon/patch/20221228135744.281752-1-linux@roeck-us.net/ 
to get it working.

Otherwise the nct6775 module refuses to recognize my sensor chip.

Thanks,
Sebastian

Am 15.01.23 um 17:12 schrieb Guenter Roeck:
> On Wed, Jan 11, 2023 at 11:22:41PM +0200, Denis Pauk wrote:
>> Boards such as:
>>    "EX-B660M-V5 PRO D4",
>>    "PRIME B650-PLUS",
>>    "PRIME B650M-A",
>>    "PRIME B650M-A AX",
>>    "PRIME B650M-A II",
>>    "PRIME B650M-A WIFI",
>>    "PRIME B650M-A WIFI II",
>>    "PRIME B660M-A D4",
>>    "PRIME B660M-A WIFI D4",
>>    "PRIME X670-P",
>>    "PRIME X670-P WIFI",
>>    "PRIME X670E-PRO WIFI",
>>    "Pro B660M-C-D4",
>>    "ProArt B660-CREATOR D4",
>>    "ProArt X670E-CREATOR WIFI",
>>    "ROG CROSSHAIR X670E EXTREME",
>>    "ROG CROSSHAIR X670E GENE",
>>    "ROG CROSSHAIR X670E HERO",
>>    "ROG MAXIMUS XIII EXTREME GLACIAL",
>>    "ROG MAXIMUS Z690 EXTREME",
>>    "ROG MAXIMUS Z690 EXTREME GLACIAL",
>>    "ROG STRIX B650-A GAMING WIFI",
>>    "ROG STRIX B650E-E GAMING WIFI",
>>    "ROG STRIX B650E-F GAMING WIFI",
>>    "ROG STRIX B650E-I GAMING WIFI",
>>    "ROG STRIX B660-A GAMING WIFI D4",
>>    "ROG STRIX B660-F GAMING WIFI",
>>    "ROG STRIX B660-G GAMING WIFI",
>>    "ROG STRIX B660-I GAMING WIFI",
>>    "ROG STRIX X670E-A GAMING WIFI",
>>    "ROG STRIX X670E-E GAMING WIFI",
>>    "ROG STRIX X670E-F GAMING WIFI",
>>    "ROG STRIX X670E-I GAMING WIFI",
>>    "ROG STRIX Z590-A GAMING WIFI II",
>>    "ROG STRIX Z690-A GAMING WIFI D4",
>>    "TUF GAMING B650-PLUS",
>>    "TUF GAMING B650-PLUS WIFI",
>>    "TUF GAMING B650M-PLUS",
>>    "TUF GAMING B650M-PLUS WIFI",
>>    "TUF GAMING B660M-PLUS WIFI",
>>    "TUF GAMING X670E-PLUS",
>>    "TUF GAMING X670E-PLUS WIFI",
>>    "TUF GAMING Z590-PLUS WIFI",
>> have got a NCT6799D chip, but by default there's no use of it
>> because of resource conflict with WMI method.
>>
>> This commit adds such boards to the monitoring list with new ACPI device
>> UID.
>>
>> BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=204807
>> Signed-off-by: Denis Pauk <pauk.denis@gmail.com>
>> Co-developed-by: Ahmad Khalifa <ahmad@khalifa.ws>
>> Signed-off-by: Ahmad Khalifa <ahmad@khalifa.ws>
>> Tested-by: Jeroen Beerstra <jeroen@beerstra.org>
>> Tested-by: Slawomir Stepien <sst@poczta.fm>
> Applied to hwmon-next.
>
> Thanks,
> Guenter
  
Guenter Roeck Jan. 20, 2023, 8:28 p.m. UTC | #2
On 1/20/23 11:50, Sebastian Arnhold wrote:
> Is it just me, or is the support for my mainboard "TUF GAMING X670E-PLUS WIFI" now implemented into the latest "linux-next" kernel (I verified this by looking at the source code at /drivers/hwmon/nct6775-core.c), but the actual patch that contains the NCT6799D driver is still missing?
> 
> I had to patch my linux-next kernel with the patch from https://patchwork.kernel.org/project/linux-hwmon/patch/20221228135744.281752-1-linux@roeck-us.net/ to get it working.
> 

Well, yes, I do have day-to-day work that I am getting paid for,
and I did not have time to resubmit the patch adding support for
NCT6799.

Guenter
  
Sebastian Arnhold Jan. 20, 2023, 8:32 p.m. UTC | #3
Sorry, I didn't want to annoy you! Just wondered why it didn't work and 
whether I made a mistake, or if it really wasn't included in linux-next.

Thanks for all your amazing work in making this chip function properly 
and bringing fan control to many of the latest AM5 boards! :)

Kind regards,
Sebastian

Am 20.01.23 um 21:28 schrieb Guenter Roeck:
> On 1/20/23 11:50, Sebastian Arnhold wrote:
>> Is it just me, or is the support for my mainboard "TUF GAMING 
>> X670E-PLUS WIFI" now implemented into the latest "linux-next" kernel 
>> (I verified this by looking at the source code at 
>> /drivers/hwmon/nct6775-core.c), but the actual patch that contains 
>> the NCT6799D driver is still missing?
>>
>> I had to patch my linux-next kernel with the patch from 
>> https://patchwork.kernel.org/project/linux-hwmon/patch/20221228135744.281752-1-linux@roeck-us.net/ 
>> to get it working.
>>
>
> Well, yes, I do have day-to-day work that I am getting paid for,
> and I did not have time to resubmit the patch adding support for
> NCT6799.
>
> Guenter
>
  

Patch

diff --git a/drivers/hwmon/nct6775-platform.c b/drivers/hwmon/nct6775-platform.c
index e3c3b35c8138..baac0d569a4d 100644
--- a/drivers/hwmon/nct6775-platform.c
+++ b/drivers/hwmon/nct6775-platform.c
@@ -114,6 +114,7 @@  struct nct6775_sio_data {
 #define ASUSWMI_UNSUPPORTED_METHOD	0xFFFFFFFE
 #define ASUSWMI_DEVICE_HID		"PNP0C14"
 #define ASUSWMI_DEVICE_UID		"ASUSWMI"
+#define ASUSMSI_DEVICE_UID		"AsusMbSwInterface"
 
 #if IS_ENABLED(CONFIG_ACPI)
 /*
@@ -1108,6 +1109,52 @@  static const char * const asus_wmi_boards[] = {
 	"TUF GAMING Z490-PLUS (WI-FI)",
 };
 
+static const char * const asus_msi_boards[] = {
+	"EX-B660M-V5 PRO D4",
+	"PRIME B650-PLUS",
+	"PRIME B650M-A",
+	"PRIME B650M-A AX",
+	"PRIME B650M-A II",
+	"PRIME B650M-A WIFI",
+	"PRIME B650M-A WIFI II",
+	"PRIME B660M-A D4",
+	"PRIME B660M-A WIFI D4",
+	"PRIME X670-P",
+	"PRIME X670-P WIFI",
+	"PRIME X670E-PRO WIFI",
+	"Pro B660M-C-D4",
+	"ProArt B660-CREATOR D4",
+	"ProArt X670E-CREATOR WIFI",
+	"ROG CROSSHAIR X670E EXTREME",
+	"ROG CROSSHAIR X670E GENE",
+	"ROG CROSSHAIR X670E HERO",
+	"ROG MAXIMUS XIII EXTREME GLACIAL",
+	"ROG MAXIMUS Z690 EXTREME",
+	"ROG MAXIMUS Z690 EXTREME GLACIAL",
+	"ROG STRIX B650-A GAMING WIFI",
+	"ROG STRIX B650E-E GAMING WIFI",
+	"ROG STRIX B650E-F GAMING WIFI",
+	"ROG STRIX B650E-I GAMING WIFI",
+	"ROG STRIX B660-A GAMING WIFI D4",
+	"ROG STRIX B660-F GAMING WIFI",
+	"ROG STRIX B660-G GAMING WIFI",
+	"ROG STRIX B660-I GAMING WIFI",
+	"ROG STRIX X670E-A GAMING WIFI",
+	"ROG STRIX X670E-E GAMING WIFI",
+	"ROG STRIX X670E-F GAMING WIFI",
+	"ROG STRIX X670E-I GAMING WIFI",
+	"ROG STRIX Z590-A GAMING WIFI II",
+	"ROG STRIX Z690-A GAMING WIFI D4",
+	"TUF GAMING B650-PLUS",
+	"TUF GAMING B650-PLUS WIFI",
+	"TUF GAMING B650M-PLUS",
+	"TUF GAMING B650M-PLUS WIFI",
+	"TUF GAMING B660M-PLUS WIFI",
+	"TUF GAMING X670E-PLUS",
+	"TUF GAMING X670E-PLUS WIFI",
+	"TUF GAMING Z590-PLUS WIFI",
+};
+
 #if IS_ENABLED(CONFIG_ACPI)
 /*
  * Callback for acpi_bus_for_each_dev() to find the right device
@@ -1172,6 +1219,11 @@  static int __init sensors_nct6775_platform_init(void)
 				   board_name);
 		if (err >= 0)
 			access = nct6775_determine_access(ASUSWMI_DEVICE_UID);
+
+		err = match_string(asus_msi_boards, ARRAY_SIZE(asus_msi_boards),
+				   board_name);
+		if (err >= 0)
+			access = nct6775_determine_access(ASUSMSI_DEVICE_UID);
 	}
 
 	/*