pwm-backlight: handle BL_CORE_FBBLANK state
authorAlexandre Courbot <acourbot@nvidia.com>
Wed, 30 Jan 2013 06:19:15 +0000 (15:19 +0900)
committerThierry Reding <thierry.reding@avionic-design.de>
Wed, 30 Jan 2013 07:52:00 +0000 (08:52 +0100)
According to include/linux/backlight.h, the fb_blank field is to be
removed and blank status should preferably be set by setting the
BL_CORE_FBBLANK bit of the state field. This patch ensures this
condition is also taken into account when updating the backlight state.

Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
drivers/video/backlight/pwm_bl.c

index 069983ca49ff89da5d241649283e11f2699b6d9e..4af6d1302f174285cb2dda686a11a2bcaa3af390 100644 (file)
@@ -41,10 +41,9 @@ static int pwm_backlight_update_status(struct backlight_device *bl)
        int brightness = bl->props.brightness;
        int max = bl->props.max_brightness;
 
-       if (bl->props.power != FB_BLANK_UNBLANK)
-               brightness = 0;
-
-       if (bl->props.fb_blank != FB_BLANK_UNBLANK)
+       if (bl->props.power != FB_BLANK_UNBLANK ||
+           bl->props.fb_blank != FB_BLANK_UNBLANK ||
+           bl->props.state & BL_CORE_FBBLANK)
                brightness = 0;
 
        if (pb->notify)
This page took 0.092409 seconds and 5 git commands to generate.