Skip to content

Commit

Permalink
pwm-backlight: handle BL_CORE_FBBLANK state
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Alexandre Courbot authored and Thierry Reding committed Jan 30, 2013
1 parent 0d75c20 commit 0132267
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions drivers/video/backlight/pwm_bl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 0132267

Please sign in to comment.