]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
platform/x86: asus-wmi: Only Tell EC the OS will handle display hotkeys from asus_nb_wmi
authorHans de Goede <hdegoede@redhat.com>
Wed, 12 Jun 2019 07:02:02 +0000 (09:02 +0200)
committerAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Wed, 12 Jun 2019 08:49:20 +0000 (11:49 +0300)
Commit 78f3ac76d9e5 ("platform/x86: asus-wmi: Tell the EC the OS will
handle the display off hotkey") causes the backlight to be permanently off
on various EeePC laptop models using the eeepc-wmi driver (Asus EeePC
1015BX, Asus EeePC 1025C).

The asus_wmi_set_devstate(ASUS_WMI_DEVID_BACKLIGHT, 2, NULL) call added
by that commit is made conditional in this commit and only enabled in
the quirk_entry structs in the asus-nb-wmi driver fixing the broken
display / backlight on various EeePC laptop models.

Cc: João Paulo Rechi Vita <jprvita@endlessm.com>
Fixes: 78f3ac76d9e5 ("platform/x86: asus-wmi: Tell the EC the OS will handle the display off hotkey")
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
drivers/platform/x86/asus-nb-wmi.c
drivers/platform/x86/asus-wmi.c
drivers/platform/x86/asus-wmi.h

index 81642102bf65a077a3f4e4882f7aca5f0c7f99a2..8d9e30dbb5af58df58c93c4f17a4a42382e92ba3 100644 (file)
@@ -65,10 +65,12 @@ static bool asus_q500a_i8042_filter(unsigned char data, unsigned char str,
 
 static struct quirk_entry quirk_asus_unknown = {
        .wapf = 0,
+       .wmi_backlight_set_devstate = true,
 };
 
 static struct quirk_entry quirk_asus_q500a = {
        .i8042_filter = asus_q500a_i8042_filter,
+       .wmi_backlight_set_devstate = true,
 };
 
 /*
@@ -79,26 +81,32 @@ static struct quirk_entry quirk_asus_q500a = {
 static struct quirk_entry quirk_asus_x55u = {
        .wapf = 4,
        .wmi_backlight_power = true,
+       .wmi_backlight_set_devstate = true,
        .no_display_toggle = true,
 };
 
 static struct quirk_entry quirk_asus_wapf4 = {
        .wapf = 4,
+       .wmi_backlight_set_devstate = true,
 };
 
 static struct quirk_entry quirk_asus_x200ca = {
        .wapf = 2,
+       .wmi_backlight_set_devstate = true,
 };
 
 static struct quirk_entry quirk_asus_ux303ub = {
        .wmi_backlight_native = true,
+       .wmi_backlight_set_devstate = true,
 };
 
 static struct quirk_entry quirk_asus_x550lb = {
+       .wmi_backlight_set_devstate = true,
        .xusb2pr = 0x01D9,
 };
 
 static struct quirk_entry quirk_asus_forceals = {
+       .wmi_backlight_set_devstate = true,
        .wmi_force_als_set = true,
 };
 
index 3e4336025e8f35b9d790a38b8e124a22e1a120a4..9b18a184e0aac89c58232681bbd5ab689cae0e2f 100644 (file)
@@ -2146,7 +2146,7 @@ static int asus_wmi_add(struct platform_device *pdev)
                err = asus_wmi_backlight_init(asus);
                if (err && err != -ENODEV)
                        goto fail_backlight;
-       } else
+       } else if (asus->driver->quirks->wmi_backlight_set_devstate)
                err = asus_wmi_set_devstate(ASUS_WMI_DEVID_BACKLIGHT, 2, NULL);
 
        if (asus_wmi_has_fnlock_key(asus)) {
index 0930be770688a1326a18cd27d4688e83dde507ed..4f31b68642a08380c63f993dd5702e51666d32c0 100644 (file)
@@ -31,6 +31,7 @@ struct quirk_entry {
        bool store_backlight_power;
        bool wmi_backlight_power;
        bool wmi_backlight_native;
+       bool wmi_backlight_set_devstate;
        bool wmi_force_als_set;
        int wapf;
        /*