From: Linus Torvalds Date: Fri, 18 Jul 2014 12:32:51 +0000 (+0200) Subject: ACPI / video: Fix backlight taking 2 steps on a brightness up/down keypress X-Git-Tag: omap-for-v3.17/fixes-against-rc2~142^2~9^2~1 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8ab58e8e7e097bae5fe39cbc67eb93a91f7134b7;p=pandora-kernel.git ACPI / video: Fix backlight taking 2 steps on a brightness up/down keypress In various scenarious userspace will respond to brightness up/down keypresses by increasing/decreasing the backlight brightness itself. If the kernel then also changes the brightness this results in the brightness having changed 2 steps for a single keypress which is undesirable. See e.g. : https://bugs.launchpad.net/gnome-settings-daemon/+bug/527157 http://askubuntu.com/questions/173921/why-does-my-thinkpad-brightness-control-skip-steps This commit delays responding to brightness up/down keypresses by 100 ms and if userspace in that time responds by changing the backlight itself, cancels the kernels own handling of these keypresses, fixing the 2 steps issue. Link: http://marc.info/?l=linux-kernel&m=140535721100839&w=2 [hdegoede@redhat.com: Move the delayed_work struct into struct acpi_video_device instead of having it as a global] [hdegoede@redhat.com: Keep brightness_switch_enabled as a boolean and always delay the keypress handling] Tested-by: Hans de Goede Tested-by: Bjørn Mork Signed-off-by: Hans de Goede Signed-off-by: Rafael J. Wysocki --- Reading git-diff-tree failed