Commit f2b585b4 authored by Carlos Corbacho's avatar Carlos Corbacho Committed by Andi Kleen

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: default avatarMichal Pecio <michal.pecio@gmail.com>
Signed-off-by: default avatarCarlos Corbacho <carlos@strangeworlds.co.uk>
Signed-off-by: default avatarLen Brown <len.brown@intel.com>
Signed-off-by: default avatarAndi Kleen <ak@linux.intel.com>
parent 9991d9f2
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
#include <linux/init.h> #include <linux/init.h>
#include <linux/types.h> #include <linux/types.h>
#include <linux/dmi.h> #include <linux/dmi.h>
#include <linux/fb.h>
#include <linux/backlight.h> #include <linux/backlight.h>
#include <linux/leds.h> #include <linux/leds.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
...@@ -830,7 +831,15 @@ static int read_brightness(struct backlight_device *bd) ...@@ -830,7 +831,15 @@ static int read_brightness(struct backlight_device *bd)
static int update_bl_status(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; return 0;
} }
...@@ -852,8 +861,9 @@ static int __devinit acer_backlight_init(struct device *dev) ...@@ -852,8 +861,9 @@ static int __devinit acer_backlight_init(struct device *dev)
acer_backlight_device = bd; acer_backlight_device = bd;
bd->props.power = FB_BLANK_UNBLANK;
bd->props.brightness = max_brightness;
bd->props.max_brightness = max_brightness; bd->props.max_brightness = max_brightness;
bd->props.brightness = read_brightness(NULL);
backlight_update_status(bd); backlight_update_status(bd);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment