Skip to contentSkip to conversation

alienware-wmi: Fix X Series and G Series quirks

PATCH Superseded Kurt Borja 2 participants 2 messages Dec 7, 2024

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Kurt Borja

author maintainer
#0 lore raw

PATCH 1/1 alienware-wmi: Fix X Series and G Series quirks

Devices that are known to support the WMI thermal interface do not support the legacy LED control interface. Make .num_zones = 0 and avoid calling alienware_zone_init() if that's the case.

Verified by reading the ACPI tables of all supported devices.

Fixes 9f6c43041552 ("alienware-wmi: added platform profile support")
Fixes 1c1eb70e7d23 ("alienware-wmi: extends the list of supported models")

---
Suggested here:

[1] https://lore.kernel.org/platform-driver-x86/[email protected]/

---
 drivers/platform/x86/dell/alienware-wmi.c | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)
drivers/platform/x86/dell/alienware-wmi.c +10 -5
index 77465ed9b449..e69bf9a7b6c8 100644
@@ -190,7 +190,7 @@ static struct quirk_entry quirk_asm201 = {
 };
 
 static struct quirk_entry quirk_g_series = {
-	.num_zones = 2,
+	.num_zones = 0,
 	.hdmi_mux = 0,
 	.amplifier = 0,
 	.deepslp = 0,
@@ -199,7 +199,7 @@ static struct quirk_entry quirk_g_series = {
 };
 
 static struct quirk_entry quirk_x_series = {
-	.num_zones = 2,
+	.num_zones = 0,
 	.hdmi_mux = 0,
 	.amplifier = 0,
 	.deepslp = 0,
@@ -687,6 +687,9 @@ static void alienware_zone_exit(struct platform_device *dev)
 {
 	u8 zone;
 
+	if (!quirks->num_zones)
+		return;
+
 	sysfs_remove_group(&dev->dev.kobj, &zone_attribute_group);
 	led_classdev_unregister(&global_led);
 	if (zone_dev_attrs) {
@@ -1229,9 +1232,11 @@ static int __init alienware_wmi_init(void)
 			goto fail_prep_thermal_profile;
 	}
 
-	ret = alienware_zone_init(platform_device);
-	if (ret)
-		goto fail_prep_zones;
+	if (quirks->num_zones > 0) {
+		ret = alienware_zone_init(platform_device);
+		if (ret)
+			goto fail_prep_zones;
+	}
 
 	return 0;
 
Signature · 1 line
2.47.1
Reviewed-by on v1 1/1
#1 lore raw

Am 07.12.24 um 06:38 schrieb Kurt Borja:

Quoted 11 lines

Devices that are known to support the WMI thermal interface do not support the legacy LED control interface. Make .num_zones = 0 and avoid calling alienware_zone_init() if that's the case.

Verified by reading the ACPI tables of all supported devices.

Fixes 9f6c43041552 ("alienware-wmi: added platform profile support")
Fixes 1c1eb70e7d23 ("alienware-wmi: extends the list of supported models")

Please remove the empty line after the Fixes tags. With that being addressed:

Quoted 55 lines

---
Suggested here:

[1] https://lore.kernel.org/platform-driver-x86/[email protected]/

---
  drivers/platform/x86/dell/alienware-wmi.c | 15 ++++++++++-----
  1 file changed, 10 insertions(+), 5 deletions(-)
drivers/platform/x86/dell/alienware-wmi.c +10 -5
index 77465ed9b449..e69bf9a7b6c8 100644
@@ -190,7 +190,7 @@ static struct quirk_entry quirk_asm201 = {
  };
 
  static struct quirk_entry quirk_g_series = {
-	.num_zones = 2,
+	.num_zones = 0,
  	.hdmi_mux = 0,
  	.amplifier = 0,
  	.deepslp = 0,
@@ -199,7 +199,7 @@ static struct quirk_entry quirk_g_series = {
  };
 
  static struct quirk_entry quirk_x_series = {
-	.num_zones = 2,
+	.num_zones = 0,
  	.hdmi_mux = 0,
  	.amplifier = 0,
  	.deepslp = 0,
@@ -687,6 +687,9 @@ static void alienware_zone_exit(struct platform_device *dev)
  {
  	u8 zone;
 
+	if (!quirks->num_zones)
+		return;
+
  	sysfs_remove_group(&dev->dev.kobj, &zone_attribute_group);
  	led_classdev_unregister(&global_led);
  	if (zone_dev_attrs) {
@@ -1229,9 +1232,11 @@ static int __init alienware_wmi_init(void)
  			goto fail_prep_thermal_profile;
  	}
 
-	ret = alienware_zone_init(platform_device);
-	if (ret)
-		goto fail_prep_zones;
+	if (quirks->num_zones > 0) {
+		ret = alienware_zone_init(platform_device);
+		if (ret)
+			goto fail_prep_zones;
+	}
 
  	return 0;