--- /dev/null
+From c3c4848db8a9edfd44c89f93d9208a1355ec81d3 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Sun, 10 Jul 2022 22:26:39 +0200
+Subject: hwmon: (asus-ec-sensors) add definitions for ROG ZENITH II EXTREME
+
+From: Urs Schroffenegger <nabajour@lampshade.ch>
+
+[ Upstream commit 9992b19d756ab8f0889fcaf3e71ff93852e74694 ]
+
+Add definitions for ROG ZENITH II EXTREME and some unknown yet
+temperature sensors in the second EC bank. Details are available at
+[1, 2].
+
+[1] https://github.com/zeule/asus-ec-sensors/pull/26
+[2] https://github.com/zeule/asus-ec-sensors/issues/16
+
+Signed-off-by: Urs Schroffenegger <nabajour@lampshade.ch>
+Signed-off-by: Eugene Shalygin <eugene.shalygin@gmail.com>
+Link: https://lore.kernel.org/r/20220710202639.1812058-2-eugene.shalygin@gmail.com
+Signed-off-by: Guenter Roeck <linux@roeck-us.net>
+Stable-dep-of: 88700d1396ba ("hwmon: (asus-ec-sensors) autoload module via DMI data")
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ Documentation/hwmon/asus_ec_sensors.rst | 1 +
+ drivers/hwmon/asus-ec-sensors.c | 47 +++++++++++++++++++++++++
+ 2 files changed, 48 insertions(+)
+
+diff --git a/Documentation/hwmon/asus_ec_sensors.rst b/Documentation/hwmon/asus_ec_sensors.rst
+index 1e40c123db777..02f4ad314a1eb 100644
+--- a/Documentation/hwmon/asus_ec_sensors.rst
++++ b/Documentation/hwmon/asus_ec_sensors.rst
+@@ -22,6 +22,7 @@ Supported boards:
+ * ROG STRIX X570-F GAMING
+ * ROG STRIX X570-I GAMING
+ * ROG STRIX Z690-A GAMING WIFI D4
++ * ROG ZENITH II EXTREME
+
+ Authors:
+ - Eugene Shalygin <eugene.shalygin@gmail.com>
+diff --git a/drivers/hwmon/asus-ec-sensors.c b/drivers/hwmon/asus-ec-sensors.c
+index 0749cd023a323..61a4684fc020e 100644
+--- a/drivers/hwmon/asus-ec-sensors.c
++++ b/drivers/hwmon/asus-ec-sensors.c
+@@ -56,6 +56,8 @@ static char *mutex_path_override;
+
+ #define ASUS_HW_ACCESS_MUTEX_RMTW_ASMX "\\RMTW.ASMX"
+
++#define ASUS_HW_ACCESS_MUTEX_SB_PCI0_SBRG_SIO1_MUT0 "\\_SB_.PCI0.SBRG.SIO1.MUT0"
++
+ #define MAX_IDENTICAL_BOARD_VARIATIONS 3
+
+ /* Moniker for the ACPI global lock (':' is not allowed in ASL identifiers) */
+@@ -121,6 +123,18 @@ enum ec_sensors {
+ ec_sensor_temp_water_in,
+ /* "Water_Out" temperature sensor reading [℃] */
+ ec_sensor_temp_water_out,
++ /* "Water_Block_In" temperature sensor reading [℃] */
++ ec_sensor_temp_water_block_in,
++ /* "Water_Block_Out" temperature sensor reading [℃] */
++ ec_sensor_temp_water_block_out,
++ /* "T_sensor_2" temperature sensor reading [℃] */
++ ec_sensor_temp_t_sensor_2,
++ /* "Extra_1" temperature sensor reading [℃] */
++ ec_sensor_temp_sensor_extra_1,
++ /* "Extra_2" temperature sensor reading [℃] */
++ ec_sensor_temp_sensor_extra_2,
++ /* "Extra_3" temperature sensor reading [℃] */
++ ec_sensor_temp_sensor_extra_3,
+ };
+
+ #define SENSOR_TEMP_CHIPSET BIT(ec_sensor_temp_chipset)
+@@ -136,6 +150,12 @@ enum ec_sensors {
+ #define SENSOR_CURR_CPU BIT(ec_sensor_curr_cpu)
+ #define SENSOR_TEMP_WATER_IN BIT(ec_sensor_temp_water_in)
+ #define SENSOR_TEMP_WATER_OUT BIT(ec_sensor_temp_water_out)
++#define SENSOR_TEMP_WATER_BLOCK_IN BIT(ec_sensor_temp_water_block_in)
++#define SENSOR_TEMP_WATER_BLOCK_OUT BIT(ec_sensor_temp_water_block_out)
++#define SENSOR_TEMP_T_SENSOR_2 BIT(ec_sensor_temp_t_sensor_2)
++#define SENSOR_TEMP_SENSOR_EXTRA_1 BIT(ec_sensor_temp_sensor_extra_1)
++#define SENSOR_TEMP_SENSOR_EXTRA_2 BIT(ec_sensor_temp_sensor_extra_2)
++#define SENSOR_TEMP_SENSOR_EXTRA_3 BIT(ec_sensor_temp_sensor_extra_3)
+
+ enum board_family {
+ family_unknown,
+@@ -199,6 +219,18 @@ static const struct ec_sensor_info sensors_family_amd_500[] = {
+ EC_SENSOR("Water_In", hwmon_temp, 1, 0x01, 0x00),
+ [ec_sensor_temp_water_out] =
+ EC_SENSOR("Water_Out", hwmon_temp, 1, 0x01, 0x01),
++ [ec_sensor_temp_water_block_in] =
++ EC_SENSOR("Water_Block_In", hwmon_temp, 1, 0x01, 0x02),
++ [ec_sensor_temp_water_block_out] =
++ EC_SENSOR("Water_Block_Out", hwmon_temp, 1, 0x01, 0x03),
++ [ec_sensor_temp_sensor_extra_1] =
++ EC_SENSOR("Extra_1", hwmon_temp, 1, 0x01, 0x09),
++ [ec_sensor_temp_t_sensor_2] =
++ EC_SENSOR("T_sensor_2", hwmon_temp, 1, 0x01, 0x0a),
++ [ec_sensor_temp_sensor_extra_2] =
++ EC_SENSOR("Extra_2", hwmon_temp, 1, 0x01, 0x0b),
++ [ec_sensor_temp_sensor_extra_3] =
++ EC_SENSOR("Extra_3", hwmon_temp, 1, 0x01, 0x0c),
+ };
+
+ static const struct ec_sensor_info sensors_family_intel_300[] = {
+@@ -231,6 +263,9 @@ static const struct ec_sensor_info sensors_family_intel_600[] = {
+ #define SENSOR_SET_TEMP_CHIPSET_CPU_MB \
+ (SENSOR_TEMP_CHIPSET | SENSOR_TEMP_CPU | SENSOR_TEMP_MB)
+ #define SENSOR_SET_TEMP_WATER (SENSOR_TEMP_WATER_IN | SENSOR_TEMP_WATER_OUT)
++#define SENSOR_SET_WATER_BLOCK \
++ (SENSOR_TEMP_WATER_BLOCK_IN | SENSOR_TEMP_WATER_BLOCK_OUT)
++
+
+ struct ec_board_info {
+ const char *board_names[MAX_IDENTICAL_BOARD_VARIATIONS];
+@@ -379,6 +414,18 @@ static const struct ec_board_info board_info[] = {
+ .mutex_path = ASUS_HW_ACCESS_MUTEX_RMTW_ASMX,
+ .family = family_intel_600_series,
+ },
++ {
++ .board_names = {"ROG ZENITH II EXTREME"},
++ .sensors = SENSOR_SET_TEMP_CHIPSET_CPU_MB | SENSOR_TEMP_T_SENSOR |
++ SENSOR_TEMP_VRM | SENSOR_SET_TEMP_WATER |
++ SENSOR_FAN_CPU_OPT | SENSOR_FAN_CHIPSET | SENSOR_FAN_VRM_HS |
++ SENSOR_FAN_WATER_FLOW | SENSOR_CURR_CPU | SENSOR_IN_CPU_CORE |
++ SENSOR_SET_WATER_BLOCK |
++ SENSOR_TEMP_T_SENSOR_2 | SENSOR_TEMP_SENSOR_EXTRA_1 |
++ SENSOR_TEMP_SENSOR_EXTRA_2 | SENSOR_TEMP_SENSOR_EXTRA_3,
++ .mutex_path = ASUS_HW_ACCESS_MUTEX_SB_PCI0_SBRG_SIO1_MUT0,
++ .family = family_amd_500_series,
++ },
+ {}
+ };
+
+--
+2.35.1
+
--- /dev/null
+From cc120b029c8c5ff6e70347f82764f06e3975880e Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Tue, 28 Jun 2022 00:54:36 +0200
+Subject: hwmon: (asus-ec-sensors) add support for Maximus XI Hero
+
+From: Michael Carns <mike@carns.com>
+
+[ Upstream commit 8f9eb10ff71d8e3beeee3f8d19050223600faf85 ]
+
+Add definitions for ROG MAXIMUS XI HERO and ROG MAXIMUS XI HERO (WI-FI)
+boards.
+
+Signed-off-by: Michael Carns <mike@carns.com>
+Signed-off-by: Eugene Shalygin <eugene.shalygin@gmail.com>
+Link: https://lore.kernel.org/r/20220627225437.87462-1-eugene.shalygin@gmail.com
+Signed-off-by: Guenter Roeck <linux@roeck-us.net>
+Stable-dep-of: 88700d1396ba ("hwmon: (asus-ec-sensors) autoload module via DMI data")
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ Documentation/hwmon/asus_ec_sensors.rst | 2 ++
+ drivers/hwmon/asus-ec-sensors.c | 36 +++++++++++++++++++++++++
+ 2 files changed, 38 insertions(+)
+
+diff --git a/Documentation/hwmon/asus_ec_sensors.rst b/Documentation/hwmon/asus_ec_sensors.rst
+index 00d8c46ef9e04..1e40c123db777 100644
+--- a/Documentation/hwmon/asus_ec_sensors.rst
++++ b/Documentation/hwmon/asus_ec_sensors.rst
+@@ -13,6 +13,8 @@ Supported boards:
+ * ROG CROSSHAIR VIII FORMULA
+ * ROG CROSSHAIR VIII HERO
+ * ROG CROSSHAIR VIII IMPACT
++ * ROG MAXIMUS XI HERO
++ * ROG MAXIMUS XI HERO (WI-FI)
+ * ROG STRIX B550-E GAMING
+ * ROG STRIX B550-I GAMING
+ * ROG STRIX X570-E GAMING
+diff --git a/drivers/hwmon/asus-ec-sensors.c b/drivers/hwmon/asus-ec-sensors.c
+index 19d3ca71b3609..625c2baa35ec6 100644
+--- a/drivers/hwmon/asus-ec-sensors.c
++++ b/drivers/hwmon/asus-ec-sensors.c
+@@ -141,6 +141,7 @@ enum board_family {
+ family_unknown,
+ family_amd_400_series,
+ family_amd_500_series,
++ family_intel_300_series,
+ family_intel_600_series
+ };
+
+@@ -200,6 +201,26 @@ static const struct ec_sensor_info sensors_family_amd_500[] = {
+ EC_SENSOR("Water_Out", hwmon_temp, 1, 0x01, 0x01),
+ };
+
++static const struct ec_sensor_info sensors_family_intel_300[] = {
++ [ec_sensor_temp_chipset] =
++ EC_SENSOR("Chipset", hwmon_temp, 1, 0x00, 0x3a),
++ [ec_sensor_temp_cpu] = EC_SENSOR("CPU", hwmon_temp, 1, 0x00, 0x3b),
++ [ec_sensor_temp_mb] =
++ EC_SENSOR("Motherboard", hwmon_temp, 1, 0x00, 0x3c),
++ [ec_sensor_temp_t_sensor] =
++ EC_SENSOR("T_Sensor", hwmon_temp, 1, 0x00, 0x3d),
++ [ec_sensor_temp_vrm] = EC_SENSOR("VRM", hwmon_temp, 1, 0x00, 0x3e),
++ [ec_sensor_fan_cpu_opt] =
++ EC_SENSOR("CPU_Opt", hwmon_fan, 2, 0x00, 0xb0),
++ [ec_sensor_fan_vrm_hs] = EC_SENSOR("VRM HS", hwmon_fan, 2, 0x00, 0xb2),
++ [ec_sensor_fan_water_flow] =
++ EC_SENSOR("Water_Flow", hwmon_fan, 2, 0x00, 0xbc),
++ [ec_sensor_temp_water_in] =
++ EC_SENSOR("Water_In", hwmon_temp, 1, 0x01, 0x00),
++ [ec_sensor_temp_water_out] =
++ EC_SENSOR("Water_Out", hwmon_temp, 1, 0x01, 0x01),
++};
++
+ static const struct ec_sensor_info sensors_family_intel_600[] = {
+ [ec_sensor_temp_t_sensor] =
+ EC_SENSOR("T_Sensor", hwmon_temp, 1, 0x00, 0x3d),
+@@ -281,6 +302,18 @@ static const struct ec_board_info board_info[] = {
+ .mutex_path = ASUS_HW_ACCESS_MUTEX_ASMX,
+ .family = family_amd_500_series,
+ },
++ {
++ .board_names = {
++ "ROG MAXIMUS XI HERO",
++ "ROG MAXIMUS XI HERO (WI-FI)",
++ },
++ .sensors = SENSOR_SET_TEMP_CHIPSET_CPU_MB |
++ SENSOR_TEMP_T_SENSOR |
++ SENSOR_TEMP_VRM | SENSOR_SET_TEMP_WATER |
++ SENSOR_FAN_CPU_OPT | SENSOR_FAN_WATER_FLOW,
++ .mutex_path = ASUS_HW_ACCESS_MUTEX_ASMX,
++ .family = family_intel_300_series,
++ },
+ {
+ .board_names = {"ROG CROSSHAIR VIII IMPACT"},
+ .sensors = SENSOR_SET_TEMP_CHIPSET_CPU_MB |
+@@ -814,6 +847,9 @@ static int __init asus_ec_probe(struct platform_device *pdev)
+ case family_amd_500_series:
+ ec_data->sensors_info = sensors_family_amd_500;
+ break;
++ case family_intel_300_series:
++ ec_data->sensors_info = sensors_family_intel_300;
++ break;
+ case family_intel_600_series:
+ ec_data->sensors_info = sensors_family_intel_600;
+ break;
+--
+2.35.1
+
--- /dev/null
+From 9f6f2a6c19c4e2a09d3fdf8e0bd06960fd18efd4 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Fri, 9 Sep 2022 17:56:53 +0200
+Subject: hwmon: (asus-ec-sensors) autoload module via DMI data
+
+From: Eugene Shalygin <eugene.shalygin@gmail.com>
+
+[ Upstream commit 88700d1396bae72d9a4c23a48bbd98c1c2f53f3d ]
+
+Replace autoloading data based on the ACPI EC device with the DMI
+records for motherboards models. The ACPI method created a bug that when
+this driver returns error from the probe function because of the
+unsupported motherboard model, the ACPI subsystem concludes
+that the EC device does not work properly.
+
+Fixes: 5cd29012028d ("hwmon: (asus-ec-sensors) introduce ec_board_info struct for board data")
+Bug: https://bugzilla.kernel.org/show_bug.cgi?id=216412
+Bug: https://bugzilla.redhat.com/show_bug.cgi?id=2121844
+Signed-off-by: Eugene Shalygin <eugene.shalygin@gmail.com>
+Link: https://lore.kernel.org/r/20220909155654.123398-2-eugene.shalygin@gmail.com
+Cc: stable@vger.kernel.org
+Signed-off-by: Guenter Roeck <linux@roeck-us.net>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/hwmon/asus-ec-sensors.c | 408 +++++++++++++++++---------------
+ 1 file changed, 222 insertions(+), 186 deletions(-)
+
+diff --git a/drivers/hwmon/asus-ec-sensors.c b/drivers/hwmon/asus-ec-sensors.c
+index 61a4684fc020e..81e688975c6a7 100644
+--- a/drivers/hwmon/asus-ec-sensors.c
++++ b/drivers/hwmon/asus-ec-sensors.c
+@@ -266,9 +266,7 @@ static const struct ec_sensor_info sensors_family_intel_600[] = {
+ #define SENSOR_SET_WATER_BLOCK \
+ (SENSOR_TEMP_WATER_BLOCK_IN | SENSOR_TEMP_WATER_BLOCK_OUT)
+
+-
+ struct ec_board_info {
+- const char *board_names[MAX_IDENTICAL_BOARD_VARIATIONS];
+ unsigned long sensors;
+ /*
+ * Defines which mutex to use for guarding access to the state and the
+@@ -281,152 +279,194 @@ struct ec_board_info {
+ enum board_family family;
+ };
+
+-static const struct ec_board_info board_info[] = {
+- {
+- .board_names = {"PRIME X470-PRO"},
+- .sensors = SENSOR_SET_TEMP_CHIPSET_CPU_MB |
+- SENSOR_TEMP_T_SENSOR | SENSOR_TEMP_VRM |
+- SENSOR_FAN_CPU_OPT |
+- SENSOR_CURR_CPU | SENSOR_IN_CPU_CORE,
+- .mutex_path = ACPI_GLOBAL_LOCK_PSEUDO_PATH,
+- .family = family_amd_400_series,
+- },
+- {
+- .board_names = {"PRIME X570-PRO"},
+- .sensors = SENSOR_SET_TEMP_CHIPSET_CPU_MB | SENSOR_TEMP_VRM |
+- SENSOR_TEMP_T_SENSOR | SENSOR_FAN_CHIPSET,
+- .mutex_path = ASUS_HW_ACCESS_MUTEX_ASMX,
+- .family = family_amd_500_series,
+- },
+- {
+- .board_names = {"ProArt X570-CREATOR WIFI"},
+- .sensors = SENSOR_SET_TEMP_CHIPSET_CPU_MB | SENSOR_TEMP_VRM |
+- SENSOR_TEMP_T_SENSOR | SENSOR_FAN_CPU_OPT |
+- SENSOR_CURR_CPU | SENSOR_IN_CPU_CORE,
+- },
+- {
+- .board_names = {"Pro WS X570-ACE"},
+- .sensors = SENSOR_SET_TEMP_CHIPSET_CPU_MB | SENSOR_TEMP_VRM |
+- SENSOR_TEMP_T_SENSOR | SENSOR_FAN_CHIPSET |
+- SENSOR_CURR_CPU | SENSOR_IN_CPU_CORE,
+- .mutex_path = ASUS_HW_ACCESS_MUTEX_ASMX,
+- .family = family_amd_500_series,
+- },
+- {
+- .board_names = {"ROG CROSSHAIR VIII DARK HERO"},
+- .sensors = SENSOR_SET_TEMP_CHIPSET_CPU_MB |
+- SENSOR_TEMP_T_SENSOR |
+- SENSOR_TEMP_VRM | SENSOR_SET_TEMP_WATER |
+- SENSOR_FAN_CPU_OPT | SENSOR_FAN_WATER_FLOW |
+- SENSOR_CURR_CPU | SENSOR_IN_CPU_CORE,
+- .mutex_path = ASUS_HW_ACCESS_MUTEX_ASMX,
+- .family = family_amd_500_series,
+- },
+- {
+- .board_names = {
+- "ROG CROSSHAIR VIII FORMULA",
+- "ROG CROSSHAIR VIII HERO",
+- "ROG CROSSHAIR VIII HERO (WI-FI)",
+- },
+- .sensors = SENSOR_SET_TEMP_CHIPSET_CPU_MB |
+- SENSOR_TEMP_T_SENSOR |
+- SENSOR_TEMP_VRM | SENSOR_SET_TEMP_WATER |
+- SENSOR_FAN_CPU_OPT | SENSOR_FAN_CHIPSET |
+- SENSOR_FAN_WATER_FLOW | SENSOR_CURR_CPU |
+- SENSOR_IN_CPU_CORE,
+- .mutex_path = ASUS_HW_ACCESS_MUTEX_ASMX,
+- .family = family_amd_500_series,
+- },
+- {
+- .board_names = {
+- "ROG MAXIMUS XI HERO",
+- "ROG MAXIMUS XI HERO (WI-FI)",
+- },
+- .sensors = SENSOR_SET_TEMP_CHIPSET_CPU_MB |
+- SENSOR_TEMP_T_SENSOR |
+- SENSOR_TEMP_VRM | SENSOR_SET_TEMP_WATER |
+- SENSOR_FAN_CPU_OPT | SENSOR_FAN_WATER_FLOW,
+- .mutex_path = ASUS_HW_ACCESS_MUTEX_ASMX,
+- .family = family_intel_300_series,
+- },
+- {
+- .board_names = {"ROG CROSSHAIR VIII IMPACT"},
+- .sensors = SENSOR_SET_TEMP_CHIPSET_CPU_MB |
+- SENSOR_TEMP_T_SENSOR | SENSOR_TEMP_VRM |
+- SENSOR_FAN_CHIPSET | SENSOR_CURR_CPU |
+- SENSOR_IN_CPU_CORE,
+- .mutex_path = ASUS_HW_ACCESS_MUTEX_ASMX,
+- .family = family_amd_500_series,
+- },
+- {
+- .board_names = {"ROG STRIX B550-E GAMING"},
+- .sensors = SENSOR_SET_TEMP_CHIPSET_CPU_MB |
+- SENSOR_TEMP_T_SENSOR | SENSOR_TEMP_VRM |
+- SENSOR_FAN_CPU_OPT,
+- .mutex_path = ASUS_HW_ACCESS_MUTEX_ASMX,
+- .family = family_amd_500_series,
+- },
+- {
+- .board_names = {"ROG STRIX B550-I GAMING"},
+- .sensors = SENSOR_SET_TEMP_CHIPSET_CPU_MB |
+- SENSOR_TEMP_T_SENSOR | SENSOR_TEMP_VRM |
+- SENSOR_FAN_VRM_HS | SENSOR_CURR_CPU |
+- SENSOR_IN_CPU_CORE,
+- .mutex_path = ASUS_HW_ACCESS_MUTEX_ASMX,
+- .family = family_amd_500_series,
+- },
+- {
+- .board_names = {"ROG STRIX X570-E GAMING"},
+- .sensors = SENSOR_SET_TEMP_CHIPSET_CPU_MB |
+- SENSOR_TEMP_T_SENSOR | SENSOR_TEMP_VRM |
+- SENSOR_FAN_CHIPSET | SENSOR_CURR_CPU |
+- SENSOR_IN_CPU_CORE,
+- .mutex_path = ASUS_HW_ACCESS_MUTEX_ASMX,
+- .family = family_amd_500_series,
+- },
+- {
+- .board_names = {"ROG STRIX X570-E GAMING WIFI II"},
+- .sensors = SENSOR_SET_TEMP_CHIPSET_CPU_MB |
+- SENSOR_TEMP_T_SENSOR | SENSOR_CURR_CPU |
+- SENSOR_IN_CPU_CORE,
+- .mutex_path = ASUS_HW_ACCESS_MUTEX_ASMX,
+- .family = family_amd_500_series,
+- },
+- {
+- .board_names = {"ROG STRIX X570-F GAMING"},
+- .sensors = SENSOR_SET_TEMP_CHIPSET_CPU_MB |
+- SENSOR_TEMP_T_SENSOR | SENSOR_FAN_CHIPSET,
+- .mutex_path = ASUS_HW_ACCESS_MUTEX_ASMX,
+- .family = family_amd_500_series,
+- },
+- {
+- .board_names = {"ROG STRIX X570-I GAMING"},
+- .sensors = SENSOR_TEMP_CHIPSET | SENSOR_TEMP_VRM |
+- SENSOR_TEMP_T_SENSOR |
+- SENSOR_FAN_VRM_HS | SENSOR_FAN_CHIPSET |
+- SENSOR_CURR_CPU | SENSOR_IN_CPU_CORE,
+- .mutex_path = ASUS_HW_ACCESS_MUTEX_ASMX,
+- .family = family_amd_500_series,
+- },
+- {
+- .board_names = {"ROG STRIX Z690-A GAMING WIFI D4"},
+- .sensors = SENSOR_TEMP_T_SENSOR | SENSOR_TEMP_VRM,
+- .mutex_path = ASUS_HW_ACCESS_MUTEX_RMTW_ASMX,
+- .family = family_intel_600_series,
+- },
+- {
+- .board_names = {"ROG ZENITH II EXTREME"},
+- .sensors = SENSOR_SET_TEMP_CHIPSET_CPU_MB | SENSOR_TEMP_T_SENSOR |
+- SENSOR_TEMP_VRM | SENSOR_SET_TEMP_WATER |
+- SENSOR_FAN_CPU_OPT | SENSOR_FAN_CHIPSET | SENSOR_FAN_VRM_HS |
+- SENSOR_FAN_WATER_FLOW | SENSOR_CURR_CPU | SENSOR_IN_CPU_CORE |
+- SENSOR_SET_WATER_BLOCK |
+- SENSOR_TEMP_T_SENSOR_2 | SENSOR_TEMP_SENSOR_EXTRA_1 |
+- SENSOR_TEMP_SENSOR_EXTRA_2 | SENSOR_TEMP_SENSOR_EXTRA_3,
+- .mutex_path = ASUS_HW_ACCESS_MUTEX_SB_PCI0_SBRG_SIO1_MUT0,
+- .family = family_amd_500_series,
+- },
+- {}
++static const struct ec_board_info board_info_prime_x470_pro = {
++ .sensors = SENSOR_SET_TEMP_CHIPSET_CPU_MB |
++ SENSOR_TEMP_T_SENSOR | SENSOR_TEMP_VRM |
++ SENSOR_FAN_CPU_OPT |
++ SENSOR_CURR_CPU | SENSOR_IN_CPU_CORE,
++ .mutex_path = ACPI_GLOBAL_LOCK_PSEUDO_PATH,
++ .family = family_amd_400_series,
++};
++
++static const struct ec_board_info board_info_prime_x570_pro = {
++ .sensors = SENSOR_SET_TEMP_CHIPSET_CPU_MB | SENSOR_TEMP_VRM |
++ SENSOR_TEMP_T_SENSOR | SENSOR_FAN_CHIPSET,
++ .mutex_path = ASUS_HW_ACCESS_MUTEX_ASMX,
++ .family = family_amd_500_series,
++};
++
++static const struct ec_board_info board_info_pro_art_x570_creator_wifi = {
++ .sensors = SENSOR_SET_TEMP_CHIPSET_CPU_MB | SENSOR_TEMP_VRM |
++ SENSOR_TEMP_T_SENSOR | SENSOR_FAN_CPU_OPT |
++ SENSOR_CURR_CPU | SENSOR_IN_CPU_CORE,
++ .family = family_amd_500_series,
++};
++
++static const struct ec_board_info board_info_pro_ws_x570_ace = {
++ .sensors = SENSOR_SET_TEMP_CHIPSET_CPU_MB | SENSOR_TEMP_VRM |
++ SENSOR_TEMP_T_SENSOR | SENSOR_FAN_CHIPSET |
++ SENSOR_CURR_CPU | SENSOR_IN_CPU_CORE,
++ .mutex_path = ASUS_HW_ACCESS_MUTEX_ASMX,
++ .family = family_amd_500_series,
++};
++
++static const struct ec_board_info board_info_crosshair_viii_dark_hero = {
++ .sensors = SENSOR_SET_TEMP_CHIPSET_CPU_MB |
++ SENSOR_TEMP_T_SENSOR |
++ SENSOR_TEMP_VRM | SENSOR_SET_TEMP_WATER |
++ SENSOR_FAN_CPU_OPT | SENSOR_FAN_WATER_FLOW |
++ SENSOR_CURR_CPU | SENSOR_IN_CPU_CORE,
++ .mutex_path = ASUS_HW_ACCESS_MUTEX_ASMX,
++ .family = family_amd_500_series,
++};
++
++static const struct ec_board_info board_info_crosshair_viii_hero = {
++ .sensors = SENSOR_SET_TEMP_CHIPSET_CPU_MB |
++ SENSOR_TEMP_T_SENSOR |
++ SENSOR_TEMP_VRM | SENSOR_SET_TEMP_WATER |
++ SENSOR_FAN_CPU_OPT | SENSOR_FAN_CHIPSET |
++ SENSOR_FAN_WATER_FLOW | SENSOR_CURR_CPU |
++ SENSOR_IN_CPU_CORE,
++ .mutex_path = ASUS_HW_ACCESS_MUTEX_ASMX,
++ .family = family_amd_500_series,
++};
++
++static const struct ec_board_info board_info_maximus_xi_hero = {
++ .sensors = SENSOR_SET_TEMP_CHIPSET_CPU_MB |
++ SENSOR_TEMP_T_SENSOR |
++ SENSOR_TEMP_VRM | SENSOR_SET_TEMP_WATER |
++ SENSOR_FAN_CPU_OPT | SENSOR_FAN_WATER_FLOW,
++ .mutex_path = ASUS_HW_ACCESS_MUTEX_ASMX,
++ .family = family_intel_300_series,
++};
++
++static const struct ec_board_info board_info_crosshair_viii_impact = {
++ .sensors = SENSOR_SET_TEMP_CHIPSET_CPU_MB |
++ SENSOR_TEMP_T_SENSOR | SENSOR_TEMP_VRM |
++ SENSOR_FAN_CHIPSET | SENSOR_CURR_CPU |
++ SENSOR_IN_CPU_CORE,
++ .mutex_path = ASUS_HW_ACCESS_MUTEX_ASMX,
++ .family = family_amd_500_series,
++};
++
++static const struct ec_board_info board_info_strix_b550_e_gaming = {
++ .sensors = SENSOR_SET_TEMP_CHIPSET_CPU_MB |
++ SENSOR_TEMP_T_SENSOR | SENSOR_TEMP_VRM |
++ SENSOR_FAN_CPU_OPT,
++ .mutex_path = ASUS_HW_ACCESS_MUTEX_ASMX,
++ .family = family_amd_500_series,
++};
++
++static const struct ec_board_info board_info_strix_b550_i_gaming = {
++ .sensors = SENSOR_SET_TEMP_CHIPSET_CPU_MB |
++ SENSOR_TEMP_T_SENSOR | SENSOR_TEMP_VRM |
++ SENSOR_FAN_VRM_HS | SENSOR_CURR_CPU |
++ SENSOR_IN_CPU_CORE,
++ .mutex_path = ASUS_HW_ACCESS_MUTEX_ASMX,
++ .family = family_amd_500_series,
++};
++
++static const struct ec_board_info board_info_strix_x570_e_gaming = {
++ .sensors = SENSOR_SET_TEMP_CHIPSET_CPU_MB |
++ SENSOR_TEMP_T_SENSOR | SENSOR_TEMP_VRM |
++ SENSOR_FAN_CHIPSET | SENSOR_CURR_CPU |
++ SENSOR_IN_CPU_CORE,
++ .mutex_path = ASUS_HW_ACCESS_MUTEX_ASMX,
++ .family = family_amd_500_series,
++};
++
++static const struct ec_board_info board_info_strix_x570_e_gaming_wifi_ii = {
++ .sensors = SENSOR_SET_TEMP_CHIPSET_CPU_MB |
++ SENSOR_TEMP_T_SENSOR | SENSOR_CURR_CPU |
++ SENSOR_IN_CPU_CORE,
++ .mutex_path = ASUS_HW_ACCESS_MUTEX_ASMX,
++ .family = family_amd_500_series,
++};
++
++static const struct ec_board_info board_info_strix_x570_f_gaming = {
++ .sensors = SENSOR_SET_TEMP_CHIPSET_CPU_MB |
++ SENSOR_TEMP_T_SENSOR | SENSOR_FAN_CHIPSET,
++ .mutex_path = ASUS_HW_ACCESS_MUTEX_ASMX,
++ .family = family_amd_500_series,
++};
++
++static const struct ec_board_info board_info_strix_x570_i_gaming = {
++ .sensors = SENSOR_TEMP_CHIPSET | SENSOR_TEMP_VRM |
++ SENSOR_TEMP_T_SENSOR |
++ SENSOR_FAN_VRM_HS | SENSOR_FAN_CHIPSET |
++ SENSOR_CURR_CPU | SENSOR_IN_CPU_CORE,
++ .mutex_path = ASUS_HW_ACCESS_MUTEX_ASMX,
++ .family = family_amd_500_series,
++};
++
++static const struct ec_board_info board_info_strix_z690_a_gaming_wifi_d4 = {
++ .sensors = SENSOR_TEMP_T_SENSOR | SENSOR_TEMP_VRM,
++ .mutex_path = ASUS_HW_ACCESS_MUTEX_RMTW_ASMX,
++ .family = family_intel_600_series,
++};
++
++static const struct ec_board_info board_info_zenith_ii_extreme = {
++ .sensors = SENSOR_SET_TEMP_CHIPSET_CPU_MB | SENSOR_TEMP_T_SENSOR |
++ SENSOR_TEMP_VRM | SENSOR_SET_TEMP_WATER |
++ SENSOR_FAN_CPU_OPT | SENSOR_FAN_CHIPSET | SENSOR_FAN_VRM_HS |
++ SENSOR_FAN_WATER_FLOW | SENSOR_CURR_CPU | SENSOR_IN_CPU_CORE |
++ SENSOR_SET_WATER_BLOCK |
++ SENSOR_TEMP_T_SENSOR_2 | SENSOR_TEMP_SENSOR_EXTRA_1 |
++ SENSOR_TEMP_SENSOR_EXTRA_2 | SENSOR_TEMP_SENSOR_EXTRA_3,
++ .mutex_path = ASUS_HW_ACCESS_MUTEX_SB_PCI0_SBRG_SIO1_MUT0,
++ .family = family_amd_500_series,
++};
++
++#define DMI_EXACT_MATCH_ASUS_BOARD_NAME(name, board_info) \
++ { \
++ .matches = { \
++ DMI_EXACT_MATCH(DMI_BOARD_VENDOR, \
++ "ASUSTeK COMPUTER INC."), \
++ DMI_EXACT_MATCH(DMI_BOARD_NAME, name), \
++ }, \
++ .driver_data = (void *)board_info, \
++ }
++
++static const struct dmi_system_id dmi_table[] = {
++ DMI_EXACT_MATCH_ASUS_BOARD_NAME("PRIME X470-PRO",
++ &board_info_prime_x470_pro),
++ DMI_EXACT_MATCH_ASUS_BOARD_NAME("PRIME X570-PRO",
++ &board_info_prime_x570_pro),
++ DMI_EXACT_MATCH_ASUS_BOARD_NAME("ProArt X570-CREATOR WIFI",
++ &board_info_pro_art_x570_creator_wifi),
++ DMI_EXACT_MATCH_ASUS_BOARD_NAME("Pro WS X570-ACE",
++ &board_info_pro_ws_x570_ace),
++ DMI_EXACT_MATCH_ASUS_BOARD_NAME("ROG CROSSHAIR VIII DARK HERO",
++ &board_info_crosshair_viii_dark_hero),
++ DMI_EXACT_MATCH_ASUS_BOARD_NAME("ROG CROSSHAIR VIII FORMULA",
++ &board_info_crosshair_viii_hero),
++ DMI_EXACT_MATCH_ASUS_BOARD_NAME("ROG CROSSHAIR VIII HERO",
++ &board_info_crosshair_viii_hero),
++ DMI_EXACT_MATCH_ASUS_BOARD_NAME("ROG CROSSHAIR VIII HERO (WI-FI)",
++ &board_info_crosshair_viii_hero),
++ DMI_EXACT_MATCH_ASUS_BOARD_NAME("ROG MAXIMUS XI HERO",
++ &board_info_maximus_xi_hero),
++ DMI_EXACT_MATCH_ASUS_BOARD_NAME("ROG MAXIMUS XI HERO (WI-FI)",
++ &board_info_maximus_xi_hero),
++ DMI_EXACT_MATCH_ASUS_BOARD_NAME("ROG CROSSHAIR VIII IMPACT",
++ &board_info_crosshair_viii_impact),
++ DMI_EXACT_MATCH_ASUS_BOARD_NAME("ROG STRIX B550-E GAMING",
++ &board_info_strix_b550_e_gaming),
++ DMI_EXACT_MATCH_ASUS_BOARD_NAME("ROG STRIX B550-I GAMING",
++ &board_info_strix_b550_i_gaming),
++ DMI_EXACT_MATCH_ASUS_BOARD_NAME("ROG STRIX X570-E GAMING",
++ &board_info_strix_x570_e_gaming),
++ DMI_EXACT_MATCH_ASUS_BOARD_NAME("ROG STRIX X570-E GAMING WIFI II",
++ &board_info_strix_x570_e_gaming_wifi_ii),
++ DMI_EXACT_MATCH_ASUS_BOARD_NAME("ROG STRIX X570-F GAMING",
++ &board_info_strix_x570_f_gaming),
++ DMI_EXACT_MATCH_ASUS_BOARD_NAME("ROG STRIX X570-I GAMING",
++ &board_info_strix_x570_i_gaming),
++ DMI_EXACT_MATCH_ASUS_BOARD_NAME("ROG STRIX Z690-A GAMING WIFI D4",
++ &board_info_strix_z690_a_gaming_wifi_d4),
++ DMI_EXACT_MATCH_ASUS_BOARD_NAME("ROG ZENITH II EXTREME",
++ &board_info_zenith_ii_extreme),
++ {},
+ };
+
+ struct ec_sensor {
+@@ -537,12 +577,12 @@ static int find_ec_sensor_index(const struct ec_sensors_data *ec,
+ return -ENOENT;
+ }
+
+-static int __init bank_compare(const void *a, const void *b)
++static int bank_compare(const void *a, const void *b)
+ {
+ return *((const s8 *)a) - *((const s8 *)b);
+ }
+
+-static void __init setup_sensor_data(struct ec_sensors_data *ec)
++static void setup_sensor_data(struct ec_sensors_data *ec)
+ {
+ struct ec_sensor *s = ec->sensors;
+ bool bank_found;
+@@ -574,7 +614,7 @@ static void __init setup_sensor_data(struct ec_sensors_data *ec)
+ sort(ec->banks, ec->nr_banks, 1, bank_compare, NULL);
+ }
+
+-static void __init fill_ec_registers(struct ec_sensors_data *ec)
++static void fill_ec_registers(struct ec_sensors_data *ec)
+ {
+ const struct ec_sensor_info *si;
+ unsigned int i, j, register_idx = 0;
+@@ -589,7 +629,7 @@ static void __init fill_ec_registers(struct ec_sensors_data *ec)
+ }
+ }
+
+-static int __init setup_lock_data(struct device *dev)
++static int setup_lock_data(struct device *dev)
+ {
+ const char *mutex_path;
+ int status;
+@@ -812,7 +852,7 @@ static umode_t asus_ec_hwmon_is_visible(const void *drvdata,
+ return find_ec_sensor_index(state, type, channel) >= 0 ? S_IRUGO : 0;
+ }
+
+-static int __init
++static int
+ asus_ec_hwmon_add_chan_info(struct hwmon_channel_info *asus_ec_hwmon_chan,
+ struct device *dev, int num,
+ enum hwmon_sensor_types type, u32 config)
+@@ -841,27 +881,15 @@ static struct hwmon_chip_info asus_ec_chip_info = {
+ .ops = &asus_ec_hwmon_ops,
+ };
+
+-static const struct ec_board_info * __init get_board_info(void)
++static const struct ec_board_info *get_board_info(void)
+ {
+- const char *dmi_board_vendor = dmi_get_system_info(DMI_BOARD_VENDOR);
+- const char *dmi_board_name = dmi_get_system_info(DMI_BOARD_NAME);
+- const struct ec_board_info *board;
+-
+- if (!dmi_board_vendor || !dmi_board_name ||
+- strcasecmp(dmi_board_vendor, "ASUSTeK COMPUTER INC."))
+- return NULL;
+-
+- for (board = board_info; board->sensors; board++) {
+- if (match_string(board->board_names,
+- MAX_IDENTICAL_BOARD_VARIATIONS,
+- dmi_board_name) >= 0)
+- return board;
+- }
++ const struct dmi_system_id *dmi_entry;
+
+- return NULL;
++ dmi_entry = dmi_first_match(dmi_table);
++ return dmi_entry ? dmi_entry->driver_data : NULL;
+ }
+
+-static int __init asus_ec_probe(struct platform_device *pdev)
++static int asus_ec_probe(struct platform_device *pdev)
+ {
+ const struct hwmon_channel_info **ptr_asus_ec_ci;
+ int nr_count[hwmon_max] = { 0 }, nr_types = 0;
+@@ -970,29 +998,37 @@ static int __init asus_ec_probe(struct platform_device *pdev)
+ return PTR_ERR_OR_ZERO(hwdev);
+ }
+
+-
+-static const struct acpi_device_id acpi_ec_ids[] = {
+- /* Embedded Controller Device */
+- { "PNP0C09", 0 },
+- {}
+-};
++MODULE_DEVICE_TABLE(dmi, dmi_table);
+
+ static struct platform_driver asus_ec_sensors_platform_driver = {
+ .driver = {
+ .name = "asus-ec-sensors",
+- .acpi_match_table = acpi_ec_ids,
+ },
++ .probe = asus_ec_probe,
+ };
+
+-MODULE_DEVICE_TABLE(acpi, acpi_ec_ids);
+-/*
+- * we use module_platform_driver_probe() rather than module_platform_driver()
+- * because the probe function (and its dependants) are marked with __init, which
+- * means we can't put it into the .probe member of the platform_driver struct
+- * above, and we can't mark the asus_ec_sensors_platform_driver object as __init
+- * because the object is referenced from the module exit code.
+- */
+-module_platform_driver_probe(asus_ec_sensors_platform_driver, asus_ec_probe);
++static struct platform_device *asus_ec_sensors_platform_device;
++
++static int __init asus_ec_init(void)
++{
++ asus_ec_sensors_platform_device =
++ platform_create_bundle(&asus_ec_sensors_platform_driver,
++ asus_ec_probe, NULL, 0, NULL, 0);
++
++ if (IS_ERR(asus_ec_sensors_platform_device))
++ return PTR_ERR(asus_ec_sensors_platform_device);
++
++ return 0;
++}
++
++static void __exit asus_ec_exit(void)
++{
++ platform_device_unregister(asus_ec_sensors_platform_device);
++ platform_driver_unregister(&asus_ec_sensors_platform_driver);
++}
++
++module_init(asus_ec_init);
++module_exit(asus_ec_exit);
+
+ module_param_named(mutex_path, mutex_path_override, charp, 0);
+ MODULE_PARM_DESC(mutex_path,
+--
+2.35.1
+