Skip to contentSkip to conversation

platform/x86: acer-wmi: Extend support for Acer Nitro AN515-58

PATCH In review Armin Wolf 2 participants 5 messages Jan 8 – Jan 20

Subsystems (2)
lore
Share & tools
lore

Armin Wolf

author
#0 lore raw

PATCH 1/2 platform/x86: acer-wmi: Extend support for Acer Nitro AN515-58

The Acer Nitro AN515-58 additionally supports fan control. Modify the quirk list to enable said feature on this machine.

---
 drivers/platform/x86/acer-wmi.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/platform/x86/acer-wmi.c +6 -1
index bf97381faf58..54ca3edf532a 100644
@@ -455,6 +455,11 @@ static struct quirk_entry quirk_acer_travelmate_2490 = {
 	.mailled = 1,
 };
 
+static struct quirk_entry quirk_acer_nitro_an515_58 = {
+	.predator_v4 = 1,
+	.pwm = 1,
+};
+
 static struct quirk_entry quirk_acer_predator_ph315_53 = {
 	.turbo = 1,
 	.cpu_fans = 1,
@@ -655,7 +660,7 @@ static const struct dmi_system_id acer_quirks[] __initconst = {
 			DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
 			DMI_MATCH(DMI_PRODUCT_NAME, "Nitro AN515-58"),
 		},
-		.driver_data = &quirk_acer_predator_v4,
+		.driver_data = &quirk_acer_nitro_an515_58,
 	},
 	{
 		.callback = dmi_matched,
Signature · 1 line
2.52.0
author
#1 lore raw

PATCH 2/2 platform/x86: acer-wmi: Fix missing capability check

During the rework of the fan behavior control code in commit d8e8362b09d3 ("platform/x86: acer-wmi: Fix setting of fan behavior"), acer_toggle_turbo() was changed to use WMID_gaming_set_fan_behavior() instead of WMID_gaming_set_u64() when switching the fans to turbo mode. The new function however does not check if the necessary capability (ACER_CAP_TURBO_FAN) is actually enabled on a given machine, causing the driver to potentially access unsupported features.

Fix this by manually checking if ACER_CAP_TURBO_FAN is enabled on a given machine before changing the fan mode.

Fixes d8e8362b09d3 ("platform/x86: acer-wmi: Fix setting of fan behavior")
---
 drivers/platform/x86/acer-wmi.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/platform/x86/acer-wmi.c +4 -2
index 54ca3edf532a..e0eaaefb13d0 100644
@@ -2070,7 +2070,8 @@ static int acer_toggle_turbo(void)
 		WMID_gaming_set_u64(0x1, ACER_CAP_TURBO_LED);
 
 		/* Set FAN mode to auto */
-		WMID_gaming_set_fan_mode(ACER_WMID_FAN_MODE_AUTO);
+		if (has_cap(ACER_CAP_TURBO_FAN))
+			WMID_gaming_set_fan_mode(ACER_WMID_FAN_MODE_AUTO);
 
 		/* Set OC to normal */
 		if (has_cap(ACER_CAP_TURBO_OC)) {
@@ -2084,7 +2085,8 @@ static int acer_toggle_turbo(void)
 		WMID_gaming_set_u64(0x10001, ACER_CAP_TURBO_LED);
 
 		/* Set FAN mode to turbo */
-		WMID_gaming_set_fan_mode(ACER_WMID_FAN_MODE_TURBO);
+		if (has_cap(ACER_CAP_TURBO_FAN))
+			WMID_gaming_set_fan_mode(ACER_WMID_FAN_MODE_TURBO);
 
 		/* Set OC to turbo mode */
 		if (has_cap(ACER_CAP_TURBO_OC)) {
Signature · 1 line
2.52.0
author
#2 lore raw
In reply to Armin Wolf

Am 08.01.26 um 17:45 schrieb Armin Wolf:

Quoted 2 lines

The Acer Nitro AN515-58 additionally supports fan control. Modify the quirk list to enable said feature on this machine.

Any updates on this?

Thanks,
Armin Wolf

Quoted 33 lines
---
  drivers/platform/x86/acer-wmi.c | 7 ++++++-
  1 file changed, 6 insertions(+), 1 deletion(-)
drivers/platform/x86/acer-wmi.c +6 -1
index bf97381faf58..54ca3edf532a 100644
@@ -455,6 +455,11 @@ static struct quirk_entry quirk_acer_travelmate_2490 = {
  	.mailled = 1,
  };
 
+static struct quirk_entry quirk_acer_nitro_an515_58 = {
+	.predator_v4 = 1,
+	.pwm = 1,
+};
+
  static struct quirk_entry quirk_acer_predator_ph315_53 = {
  	.turbo = 1,
  	.cpu_fans = 1,
@@ -655,7 +660,7 @@ static const struct dmi_system_id acer_quirks[] __initconst = {
  			DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
  			DMI_MATCH(DMI_PRODUCT_NAME, "Nitro AN515-58"),
  		},
-		.driver_data = &quirk_acer_predator_v4,
+		.driver_data = &quirk_acer_nitro_an515_58,
  	},
  	{
  		.callback = dmi_matched,
maintainer
#3 lore raw
Quoted 6 lines · Armin Wolf

Am 08.01.26 um 17:45 schrieb Armin Wolf:

Quoted 2 lines

The Acer Nitro AN515-58 additionally supports fan control. Modify the quirk list to enable said feature on this machine.

Any updates on this?

Hi,

I'm sorry, I thought I had applied this (and it was marked as accepted in patchwork as well as a result) but apparently hadn't. Thanks for the reminder.

Now it's in the review-ilpo-fixes branch.

Signature · 1 line
 i.
author
#4 lore raw

Am 20.01.26 um 16:13 schrieb Ilpo Järvinen:

Quoted 6 lines · Armin Wolf
Quoted 5 lines

Am 08.01.26 um 17:45 schrieb Armin Wolf:

Quoted 2 lines

The Acer Nitro AN515-58 additionally supports fan control. Modify the quirk list to enable said feature on this machine.

Quoted 9 lines
Quoted 1 line

Any updates on this?

Hi,

I'm sorry, I thought I had applied this (and it was marked as accepted in patchwork as well as a result) but apparently hadn't. Thanks for the reminder.

Now it's in the review-ilpo-fixes branch.

Mistakes happen, thank you :).