Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c9bf296b authored by Henrique de Moraes Holschuh's avatar Henrique de Moraes Holschuh Committed by Len Brown
Browse files

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: default avatarHenrique de Moraes Holschuh <hmh@hmh.eng.br>
Acked-by: default avatarRichard Purdie <rpurdie@rpsys.net>
Signed-off-by: default avatarLen Brown <len.brown@intel.com>
parent 2bc808a8
Loading
Loading
Loading
Loading
+5 −1
Original line number Original line Diff line number Diff line
@@ -86,6 +86,7 @@


#include <linux/proc_fs.h>
#include <linux/proc_fs.h>
#include <linux/backlight.h>
#include <linux/backlight.h>
#include <linux/fb.h>
#include <asm/uaccess.h>
#include <asm/uaccess.h>


#include <linux/dmi.h>
#include <linux/dmi.h>
@@ -1707,7 +1708,10 @@ static int brightness_write(char *buf)


static int brightness_update_status(struct backlight_device *bd)
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 = {
static struct backlight_ops ibm_backlight_data = {