platform/x86: asus-wmi: Disable OOBE experience on Zenbook S 16
authorBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Mon, 9 Sep 2024 22:35:03 +0000 (00:35 +0200)
committerIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Tue, 10 Sep 2024 12:43:58 +0000 (15:43 +0300)
The OOBE experience fades the keyboard backlight in & out continuously,
and make the backlight uncontrollable using its device.

Workaround taken from
https://wiki.archlinux.org/index.php?title=ASUS_Zenbook_UM5606&diff=next&oldid=815547

Signed-off-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Luke D. Jones <luke@ljones.dev>
Link: https://lore.kernel.org/r/20240909223503.1445779-1-bas@basnieuwenhuizen.nl
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
drivers/platform/x86/asus-wmi.c
include/linux/platform_data/x86/asus-wmi.h

index 37636e5a38e3b52f8c46bcb0344693fb1a7c0708..321a658e4554113e22fe218cb1a8e74c24a3901f 100644 (file)
@@ -1793,6 +1793,16 @@ static int asus_wmi_led_init(struct asus_wmi *asus)
                        goto error;
        }
 
+       if (asus_wmi_dev_is_present(asus, ASUS_WMI_DEVID_OOBE)) {
+               /*
+                * Disable OOBE state, so that e.g. the keyboard backlight
+                * works.
+                */
+               rv = asus_wmi_set_devstate(ASUS_WMI_DEVID_OOBE, 1, NULL);
+               if (rv)
+                       goto error;
+       }
+
 error:
        if (rv)
                asus_wmi_led_exit(asus);
index 0aeeae1c19430b1c8ba2907b02ea63e0d5451fd2..ae9bf7479e7be214e9636847e7c74e87929b6c01 100644 (file)
@@ -62,6 +62,7 @@
 #define ASUS_WMI_DEVID_KBD_BACKLIGHT   0x00050021
 #define ASUS_WMI_DEVID_LIGHT_SENSOR    0x00050022 /* ?? */
 #define ASUS_WMI_DEVID_LIGHTBAR                0x00050025
+#define ASUS_WMI_DEVID_OOBE            0x0005002F
 /* This can only be used to disable the screen, not re-enable */
 #define ASUS_WMI_DEVID_SCREENPAD_POWER 0x00050031
 /* Writing a brightness re-enables the screen if disabled */