51fdf98
Bugzilla: 1012674
51fdf98
Upstream-status: Queued for 3.16
51fdf98
51fdf98
From d8aceabf18681a92e8031c43d3917f6826ac6691 Mon Sep 17 00:00:00 2001
51fdf98
From: Hans de Goede <hdegoede@redhat.com>
51fdf98
Date: Mon, 2 Jun 2014 17:41:05 +0200
51fdf98
Subject: [PATCH 08/14] acer-wmi: Switch to acpi_video_unregister_backlight
51fdf98
51fdf98
Switch from acpi_video_unregister(), to acpi_video_unregister_backlight(),
51fdf98
so that the hotkeys handler registered by acpi-video stays in place.
51fdf98
51fdf98
Since there are no mappings for the atkbd raw codes for the brightness
51fdf98
keys used by newer Acer models in /lib/udev/hwdb.d/60-keyboard.hwdb, and
51fdf98
since we map the wmi events with a code of KE_IGNORE, we rely on acpi-video
51fdf98
to do the hotkey handling for us.
51fdf98
51fdf98
For laptops such as the Acer Aspire 5750 which uses intel gfx this works
51fdf98
despite us calling acpi_video_unregister() because the following happens:
51fdf98
51fdf98
1) acpi-video module gets loaded (as it is a dependency of acer-wmi and i915)
51fdf98
2) acpi-video does NOT call acpi_video_register()
51fdf98
3) acer-wmi loads (assume it loads before i915), calls
51fdf98
acpi_video_dmi_promote_vendor(); which sets ACPI_VIDEO_BACKLIGHT_DMI_VENDOR
51fdf98
4) calls acpi_video_unregister -> not registered, nop
51fdf98
5) i915 loads, calls acpi_video_register
51fdf98
6) acpi_video_register registers the acpi_notifier for the hotkeys,
51fdf98
   does NOT register a backlight device because of ACPI_VIDEO_BACKLIGHT_DMI_VENDOR
51fdf98
51fdf98
But on the Acer Aspire 5750G, which uses nvidia graphics the following happens:
51fdf98
1) acpi-video module gets loaded (as it is a dependency of acer-wmi)
51fdf98
2) acpi-video calls acpi_video_register()
51fdf98
3) acpi_video_register registers the acpi_notifier for the hotkeys,
51fdf98
   and a backlight device
51fdf98
4) acer-wmi loads, calls acpi_video_dmi_promote_vendor()
51fdf98
5) calls acpi_video_unregister, this unregisters BOTH the acpi_notifier for
51fdf98
   the hotkeys AND the backlight device
51fdf98
51fdf98
And we end up without any handler for the brightness hotkeys. This patch fixes
51fdf98
this by switching over to acpi_video_unregister_backlight() which keeps the
51fdf98
hotkey handler in place.
51fdf98
51fdf98
https://bugzilla.kernel.org/show_bug.cgi?id=35622
51fdf98
51fdf98
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
51fdf98
---
51fdf98
 drivers/platform/x86/acer-wmi.c | 2 +-
51fdf98
 1 file changed, 1 insertion(+), 1 deletion(-)
51fdf98
51fdf98
diff --git a/drivers/platform/x86/acer-wmi.c b/drivers/platform/x86/acer-wmi.c
51fdf98
index c91f69b39db4..3a746998f92a 100644
51fdf98
--- a/drivers/platform/x86/acer-wmi.c
51fdf98
+++ b/drivers/platform/x86/acer-wmi.c
51fdf98
@@ -2228,7 +2228,7 @@ static int __init acer_wmi_init(void)
51fdf98
 		pr_info("Brightness must be controlled by acpi video driver\n");
51fdf98
 	} else {
51fdf98
 		pr_info("Disabling ACPI video driver\n");
51fdf98
-		acpi_video_unregister();
51fdf98
+		acpi_video_unregister_backlight();
51fdf98
 	}
51fdf98
 
51fdf98
 	if (wmi_has_guid(WMID_GUID3)) {
51fdf98
-- 
51fdf98
1.9.0
51fdf98