Linux Hardware Monitor development
 help / color / mirror / Atom feed
* [RFC PATCH v3 0/3] hwmon: asus-ec-sensors: MAXIMUS XI HERO Fan Extension Card
@ 2026-11-28 20:09 John den Heijer
  2026-11-28 20:09 ` [RFC PATCH v3 1/3] hwmon: (asus-ec-sensors) propagate EC read and selector errors John den Heijer
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: John den Heijer @ 2026-11-28 20:09 UTC (permalink / raw)
  To: linux-hwmon; +Cc: eugene.shalygin, linux

This is a request for design and safety feedback, not a request to merge
the series as-is. It adds opt-in monitoring of the three fan tachometers
and three thermistors on an ASUS Fan Extension Card attached to a ROG
MAXIMUS XI HERO (non-WiFi), BIOS 2004.

The pinned base is Guenter Roeck's hwmon-next at
8d0f79f49fb10c9f07fee6720551113272a1812b. It already contains the
MAXIMUS IX EXTREME selector-based extension fan path and EC 00:60..62
temperature descriptors, but does not select these sensors on XI HERO.

The BIOS 2004 image (SHA-256
034e6c688ca41cf448745398ce3ccfa184dfae217287ee7b72039498ff5aa812)
provides the following property and transaction evidence:

  EXT_FAN1/2/3: properties 0x060400e2/e3/e4; write EC 00:43 with
  selector 0x0a/0x0b/0x0c, then read high/low RPM bytes at 00:57/58.
  The getter checks EC 00:d4 on every call and performs first-use or
  lost-latch read-modify-writes d4 |= 0x80 and 89 |= 0x07.

  EXT_Sensor1/2/3: properties 0x06030032/34/36; after a firmware card
  property check, write EC 00:68 = 0x07 immediately before each read
  of 00:60/61/62. The exact meaning of 0x68 is not established.

BIOS 2203 has the same relevant fan mapping and getter control flow.
The BIOS presence property, IsEXTFanCardExist (0x06060050), reads the
EXTFanCard UEFI/Setup variable; we have not established a reliable live
electrical card-presence signal. Accordingly, the XI HERO extension
sensors remain disabled by default and are enabled only by an explicit
module parameter on the exact non-WiFi DMI name. The WiFi entry is not
changed. With the option enabled, the first read of any hwmon input may
trigger a full refresh and the extension setup writes, even if the user
did not request an EXT_* attribute.

Patch 1 changes generic EC/selector error propagation so a failed block
read cannot publish a partial sensor cache. This affects failure paths
on all supported boards, not only XI HERO. Patches 2 and 3 add the board
opt-in, RPM path and thermistor path. Patch 2 currently relies on the
restore/error path introduced by patch 1; we would rebase or reshape the
series if the generic change should be reviewed separately.

The new transactions use the driver's configured ACPI EC mutex, normally
\AMW0.ASMX on XI HERO. They do not add PWM, fan-control, NCT, direct
EC-port or WMI accesses. They do write the EC bank selector, the BIOS
observed d4/89 setup registers, the fan selector and 0x68. We do not
claim that these writes are harmless when the optional card is absent.

A different, locally maintained asus-ec-sensors module for Unraid 7.4.1
/ 6.18.64-Unraid has returned all six channels on a physical XI HERO
with the card installed, including after one reboot. The binaries and
some error/selector handling differ; that test is not a runtime test of
this upstream RFC. All three v2 increments compiled with W=1 on both
x86_64 and i386. For v3 we fault-injected the actual initialization
helper on a host with memory-backed EC stubs. After a lost latch, v2
skipped the retry when either the read or write at 0x89 failed; v3
repeated both setup writes. The driver object compiled with W=1 and
no warnings after each v3 patch on x86_64 and i386 with GCC 15.2.0.
On x86_64 the v3 module also linked with W=1 against a freshly built
vmlinux; modpost completed without diagnostics. We have not run v3 on
hardware.

Questions for maintainers:

1. Is a default-off, exact-DMI opt-in acceptable when firmware exposes
   only a Setup-variable-backed card property, or is another presence
   mechanism required before these EC writes can be accepted?
2. Should the driver preserve the BIOS first-use d4/89 writes even when
   d4 bit 7 is already set? We have not isolated their necessity and do
   not want to replace a working BIOS sequence with an untested shortcut.
3. Is reproducing the BIOS's 68=07 write before every thermistor read an
   acceptable basis while its bit semantics remain unknown? A separate
   BIOS Extension control initialization path also writes 68=07.
4. Would you prefer patch 1 as a separate bugfix before the board support,
   and what fault-path regression evidence would be useful?
5. Is the separate non-WiFi board profile and module parameter an
   appropriate interface, or should the board/card policy be expressed
   differently?

Changes since v2:
- Add Fixes tags for the original block-read and selector error paths.
- Clear the cached initialization flag before attempting either setup
  write, so a partial recovery can be retried.
- Document enable_ext_fan and explain the BIOS cutoff of 165 RPM.
- Keep the thermistor patch functionally unchanged.

v2: https://lore.kernel.org/linux-hwmon/20261128191225.2990-1-jdenheijer74@gmail.com/

John den Heijer (3):
  hwmon: (asus-ec-sensors) propagate EC read and selector errors
  hwmon: (asus-ec-sensors) add opt-in MAXIMUS XI HERO EXT fan RPM
  hwmon: (asus-ec-sensors) add MAXIMUS XI HERO EXT thermistors

 Documentation/hwmon/asus_ec_sensors.rst |   7 ++
 drivers/hwmon/asus-ec-sensors.c         | 142 +++++++++++++++++++++---
 2 files changed, 131 insertions(+), 18 deletions(-)


base-commit: 8d0f79f49fb10c9f07fee6720551113272a1812b
-- 
2.54.0 (Apple Git-157)


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

* [RFC PATCH v3 1/3] hwmon: (asus-ec-sensors) propagate EC read and selector errors
  2026-11-28 20:09 [RFC PATCH v3 0/3] hwmon: asus-ec-sensors: MAXIMUS XI HERO Fan Extension Card John den Heijer
@ 2026-11-28 20:09 ` John den Heijer
  2026-11-28 20:09 ` [RFC PATCH v3 2/3] hwmon: (asus-ec-sensors) add opt-in MAXIMUS XI HERO EXT fan RPM John den Heijer
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: John den Heijer @ 2026-11-28 20:09 UTC (permalink / raw)
  To: linux-hwmon; +Cc: eugene.shalygin, linux

On an EC or selector failure, asus_ec_block_read() can continue with a
partial buffer. A successful final bank restore then reports success,
so update_ec_sensors() publishes stale bytes.

Propagate the first error. Attempt selector restoration in its bank,
then restore the original bank. A failed restore also rejects the
update. This changes the failure path for all supported boards.

Fixes: d0ddfd241e57 ("hwmon: (asus-ec-sensors) add driver for ASUS EC")
Fixes: daa4896813b2 ("hwmon: (asus-ec-sensors) add fan extension card fans for MAXIMUS IX EXTREME")
Signed-off-by: John den Heijer <jdenheijer74@gmail.com>
---
 drivers/hwmon/asus-ec-sensors.c | 39 ++++++++++++++++++++++-----------
 1 file changed, 26 insertions(+), 13 deletions(-)

diff --git a/drivers/hwmon/asus-ec-sensors.c b/drivers/hwmon/asus-ec-sensors.c
index d0c01b825..6e06256a5 100644
--- a/drivers/hwmon/asus-ec-sensors.c
+++ b/drivers/hwmon/asus-ec-sensors.c
@@ -1309,7 +1309,7 @@ static int asus_ec_bank_switch(u8 bank, u8 *old)
 static int asus_ec_block_read(const struct device *dev,
 			      struct ec_sensors_data *ec)
 {
-	int ireg, ibank, status;
+	int ireg, ibank, status, restore_status;
 	u8 bank, reg_bank, prev_bank, select, prev_select;
 	bool select_saved;
 
@@ -1330,7 +1330,8 @@ static int asus_ec_block_read(const struct device *dev,
 	for (ibank = 0; ibank < ec->nr_banks; ibank++) {
 		if (bank != ec->banks[ibank]) {
 			bank = ec->banks[ibank];
-			if (asus_ec_bank_switch(bank, NULL)) {
+			status = asus_ec_bank_switch(bank, NULL);
+			if (status) {
 				dev_warn(dev, "EC bank switch to %d failed",
 					 bank);
 				break;
@@ -1345,24 +1346,36 @@ static int asus_ec_block_read(const struct device *dev,
 			select = register_select(ec->registers[ireg]);
 			if (select) {
 				if (!select_saved) {
-					if (ec_read(ASUS_EC_SELECT_REGISTER,
-						    &prev_select))
-						continue;
+					status = ec_read(ASUS_EC_SELECT_REGISTER,
+							 &prev_select);
+					if (status)
+						goto restore_select;
 					select_saved = true;
 				}
-				if (ec_write(ASUS_EC_SELECT_REGISTER, select))
-					continue;
+				status = ec_write(ASUS_EC_SELECT_REGISTER, select);
+				if (status)
+					goto restore_select;
 			}
-			ec_read(register_index(ec->registers[ireg]),
-				ec->read_buffer + ireg);
+			status = ec_read(register_index(ec->registers[ireg]),
+					 ec->read_buffer + ireg);
+			if (status)
+				goto restore_select;
 		}
+restore_select:
 		/* restore the selector while still in its bank */
-		if (select_saved &&
-		    ec_write(ASUS_EC_SELECT_REGISTER, prev_select))
-			dev_warn(dev, "EC selector restore failed");
+		if (select_saved) {
+			restore_status = ec_write(ASUS_EC_SELECT_REGISTER,
+						  prev_select);
+			if (!status)
+				status = restore_status;
+		}
+		if (status)
+			break;
 	}
 
-	status = asus_ec_bank_switch(prev_bank, NULL);
+	restore_status = asus_ec_bank_switch(prev_bank, NULL);
+	if (!status)
+		status = restore_status;
 	return status;
 }
 
-- 
2.54.0 (Apple Git-157)


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

* [RFC PATCH v3 2/3] hwmon: (asus-ec-sensors) add opt-in MAXIMUS XI HERO EXT fan RPM
  2026-11-28 20:09 [RFC PATCH v3 0/3] hwmon: asus-ec-sensors: MAXIMUS XI HERO Fan Extension Card John den Heijer
  2026-11-28 20:09 ` [RFC PATCH v3 1/3] hwmon: (asus-ec-sensors) propagate EC read and selector errors John den Heijer
@ 2026-11-28 20:09 ` John den Heijer
  2026-11-28 20:09 ` [RFC PATCH v3 3/3] hwmon: (asus-ec-sensors) add MAXIMUS XI HERO EXT thermistors John den Heijer
  2026-11-28 20:17 ` [RFC PATCH v3 0/3] hwmon: asus-ec-sensors: MAXIMUS XI HERO Fan Extension Card sashiko-bot
  3 siblings, 0 replies; 5+ messages in thread
From: John den Heijer @ 2026-11-28 20:09 UTC (permalink / raw)
  To: linux-hwmon; +Cc: eugene.shalygin, linux

BIOS 2004 reads the three optional extension fan tachometers by writing
selector 0x0a, 0x0b or 0x0c to EC bank-0 register 0x43 and reading the
high and low RPM bytes from 0x57/0x58.

Before the first read, or after a lost latch, the BIOS getter sets bit 7
of 0xd4 and bits 0-2 of 0x89. Reuse the upstream MAXIMUS IX EXTREME
selector path, but add this initialization only for the exact non-WiFi
MAXIMUS XI HERO DMI name. Keep the optional-card support default-off:
a reliable live card-presence detector has not been established.

Enable the sensors with enable_ext_fan=1 only with the card installed.
Match BIOS 2004 by reporting extension readings below 165 RPM (0xa5)
as zero. If reinitialization fails, retry the whole sequence on the
next refresh even if the enable bit is already set.

Signed-off-by: John den Heijer <jdenheijer74@gmail.com>
---
 Documentation/hwmon/asus_ec_sensors.rst |  7 +++
 drivers/hwmon/asus-ec-sensors.c         | 78 +++++++++++++++++++++++--
 2 files changed, 80 insertions(+), 5 deletions(-)

diff --git a/Documentation/hwmon/asus_ec_sensors.rst b/Documentation/hwmon/asus_ec_sensors.rst
index fb7704c46..580449ab7 100644
--- a/Documentation/hwmon/asus_ec_sensors.rst
+++ b/Documentation/hwmon/asus_ec_sensors.rst
@@ -108,3 +108,10 @@ Module Parameters
 		the stored in the driver value until it gets updated.
 		A special string ":GLOBAL_LOCK" can be passed to use the ACPI
 		global lock instead of a dedicated mutex.
+
+ * enable_ext_fan: bool
+		Enable monitoring of the optional ASUS Fan Extension Card on the
+		ROG MAXIMUS XI HERO (non-WiFi). The default is false. Set
+		``enable_ext_fan=1`` when loading the module only if the card is
+		installed. The driver cannot detect its presence. Reading any
+		hwmon input can trigger the EC writes that prepare the card.
diff --git a/drivers/hwmon/asus-ec-sensors.c b/drivers/hwmon/asus-ec-sensors.c
index 6e06256a5..d9a42b26c 100644
--- a/drivers/hwmon/asus-ec-sensors.c
+++ b/drivers/hwmon/asus-ec-sensors.c
@@ -37,6 +37,7 @@
 #include <linux/unaligned.h>
 
 static char *mutex_path_override;
+static bool enable_ext_fan;
 
 /* Writing to this EC register switches EC bank */
 #define ASUS_EC_BANK_REGISTER	0xff
@@ -45,6 +46,9 @@ static char *mutex_path_override;
  * group of registers reports (e.g. one of the fans of the fan extension card).
  */
 #define ASUS_EC_SELECT_REGISTER	0x43
+#define ASUS_EC_EXT_FAN_RPM_MIN	0xa5
+#define ASUS_EC_EXT_FAN_ENABLE_REGISTER	0xd4
+#define ASUS_EC_EXT_FAN_CHANNEL_REGISTER	0x89
 #define SENSOR_LABEL_LEN	16
 
 /*
@@ -414,6 +418,12 @@ static const struct ec_sensor_info sensors_family_intel_300[] = {
 	[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_fan_ext_1] =
+		EC_SENSOR_SELECT("EXT_FAN1", hwmon_fan, 2, 0x00, 0x57, 0x0a),
+	[ec_sensor_fan_ext_2] =
+		EC_SENSOR_SELECT("EXT_FAN2", hwmon_fan, 2, 0x00, 0x57, 0x0b),
+	[ec_sensor_fan_ext_3] =
+		EC_SENSOR_SELECT("EXT_FAN3", hwmon_fan, 2, 0x00, 0x57, 0x0c),
 	[ec_sensor_temp_water_in] =
 		EC_SENSOR("Water_In", hwmon_temp, 1, 0x01, 0x00),
 	[ec_sensor_temp_water_out] =
@@ -484,6 +494,7 @@ static const struct ec_sensor_info sensors_family_intel_700[] = {
 
 struct ec_board_info {
 	unsigned long sensors;
+	bool ext_fan_capable;
 	/*
 	 * Defines which mutex to use for guarding access to the state and the
 	 * hardware. Can be either a full path to an AML mutex or the
@@ -593,6 +604,16 @@ static const struct ec_board_info board_info_maximus_xi_hero = {
 	.family = family_intel_300_series,
 };
 
+static const struct ec_board_info board_info_maximus_xi_hero_ext = {
+	.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,
+	.ext_fan_capable = true,
+	.mutex_path = ASUS_HW_ACCESS_MUTEX_ASMX,
+	.family = family_intel_300_series,
+};
+
 static const struct ec_board_info board_info_maximus_z690_formula = {
 	.sensors = SENSOR_TEMP_T_SENSOR | SENSOR_TEMP_VRM |
 		SENSOR_SET_TEMP_WATER | SENSOR_FAN_WATER_FLOW,
@@ -1004,7 +1025,7 @@ static const struct dmi_system_id dmi_table[] = {
 	DMI_EXACT_MATCH_ASUS_BOARD_NAME("ROG CROSSHAIR X870E HERO",
 					&board_info_crosshair_x870e_hero),
 	DMI_EXACT_MATCH_ASUS_BOARD_NAME("ROG MAXIMUS XI HERO",
-					&board_info_maximus_xi_hero),
+					&board_info_maximus_xi_hero_ext),
 	DMI_EXACT_MATCH_ASUS_BOARD_NAME("ROG MAXIMUS XI HERO (WI-FI)",
 					&board_info_maximus_xi_hero),
 	DMI_EXACT_MATCH_ASUS_BOARD_NAME("ROG MAXIMUS X HERO",
@@ -1135,6 +1156,9 @@ static bool unlock_global_acpi_lock(struct lock_data *data)
 struct ec_sensors_data {
 	const struct ec_board_info *board_info;
 	const struct ec_sensor_info *sensors_info;
+	unsigned long sensor_mask;
+	bool ext_fan_enabled;
+	bool ext_fan_initialized;
 	struct ec_sensor *sensors;
 	/*
 	 * EC registers to read from: (select << 16) + (bank << 8) + index,
@@ -1224,8 +1248,8 @@ static void setup_sensor_data(struct ec_sensors_data *ec)
 	ec->nr_banks = 0;
 	ec->nr_registers = 0;
 
-	for_each_set_bit(i, &ec->board_info->sensors,
-			 BITS_PER_TYPE(ec->board_info->sensors)) {
+	for_each_set_bit(i, &ec->sensor_mask,
+			 BITS_PER_TYPE(ec->sensor_mask)) {
 		s->info_index = i;
 		s->cached_value = 0;
 		ec->nr_registers +=
@@ -1306,6 +1330,32 @@ static int asus_ec_bank_switch(u8 bank, u8 *old)
 	return ec_write(ASUS_EC_BANK_REGISTER, bank);
 }
 
+static int asus_ec_prepare_ext_fans(struct ec_sensors_data *ec)
+{
+	u8 enabled, channels;
+	int status;
+
+	status = ec_read(ASUS_EC_EXT_FAN_ENABLE_REGISTER, &enabled);
+	if (status)
+		return status;
+	if (ec->ext_fan_initialized && (enabled & BIT(7)))
+		return 0;
+
+	/* Retry both setup writes if reinitialization fails partway. */
+	ec->ext_fan_initialized = false;
+	status = ec_write(ASUS_EC_EXT_FAN_ENABLE_REGISTER, enabled | BIT(7));
+	if (status)
+		return status;
+	status = ec_read(ASUS_EC_EXT_FAN_CHANNEL_REGISTER, &channels);
+	if (status)
+		return status;
+	status = ec_write(ASUS_EC_EXT_FAN_CHANNEL_REGISTER,
+			  channels | GENMASK(2, 0));
+	if (!status)
+		ec->ext_fan_initialized = true;
+	return status;
+}
+
 static int asus_ec_block_read(const struct device *dev,
 			      struct ec_sensors_data *ec)
 {
@@ -1325,6 +1375,11 @@ static int asus_ec_block_read(const struct device *dev,
 		dev_warn(dev,
 			"Concurrent access to the ACPI EC detected.\nRace condition possible.");
 	}
+	if (ec->ext_fan_enabled) {
+		status = asus_ec_prepare_ext_fans(ec);
+		if (status)
+			goto restore_bank;
+	}
 
 	/* read registers minimizing bank switches. */
 	for (ibank = 0; ibank < ec->nr_banks; ibank++) {
@@ -1373,6 +1428,7 @@ restore_select:
 			break;
 	}
 
+restore_bank:
 	restore_status = asus_ec_bank_switch(prev_bank, NULL);
 	if (!status)
 		status = restore_status;
@@ -1503,8 +1559,11 @@ static int asus_ec_hwmon_read(struct device *dev, enum hwmon_sensor_types type,
 		return ret;
 
 	sensor_info = get_sensor_info(state, sidx);
+	ec_sensor = get_ec_sensor_type(state, sidx);
+	if (state->ext_fan_enabled && ec_sensor >= ec_sensor_fan_ext_1 &&
+	    ec_sensor <= ec_sensor_fan_ext_3 && value < ASUS_EC_EXT_FAN_RPM_MIN)
+		value = 0;
 	if (sensor_info->type == hwmon_temp) {
-		ec_sensor = get_ec_sensor_type(state, sidx);
 		if ((environment_temp_sensors & BIT(ec_sensor)) &&
 		    is_blank_temperature_value(value))
 			return -ENODATA;
@@ -1601,6 +1660,12 @@ static int asus_ec_probe(struct platform_device *pdev)
 	ec_data->next_update = INITIAL_JIFFIES;
 	dev_set_drvdata(dev, ec_data);
 	ec_data->board_info = pboard_info;
+	ec_data->sensor_mask = pboard_info->sensors;
+	ec_data->ext_fan_enabled = pboard_info->ext_fan_capable &&
+				   enable_ext_fan;
+	if (ec_data->ext_fan_enabled)
+		ec_data->sensor_mask |= SENSOR_FAN_EXT_1 |
+					SENSOR_FAN_EXT_2 | SENSOR_FAN_EXT_3;
 
 	switch (ec_data->board_info->family) {
 	case family_amd_400_series:
@@ -1645,7 +1710,7 @@ static int asus_ec_probe(struct platform_device *pdev)
 		return -EINVAL;
 	}
 
-	ec_data->nr_sensors = hweight_long(ec_data->board_info->sensors);
+	ec_data->nr_sensors = hweight_long(ec_data->sensor_mask);
 	ec_data->sensors = devm_kzalloc_objs(dev, struct ec_sensor,
 					     ec_data->nr_sensors);
 	if (!ec_data->sensors)
@@ -1745,6 +1810,9 @@ module_exit(asus_ec_exit);
 module_param_named(mutex_path, mutex_path_override, charp, 0);
 MODULE_PARM_DESC(mutex_path,
 		 "Override ACPI mutex path used to guard access to hardware");
+module_param(enable_ext_fan, bool, 0);
+MODULE_PARM_DESC(enable_ext_fan,
+		 "Enable Fan Extension Card sensors on ROG MAXIMUS XI HERO");
 
 MODULE_AUTHOR("Eugene Shalygin <eugene.shalygin@gmail.com>");
 MODULE_DESCRIPTION(
-- 
2.54.0 (Apple Git-157)


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

* [RFC PATCH v3 3/3] hwmon: (asus-ec-sensors) add MAXIMUS XI HERO EXT thermistors
  2026-11-28 20:09 [RFC PATCH v3 0/3] hwmon: asus-ec-sensors: MAXIMUS XI HERO Fan Extension Card John den Heijer
  2026-11-28 20:09 ` [RFC PATCH v3 1/3] hwmon: (asus-ec-sensors) propagate EC read and selector errors John den Heijer
  2026-11-28 20:09 ` [RFC PATCH v3 2/3] hwmon: (asus-ec-sensors) add opt-in MAXIMUS XI HERO EXT fan RPM John den Heijer
@ 2026-11-28 20:09 ` John den Heijer
  2026-11-28 20:17 ` [RFC PATCH v3 0/3] hwmon: asus-ec-sensors: MAXIMUS XI HERO Fan Extension Card sashiko-bot
  3 siblings, 0 replies; 5+ messages in thread
From: John den Heijer @ 2026-11-28 20:09 UTC (permalink / raw)
  To: linux-hwmon; +Cc: eugene.shalygin, linux

BIOS 2004 maps the three optional Fan Extension Card thermistors to EC
bank-0 registers 0x60, 0x61 and 0x62. Its getter writes 0x68=0x07
immediately before each read.

Reproduce that sequence only for the opted-in non-WiFi XI HERO and
return -ENODATA for firmware-invalid values. The bit-level meaning of
0x68 is not established.

Signed-off-by: John den Heijer <jdenheijer74@gmail.com>
---
 drivers/hwmon/asus-ec-sensors.c | 27 ++++++++++++++++++++++++++-
 1 file changed, 26 insertions(+), 1 deletion(-)

diff --git a/drivers/hwmon/asus-ec-sensors.c b/drivers/hwmon/asus-ec-sensors.c
index d9a42b26c..2f2cc6ef3 100644
--- a/drivers/hwmon/asus-ec-sensors.c
+++ b/drivers/hwmon/asus-ec-sensors.c
@@ -49,6 +49,8 @@ static bool enable_ext_fan;
 #define ASUS_EC_EXT_FAN_RPM_MIN	0xa5
 #define ASUS_EC_EXT_FAN_ENABLE_REGISTER	0xd4
 #define ASUS_EC_EXT_FAN_CHANNEL_REGISTER	0x89
+#define ASUS_EC_EXT_TEMP_PREPARE_REGISTER	0x68
+#define ASUS_EC_EXT_TEMP_PREPARE_VALUE	0x07
 #define SENSOR_LABEL_LEN	16
 
 /*
@@ -413,6 +415,13 @@ static const struct ec_sensor_info sensors_family_intel_300[] = {
 	[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),
+	/* BIOS 2004 properties 0x06030032, 0x06030034, 0x06030036 */
+	[ec_sensor_temp_sensor_extra_1] =
+		EC_SENSOR("EXT_Sensor1", hwmon_temp, 1, 0x00, 0x60),
+	[ec_sensor_temp_sensor_extra_2] =
+		EC_SENSOR("EXT_Sensor2", hwmon_temp, 1, 0x00, 0x61),
+	[ec_sensor_temp_sensor_extra_3] =
+		EC_SENSOR("EXT_Sensor3", hwmon_temp, 1, 0x00, 0x62),
 	[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),
@@ -1411,6 +1420,15 @@ static int asus_ec_block_read(const struct device *dev,
 				if (status)
 					goto restore_select;
 			}
+			/* BIOS 2004 performs this write before each EXT probe read. */
+			if (ec->ext_fan_enabled && !bank &&
+			    register_index(ec->registers[ireg]) >= 0x60 &&
+			    register_index(ec->registers[ireg]) <= 0x62) {
+				status = ec_write(ASUS_EC_EXT_TEMP_PREPARE_REGISTER,
+						  ASUS_EC_EXT_TEMP_PREPARE_VALUE);
+				if (status)
+					goto restore_select;
+			}
 			status = ec_read(register_index(ec->registers[ireg]),
 					 ec->read_buffer + ireg);
 			if (status)
@@ -1564,6 +1582,10 @@ static int asus_ec_hwmon_read(struct device *dev, enum hwmon_sensor_types type,
 	    ec_sensor <= ec_sensor_fan_ext_3 && value < ASUS_EC_EXT_FAN_RPM_MIN)
 		value = 0;
 	if (sensor_info->type == hwmon_temp) {
+		if (state->ext_fan_enabled &&
+		    ec_sensor >= ec_sensor_temp_sensor_extra_1 &&
+		    ec_sensor <= ec_sensor_temp_sensor_extra_3 && value < -50)
+			return -ENODATA;
 		if ((environment_temp_sensors & BIT(ec_sensor)) &&
 		    is_blank_temperature_value(value))
 			return -ENODATA;
@@ -1665,7 +1687,10 @@ static int asus_ec_probe(struct platform_device *pdev)
 				   enable_ext_fan;
 	if (ec_data->ext_fan_enabled)
 		ec_data->sensor_mask |= SENSOR_FAN_EXT_1 |
-					SENSOR_FAN_EXT_2 | SENSOR_FAN_EXT_3;
+					SENSOR_FAN_EXT_2 | SENSOR_FAN_EXT_3 |
+					SENSOR_TEMP_SENSOR_EXTRA_1 |
+					SENSOR_TEMP_SENSOR_EXTRA_2 |
+					SENSOR_TEMP_SENSOR_EXTRA_3;
 
 	switch (ec_data->board_info->family) {
 	case family_amd_400_series:
-- 
2.54.0 (Apple Git-157)


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

* Re: [RFC PATCH v3 0/3] hwmon: asus-ec-sensors: MAXIMUS XI HERO Fan Extension Card
  2026-11-28 20:09 [RFC PATCH v3 0/3] hwmon: asus-ec-sensors: MAXIMUS XI HERO Fan Extension Card John den Heijer
                   ` (2 preceding siblings ...)
  2026-11-28 20:09 ` [RFC PATCH v3 3/3] hwmon: (asus-ec-sensors) add MAXIMUS XI HERO EXT thermistors John den Heijer
@ 2026-11-28 20:17 ` sashiko-bot
  3 siblings, 0 replies; 5+ messages in thread
From: sashiko-bot @ 2026-11-28 20:17 UTC (permalink / raw)
  To: John den Heijer, linux-hwmon

Sashiko has reviewed this 3-patch series and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261128200952.2935-1-jdenheijer74@gmail.com

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

end of thread, other threads:[~2026-11-28 20:17 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-28 20:09 [RFC PATCH v3 0/3] hwmon: asus-ec-sensors: MAXIMUS XI HERO Fan Extension Card John den Heijer
2026-11-28 20:09 ` [RFC PATCH v3 1/3] hwmon: (asus-ec-sensors) propagate EC read and selector errors John den Heijer
2026-11-28 20:09 ` [RFC PATCH v3 2/3] hwmon: (asus-ec-sensors) add opt-in MAXIMUS XI HERO EXT fan RPM John den Heijer
2026-11-28 20:09 ` [RFC PATCH v3 3/3] hwmon: (asus-ec-sensors) add MAXIMUS XI HERO EXT thermistors John den Heijer
2026-11-28 20:17 ` [RFC PATCH v3 0/3] hwmon: asus-ec-sensors: MAXIMUS XI HERO Fan Extension Card sashiko-bot

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