Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

hwmon: (asus-ec-sensors) Fix T_Sensor for PRIME X670E-PRO WIFI

On the Asus PRIME X670E-PRO WIFI, the driver reports a constant value of
zero for T_Sensor. On this board, the register for T_Sensor is at a
different address, as found by experimentation and confirmed by
comparison to an independent temperature reading.

* sensor disconnected: -62.0°C
* ambient temperature: +22.0°C
* held between fingers: +30.0°C

Introduce SENSOR_TEMP_T_SENSOR_ALT1 to support the PRIME X670E-PRO WIFI
without causing a regression for other 600-series boards

Fixes: e0444758dd1b ("hwmon: (asus-ec-sensors) add PRIME X670E-PRO WIFI")
Signed-off-by: Corey Hickey <bugfood-c@fatooh.org>
Link: https://lore.kernel.org/r/20260331215414.368785-1-bugfood-ml@fatooh.org
[groeck: Fixed typo, updated Fixes: reference]
Signed-off-by: Guenter Roeck <linux@roeck-us.net>

authored by

Corey Hickey and committed by
Guenter Roeck
cffff6df 09773978

+6 -1
+6 -1
drivers/hwmon/asus-ec-sensors.c
··· 111 111 ec_sensor_temp_mb, 112 112 /* "T_Sensor" temperature sensor reading [℃] */ 113 113 ec_sensor_temp_t_sensor, 114 + /* like ec_sensor_temp_t_sensor, but at an alternate address [℃] */ 115 + ec_sensor_temp_t_sensor_alt1, 114 116 /* VRM temperature [℃] */ 115 117 ec_sensor_temp_vrm, 116 118 /* VRM east (right) temperature [℃] */ ··· 162 160 #define SENSOR_TEMP_CPU_PACKAGE BIT(ec_sensor_temp_cpu_package) 163 161 #define SENSOR_TEMP_MB BIT(ec_sensor_temp_mb) 164 162 #define SENSOR_TEMP_T_SENSOR BIT(ec_sensor_temp_t_sensor) 163 + #define SENSOR_TEMP_T_SENSOR_ALT1 BIT(ec_sensor_temp_t_sensor_alt1) 165 164 #define SENSOR_TEMP_VRM BIT(ec_sensor_temp_vrm) 166 165 #define SENSOR_TEMP_VRME BIT(ec_sensor_temp_vrme) 167 166 #define SENSOR_TEMP_VRMW BIT(ec_sensor_temp_vrmw) ··· 282 279 EC_SENSOR("VRM", hwmon_temp, 1, 0x00, 0x33), 283 280 [ec_sensor_temp_t_sensor] = 284 281 EC_SENSOR("T_Sensor", hwmon_temp, 1, 0x00, 0x36), 282 + [ec_sensor_temp_t_sensor_alt1] = 283 + EC_SENSOR("T_Sensor", hwmon_temp, 1, 0x00, 0x37), 285 284 [ec_sensor_fan_cpu_opt] = 286 285 EC_SENSOR("CPU_Opt", hwmon_fan, 2, 0x00, 0xb0), 287 286 [ec_sensor_temp_water_in] = ··· 524 519 static const struct ec_board_info board_info_prime_x670e_pro_wifi = { 525 520 .sensors = SENSOR_TEMP_CPU | SENSOR_TEMP_CPU_PACKAGE | 526 521 SENSOR_TEMP_MB | SENSOR_TEMP_VRM | 527 - SENSOR_TEMP_T_SENSOR | SENSOR_FAN_CPU_OPT, 522 + SENSOR_TEMP_T_SENSOR_ALT1 | SENSOR_FAN_CPU_OPT, 528 523 .mutex_path = ACPI_GLOBAL_LOCK_PSEUDO_PATH, 529 524 .family = family_amd_600_series, 530 525 };