]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
platform/x86: asus-wmi: Add quirk for ROG Ally X
authorLuke D. Jones <luke@ljones.dev>
Mon, 5 Aug 2024 23:46:03 +0000 (11:46 +1200)
committerIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Tue, 13 Aug 2024 08:00:26 +0000 (11:00 +0300)
The new ROG Ally X functions the same as the previus model so we can use
the same method to ensure the MCU USB devices wake and reconnect
correctly.

Given that two devices marks the start of a trend, this patch also adds
a quirk table to make future additions easier if the MCU is the same.

Signed-off-by: Luke D. Jones <luke@ljones.dev>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://lore.kernel.org/r/20240805234603.38736-1-luke@ljones.dev
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
drivers/platform/x86/asus-wmi.c

index cc735931f97b93be2329e2039d22994456a16584..37636e5a38e3b52f8c46bcb0344693fb1a7c0708 100644 (file)
@@ -146,6 +146,20 @@ static const char * const ashs_ids[] = { "ATK4001", "ATK4002", NULL };
 
 static int throttle_thermal_policy_write(struct asus_wmi *);
 
+static const struct dmi_system_id asus_ally_mcu_quirk[] = {
+       {
+               .matches = {
+                       DMI_MATCH(DMI_BOARD_NAME, "RC71L"),
+               },
+       },
+       {
+               .matches = {
+                       DMI_MATCH(DMI_BOARD_NAME, "RC72L"),
+               },
+       },
+       { },
+};
+
 static bool ashs_present(void)
 {
        int i = 0;
@@ -4685,7 +4699,7 @@ static int asus_wmi_add(struct platform_device *pdev)
        asus->dgpu_disable_available = asus_wmi_dev_is_present(asus, ASUS_WMI_DEVID_DGPU);
        asus->kbd_rgb_state_available = asus_wmi_dev_is_present(asus, ASUS_WMI_DEVID_TUF_RGB_STATE);
        asus->ally_mcu_usb_switch = acpi_has_method(NULL, ASUS_USB0_PWR_EC0_CSEE)
-                                               && dmi_match(DMI_BOARD_NAME, "RC71L");
+                                               && dmi_check_system(asus_ally_mcu_quirk);
 
        if (asus_wmi_dev_is_present(asus, ASUS_WMI_DEVID_MINI_LED_MODE))
                asus->mini_led_dev_id = ASUS_WMI_DEVID_MINI_LED_MODE;