Skip to content

Commit

Permalink
acer-wmi: Respect framebuffer blanking in backlight
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Carlos Corbacho authored and Andi Kleen committed Jul 16, 2008
1 parent 9991d9f commit f2b585b
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions drivers/misc/acer-wmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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;
}

Expand All @@ -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;
}
Expand Down

0 comments on commit f2b585b

Please sign in to comment.