summary refs log tree commit diff
path: root/drivers
diff options
context:
space:
mode:
authorCarlos Corbacho <carlos@strangeworlds.co.uk>2008-06-21 09:09:27 +0100
committerAndi Kleen <andi@basil.nowhere.org>2008-07-16 23:27:02 +0200
commitf2b585b4a31731b17b9769eae523986fa7fddcde (patch)
tree6c7271d33a60e2eae1731f5880dc50ddbdfb0faf /drivers
parent9991d9f2bc75dc8735932240b67432d4073b8f60 (diff)
downloadlinux-f2b585b4a31731b17b9769eae523986fa7fddcde.tar.gz
acer-wmi: Respect framebuffer blanking in backlight
If the framebuffer has requested blanking, turn the backlight down. Also
offer the user the option to do this.

Reported-by: Michal Pecio <michal.pecio@gmail.com>
Signed-off-by: Carlos Corbacho <carlos@strangeworlds.co.uk>
Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/misc/acer-wmi.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/drivers/misc/acer-wmi.c b/drivers/misc/acer-wmi.c
index b82ff25a7b54..e35825f7e7ba 100644
--- a/drivers/misc/acer-wmi.c
+++ b/drivers/misc/acer-wmi.c
@@ -29,6 +29,7 @@
 #include <linux/init.h>
 #include <linux/types.h>
 #include <linux/dmi.h>
+#include <linux/fb.h>
 #include <linux/backlight.h>
 #include <linux/leds.h>
 #include <linux/platform_device.h>
@@ -830,7 +831,15 @@ static int read_brightness(struct backlight_device *bd)
 
 static int update_bl_status(struct backlight_device *bd)
 {
-	set_u32(bd->props.brightness, ACER_CAP_BRIGHTNESS);
+	int intensity = bd->props.brightness;
+
+	if (bd->props.power != FB_BLANK_UNBLANK)
+		intensity = 0;
+	if (bd->props.fb_blank != FB_BLANK_UNBLANK)
+		intensity = 0;
+
+	set_u32(intensity, ACER_CAP_BRIGHTNESS);
+
 	return 0;
 }
 
@@ -852,8 +861,9 @@ static int __devinit acer_backlight_init(struct device *dev)
 
 	acer_backlight_device = bd;
 
+	bd->props.power = FB_BLANK_UNBLANK;
+	bd->props.brightness = max_brightness;
 	bd->props.max_brightness = max_brightness;
-	bd->props.brightness = read_brightness(NULL);
 	backlight_update_status(bd);
 	return 0;
 }