2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-25 13:43:55 +08:00

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>
This commit is contained in:
Michał Kępień 2017-04-05 08:49:09 +02:00 committed by Darren Hart (VMware)
parent d75a4a972a
commit 5959ddd02b

View File

@ -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)