Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/drivers/video/backlight/pwm_bl.c b/drivers/video/backlight/pwm_bl.c
- index 342b7d7..67bee2e 100644
- --- a/drivers/video/backlight/pwm_bl.c
- +++ b/drivers/video/backlight/pwm_bl.c
- @@ -38,17 +38,18 @@ static int pwm_backlight_update_status(struct backlight_device *bl)
- struct pwm_bl_data *pb = dev_get_drvdata(&bl->dev);
- int brightness = bl->props.brightness;
- int max = bl->props.max_brightness;
- + int poweroff = false;
- if (bl->props.power != FB_BLANK_UNBLANK)
- - brightness = 0;
- + poweroff = true;
- if (bl->props.fb_blank != FB_BLANK_UNBLANK)
- - brightness = 0;
- + poweroff = true;
- if (pb->notify)
- brightness = pb->notify(pb->dev, brightness);
- - if (brightness == 0) {
- + if (poweroff) {
- pwm_config(pb->pwm, 0, pb->period);
- pwm_disable(pb->pwm);
- } else {
- @@ -58,6 +59,7 @@ static int pwm_backlight_update_status(struct backlight_device *bl)
- pwm_enable(pb->pwm);
- }
- + /* maybe this needs to send back 0 if power is off? */
- if (pb->notify_after)
- pb->notify_after(pb->dev, brightness);
- @@ -66,6 +68,11 @@ static int pwm_backlight_update_status(struct backlight_device *bl)
- static int pwm_backlight_get_brightness(struct backlight_device *bl)
- {
- + if ((bl->props.power != FB_BLANK_UNBLANK) ||
- + (bl->props.fb_blank != FB_BLANK_UNBLANK) ) {
- + return 0;
- + }
- +
- return bl->props.brightness;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement