Patchwork thinkpad-acpi: fix issuing duplicated key events for brightness up/down

login
register
mail settings
Submitter Alex Hung
Date Nov. 29, 2012, 7:02 a.m.
Message ID <1354172551-3916-2-git-send-email-alex.hung@canonical.com>
Download mbox | patch
Permalink /patch/202721/
State New
Headers show

Comments

Alex Hung - Nov. 29, 2012, 7:02 a.m.
The tp_features.bright_acpimode will not be set correctly for brightness
control because ACPI_VIDEO_HID will not be located in ACPI. As a result,
a duplicated key event will always be sent. acpi_video_backlight_support()
is sufficient to detect standard ACPI brightness control.

Signed-off-by: Alex Hung <alex.hung@canonical.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
---
 drivers/platform/x86/thinkpad_acpi.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Tim Gardner - Nov. 29, 2012, 12:27 p.m.
This appears to be upstream commit ff413195e830541afeae469fc866ecd0319abd7e

https://bugs.launchpad.net/ubuntu/+source/linux/+bug/841315/comments/4

rtg
Herton Ronaldo Krzesinski - Nov. 29, 2012, 12:55 p.m.

Patch

diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
index d68c000..8b5610d 100644
--- a/drivers/platform/x86/thinkpad_acpi.c
+++ b/drivers/platform/x86/thinkpad_acpi.c
@@ -3402,7 +3402,7 @@  static int __init hotkey_init(struct ibm_init_struct *iibm)
 	/* Do not issue duplicate brightness change events to
 	 * userspace. tpacpi_detect_brightness_capabilities() must have
 	 * been called before this point  */
-	if (tp_features.bright_acpimode && acpi_video_backlight_support()) {
+	if (acpi_video_backlight_support()) {
 		pr_info("This ThinkPad has standard ACPI backlight "
 			"brightness control, supported by the ACPI "
 			"video driver\n");