Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1612910 > unrolled thread

[PATCH 10/11] platform/x86: fujitsu-laptop: account for backlight power when determining brightness

Started byMichał Kępień <kernel@kempniu.pl>
First post2017-03-30 12:40 +0200
Last post2017-03-30 12:40 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 10/11] platform/x86: fujitsu-laptop: account for backlight power when determining brightness Michał Kępień <kernel@kempniu.pl> - 2017-03-30 12:40 +0200

#1612910 — [PATCH 10/11] platform/x86: fujitsu-laptop: account for backlight power when determining brightness

FromMichał Kępień <kernel@kempniu.pl>
Date2017-03-30 12:40 +0200
Subject[PATCH 10/11] platform/x86: fujitsu-laptop: account for backlight power when determining brightness
Message-ID<tqFEK-4YK-19@gated-at.bofh.it>
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>
---
 drivers/platform/x86/fujitsu-laptop.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/platform/x86/fujitsu-laptop.c b/drivers/platform/x86/fujitsu-laptop.c
index 78a39b143200..99befc1bc4f6 100644
--- a/drivers/platform/x86/fujitsu-laptop.c
+++ b/drivers/platform/x86/fujitsu-laptop.c
@@ -437,7 +437,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)
-- 
2.12.1

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web