aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/platform/x86/fujitsu-laptop.c
diff options
context:
space:
mode:
authorMichał Kępień <kernel@kempniu.pl>2017-04-05 08:49:04 +0200
committerDarren Hart (VMware) <dvhart@infradead.org>2017-04-13 10:16:05 -0700
commitbd079a2cc5afe3d980f054a72bc08dbbe17c216c (patch)
treed5ac0b65310bb34cb99a4e3796c0707576ff2e76 /drivers/platform/x86/fujitsu-laptop.c
parentplatform/x86: fujitsu-laptop: simplify set_lcd_level() (diff)
downloadlinux-dev-bd079a2cc5afe3d980f054a72bc08dbbe17c216c.tar.xz
linux-dev-bd079a2cc5afe3d980f054a72bc08dbbe17c216c.zip
platform/x86: fujitsu-laptop: sync brightness in set_lcd_level()
When using brightness keys and backlight device's sysfs interface alternately, an incorrect input event might be generated for a brightness key press. Consider the following sequence of events: 1. Set backlight brightness to 6 using brightness keys. 2. Write 4 to /sys/class/backlight/fujitsu-laptop/brightness. 3. Press the "brightness up" key. The input event generated in this scenario would be KEY_BRIGHTNESSDOWN, because before step 3 brightness_level would still be at 6. As the new brightness level is established using GBLL, it would evaluate to 5 (SBLL/SBL2 sets it to 4 in step 2 and pressing the "brightness up" key increases it by 1). This in turn would cause acpi_fujitsu_bl_notify() to observe a 6 -> 5 change, i.e. a decrease in brightness, while screen brightness would in fact be increased. Fix this by updating brightness_level in set_lcd_level. Signed-off-by: Michał Kępień <kernel@kempniu.pl> Reviewed-by: Jonathan Woithe <jwoithe@just42.net> Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
Diffstat (limited to 'drivers/platform/x86/fujitsu-laptop.c')
-rw-r--r--drivers/platform/x86/fujitsu-laptop.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/platform/x86/fujitsu-laptop.c b/drivers/platform/x86/fujitsu-laptop.c
index 066ffe734a5f..4c3bba0ceb04 100644
--- a/drivers/platform/x86/fujitsu-laptop.c
+++ b/drivers/platform/x86/fujitsu-laptop.c
@@ -369,6 +369,8 @@ static int set_lcd_level(int level)
return -ENODEV;
}
+ fujitsu_bl->brightness_level = level;
+
return 0;
}