Commit ccb7110c authored by Hans de Goede's avatar Hans de Goede Committed by Khalid Elmously

platform/x86: asus-wmi: Only Tell EC the OS will handle display hotkeys from asus_nb_wmi

BugLink: https://bugs.launchpad.net/bugs/1837117

Commit 78f3ac76 ("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: 78f3ac76 ("platform/x86: asus-wmi: Tell the EC the OS will handle the display off hotkey")
Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
(backported from commit 1dd93f87)
[PHLin: context adjustment, only add quirks for models existing in X]
Signed-off-by: default avatarPo-Hsu Lin <po-hsu.lin@canonical.com>
Acked-by: default avatarConnor Kuehl <connor.kuehl@canonical.com>
Acked-by: default avatarKai-Heng Feng <kai.heng.feng@canonical.com>
Signed-off-by: default avatarKhalid Elmously <khalid.elmously@canonical.com>
parent a79a8219
...@@ -57,6 +57,7 @@ static struct quirk_entry *quirks; ...@@ -57,6 +57,7 @@ static struct quirk_entry *quirks;
static struct quirk_entry quirk_asus_unknown = { static struct quirk_entry quirk_asus_unknown = {
.wapf = 0, .wapf = 0,
.wmi_backlight_set_devstate = true,
}; };
/* /*
...@@ -67,15 +68,18 @@ static struct quirk_entry quirk_asus_unknown = { ...@@ -67,15 +68,18 @@ static struct quirk_entry quirk_asus_unknown = {
static struct quirk_entry quirk_asus_x55u = { static struct quirk_entry quirk_asus_x55u = {
.wapf = 4, .wapf = 4,
.wmi_backlight_power = true, .wmi_backlight_power = true,
.wmi_backlight_set_devstate = true,
.no_display_toggle = true, .no_display_toggle = true,
}; };
static struct quirk_entry quirk_asus_wapf4 = { static struct quirk_entry quirk_asus_wapf4 = {
.wapf = 4, .wapf = 4,
.wmi_backlight_set_devstate = true,
}; };
static struct quirk_entry quirk_asus_x200ca = { static struct quirk_entry quirk_asus_x200ca = {
.wapf = 2, .wapf = 2,
.wmi_backlight_set_devstate = true,
}; };
static int dmi_matched(const struct dmi_system_id *dmi) static int dmi_matched(const struct dmi_system_id *dmi)
......
...@@ -2093,7 +2093,7 @@ static int asus_wmi_add(struct platform_device *pdev) ...@@ -2093,7 +2093,7 @@ static int asus_wmi_add(struct platform_device *pdev)
err = asus_wmi_backlight_init(asus); err = asus_wmi_backlight_init(asus);
if (err && err != -ENODEV) if (err && err != -ENODEV)
goto fail_backlight; goto fail_backlight;
} else } else if (asus->driver->quirks->wmi_backlight_set_devstate)
err = asus_wmi_set_devstate(ASUS_WMI_DEVID_BACKLIGHT, 2, NULL); err = asus_wmi_set_devstate(ASUS_WMI_DEVID_BACKLIGHT, 2, NULL);
status = wmi_install_notify_handler(asus->driver->event_guid, status = wmi_install_notify_handler(asus->driver->event_guid,
......
...@@ -42,6 +42,7 @@ struct quirk_entry { ...@@ -42,6 +42,7 @@ struct quirk_entry {
bool scalar_panel_brightness; bool scalar_panel_brightness;
bool store_backlight_power; bool store_backlight_power;
bool wmi_backlight_power; bool wmi_backlight_power;
bool wmi_backlight_set_devstate;
int wapf; int wapf;
/* /*
* For machines with AMD graphic chips, it will send out WMI event * For machines with AMD graphic chips, it will send out WMI event
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment