All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] platform/x86: hp-wmi: Add Victus 15-fb0xxx fan control
@ 2026-05-07 10:13 jR4dh3y
  2026-05-07 11:20 ` Ilpo Järvinen
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: jR4dh3y @ 2026-05-07 10:13 UTC (permalink / raw)
  To: platform-driver-x86; +Cc: ilpo.jarvinen, hdegoede, jR4dh3y

HP Victus 15-fb0xxx board 8A3D supports the same WMI fan speed
set command used by the Victus manual fan control path, but it is
not a Victus S thermal-profile board.

Enable the hwmon PWM manual fan interface for this board without
adding it to the Victus S thermal profile DMI table. This preserves
the existing generic platform-profile choices on this machine.

The board does not expose a Victus S fan table, so use the RPM limits
validated on hardware: CPU fan 2600-5800 RPM, GPU fan about 300 RPM
higher.

Compile-tested against 7.0.3-1-cachyos-bore-lto. The WMI fan-speed
set path was validated on a Victus by HP Gaming Laptop 15-fb0xxx with
board 8A3D and BIOS F.22.

Signed-off-by: jR4dh3y <radheykalra901@gmail.com>
---
 drivers/platform/x86/hp/hp-wmi.c | 56 +++++++++++++++++++++++++-------
 1 file changed, 45 insertions(+), 11 deletions(-)

diff --git a/drivers/platform/x86/hp/hp-wmi.c b/drivers/platform/x86/hp/hp-wmi.c
index 304d9ac..b2a6d50 100644
--- a/drivers/platform/x86/hp/hp-wmi.c
+++ b/drivers/platform/x86/hp/hp-wmi.c
@@ -204,6 +204,11 @@ static const struct dmi_system_id victus_s_thermal_profile_boards[] __initconst
 	{},
 };
 
+/* DMI Board names of Victus laptops with the Victus fan-control WMI calls. */
+static const char * const victus_fan_control_boards[] = {
+	"8A3D", /* Victus by HP Gaming Laptop 15-fb0xxx */
+};
+
 static bool is_victus_s_board;
 
 enum hp_wmi_radio {
@@ -1715,6 +1720,22 @@ static bool is_victus_s_thermal_profile(void)
 	return is_victus_s_board;
 }
 
+static bool is_victus_fan_control(void)
+{
+	const char *board_name;
+
+	if (is_victus_s_thermal_profile())
+		return true;
+
+	board_name = dmi_get_system_info(DMI_BOARD_NAME);
+	if (!board_name)
+		return false;
+
+	return match_string(victus_fan_control_boards,
+			    ARRAY_SIZE(victus_fan_control_boards),
+			    board_name) >= 0;
+}
+
 static int victus_s_gpu_thermal_profile_get(bool *ctgp_enable,
 					    bool *ppab_enable,
 					    u8 *dstate,
@@ -2324,7 +2345,7 @@ static int hp_wmi_apply_fan_settings(struct hp_wmi_hwmon_priv *priv)
 
 	switch (priv->mode) {
 	case PWM_MODE_MAX:
-		if (is_victus_s_thermal_profile())
+		if (is_victus_fan_control())
 			hp_wmi_get_fan_count_userdefine_trigger();
 		ret = hp_wmi_fan_speed_max_set(1);
 		if (ret < 0)
@@ -2333,7 +2354,7 @@ static int hp_wmi_apply_fan_settings(struct hp_wmi_hwmon_priv *priv)
 				      secs_to_jiffies(KEEP_ALIVE_DELAY_SECS));
 		return 0;
 	case PWM_MODE_MANUAL:
-		if (!is_victus_s_thermal_profile())
+		if (!is_victus_fan_control())
 			return -EOPNOTSUPP;
 		ret = hp_wmi_fan_speed_set(priv, pwm_to_rpm(priv->pwm, priv));
 		if (ret < 0)
@@ -2342,7 +2363,7 @@ static int hp_wmi_apply_fan_settings(struct hp_wmi_hwmon_priv *priv)
 				      secs_to_jiffies(KEEP_ALIVE_DELAY_SECS));
 		return 0;
 	case PWM_MODE_AUTO:
-		if (is_victus_s_thermal_profile()) {
+		if (is_victus_fan_control()) {
 			hp_wmi_get_fan_count_userdefine_trigger();
 			ret = hp_wmi_fan_speed_max_reset(priv);
 		} else {
@@ -2366,7 +2387,7 @@ static umode_t hp_wmi_hwmon_is_visible(const void *data,
 {
 	switch (type) {
 	case hwmon_pwm:
-		if (attr == hwmon_pwm_input && !is_victus_s_thermal_profile())
+		if (attr == hwmon_pwm_input && !is_victus_fan_control())
 			return 0;
 		return 0644;
 	case hwmon_fan:
@@ -2404,10 +2425,13 @@ static int hp_wmi_hwmon_read(struct device *dev, enum hwmon_sensor_types type,
 		return 0;
 	case hwmon_pwm:
 		if (attr == hwmon_pwm_input) {
-			if (!is_victus_s_thermal_profile())
+			if (!is_victus_fan_control())
 				return -EOPNOTSUPP;
 
-			rpm = hp_wmi_get_fan_speed_victus_s(channel);
+			if (is_victus_s_thermal_profile())
+				rpm = hp_wmi_get_fan_speed_victus_s(channel);
+			else
+				rpm = hp_wmi_get_fan_speed(channel);
 			if (rpm < 0)
 				return rpm;
 			*val = rpm_to_pwm(rpm / 100, priv);
@@ -2438,7 +2462,7 @@ static int hp_wmi_hwmon_write(struct device *dev, enum hwmon_sensor_types type,
 	switch (type) {
 	case hwmon_pwm:
 		if (attr == hwmon_pwm_input) {
-			if (!is_victus_s_thermal_profile())
+			if (!is_victus_fan_control())
 				return -EOPNOTSUPP;
 			/* PWM input is invalid when not in manual mode */
 			if (priv->mode != PWM_MODE_MANUAL)
@@ -2455,13 +2479,16 @@ static int hp_wmi_hwmon_write(struct device *dev, enum hwmon_sensor_types type,
 			priv->mode = PWM_MODE_MAX;
 			return hp_wmi_apply_fan_settings(priv);
 		case PWM_MODE_MANUAL:
-			if (!is_victus_s_thermal_profile())
+			if (!is_victus_fan_control())
 				return -EOPNOTSUPP;
 			/*
 			 * When switching to manual mode, set fan speed to
 			 * current RPM values to ensure a smooth transition.
 			 */
-			rpm = hp_wmi_get_fan_speed_victus_s(channel);
+			if (is_victus_s_thermal_profile())
+				rpm = hp_wmi_get_fan_speed_victus_s(channel);
+			else
+				rpm = hp_wmi_get_fan_speed(channel);
 			if (rpm < 0)
 				return rpm;
 			priv->pwm = rpm_to_pwm(rpm / 100, priv);
@@ -2519,9 +2546,16 @@ static int hp_wmi_setup_fan_settings(struct hp_wmi_hwmon_priv *priv)
 	/* Default behaviour on hwmon init is automatic mode */
 	priv->mode = PWM_MODE_AUTO;
 
-	/* Bypass all non-Victus S devices */
-	if (!is_victus_s_thermal_profile())
+	/* Bypass devices without the Victus fan-control WMI calls. */
+	if (!is_victus_fan_control())
+		return 0;
+
+	if (!is_victus_s_thermal_profile()) {
+		priv->min_rpm = 26;
+		priv->max_rpm = 58;
+		priv->gpu_delta = 3;
 		return 0;
+	}
 
 	ret = hp_wmi_perform_query(HPWMI_VICTUS_S_GET_FAN_TABLE_QUERY,
 				   HPWMI_GM, &fan_data, 4, sizeof(fan_data));
-- 
2.54.0


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

end of thread, other threads:[~2026-05-16  9:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-07 10:13 [PATCH] platform/x86: hp-wmi: Add Victus 15-fb0xxx fan control jR4dh3y
2026-05-07 11:20 ` Ilpo Järvinen
2026-05-07 19:15 ` Krishna Chomal
2026-05-07 20:13   ` Radhey Kalra
2026-05-16  9:05 ` [PATCH v2] " Radhey Kalra

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.