summaryrefslogtreecommitdiff
path: root/drivers/platform
diff options
context:
space:
mode:
authorMichał Kępień <kernel@kempniu.pl>2017-04-05 09:49:09 +0300
committerDarren Hart (VMware) <dvhart@infradead.org>2017-04-13 20:16:07 +0300
commit5959ddd02be4e435da866ee065187f5c8bccea28 (patch)
tree4f780c19b952940d783fdc501ab6d9cd6cc4b8c6 /drivers/platform
parentd75a4a972ad1ed6d1326c63ae2fb0f9586161b4d (diff)
downloadlinux-5959ddd02be4e435da866ee065187f5c8bccea28.tar.xz
platform/x86: fujitsu-laptop: account for backlight power when determining brightness
The comment for the get_brightness backlight device callback in include/linux/backlight.h states that it should "return the current backlight brightness (accounting for power, fb_blank etc.)". fujitsu-laptop violates that premise by simply returning the value to which ACPI function GBLL evaluates to. Make sure 0 is returned when backlight power is turned off. 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')
-rw-r--r--drivers/platform/x86/fujitsu-laptop.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/platform/x86/fujitsu-laptop.c b/drivers/platform/x86/fujitsu-laptop.c
index af36b15515ed..b88172134063 100644
--- a/drivers/platform/x86/fujitsu-laptop.c
+++ b/drivers/platform/x86/fujitsu-laptop.c
@@ -423,7 +423,7 @@ static int get_max_brightness(void)
static int bl_get_brightness(struct backlight_device *b)
{
- return get_lcd_level();
+ return b->props.power == FB_BLANK_POWERDOWN ? 0 : get_lcd_level();
}
static int bl_update_status(struct backlight_device *b)