summaryrefslogtreecommitdiffstats
path: root/drivers/acpi/ibm_acpi.c
diff options
context:
space:
mode:
authorHenrique de Moraes Holschuh2007-03-08 09:28:15 +0100
committerLen Brown2007-03-09 02:24:57 +0100
commitc9bf296b6467968ecb9d988e7ed754a19c2e63d9 (patch)
tree456f437ff2a68ce983de41fb3d2e218f9a7b9451 /drivers/acpi/ibm_acpi.c
parentACPI: ibm-acpi: make ibm-acpi bay support optional (diff)
downloadkernel-qcow2-linux-c9bf296b6467968ecb9d988e7ed754a19c2e63d9.tar.gz
kernel-qcow2-linux-c9bf296b6467968ecb9d988e7ed754a19c2e63d9.tar.xz
kernel-qcow2-linux-c9bf296b6467968ecb9d988e7ed754a19c2e63d9.zip
ACPI: ibm-acpi: improve backlight power handling
Improve the backlight code to emulate as much as possible the power management events, as we are unable to really power on or power off the backlight. Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br> Acked-by: Richard Purdie <rpurdie@rpsys.net> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/ibm_acpi.c')
-rw-r--r--drivers/acpi/ibm_acpi.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/acpi/ibm_acpi.c b/drivers/acpi/ibm_acpi.c
index e7309a668732..36901362fd24 100644
--- a/drivers/acpi/ibm_acpi.c
+++ b/drivers/acpi/ibm_acpi.c
@@ -86,6 +86,7 @@
#include <linux/proc_fs.h>
#include <linux/backlight.h>
+#include <linux/fb.h>
#include <asm/uaccess.h>
#include <linux/dmi.h>
@@ -1707,7 +1708,10 @@ static int brightness_write(char *buf)
static int brightness_update_status(struct backlight_device *bd)
{
- return brightness_set(bd->props.brightness);
+ return brightness_set(
+ (bd->props.fb_blank == FB_BLANK_UNBLANK &&
+ bd->props.power == FB_BLANK_UNBLANK) ?
+ bd->props.brightness : 0);
}
static struct backlight_ops ibm_backlight_data = {