summaryrefslogtreecommitdiffstats
path: root/drivers/video
diff options
context:
space:
mode:
authorSean Paul <seanpaul@chromium.org>2015-05-11 13:32:05 -0700
committerLee Jones <lee.jones@linaro.org>2015-06-23 15:47:33 +0100
commit61c1c6147f69d8dea31fd133d2ec0b1594c9a3eb (patch)
tree0dc100b318d95ff504ebf3213bc157d05b6418b1 /drivers/video
parent0e441665bc6286a306a23cb0354b56d61e1d9ce6 (diff)
downloadlinux-61c1c6147f69d8dea31fd133d2ec0b1594c9a3eb.tar.bz2
backlight: lp855x: Don't clear level on suspend/blank
Don't clear the backlight level when we're going into suspend or blanking. Instead, just temporarily set the level to 0 so we retain the value when we resume. Reported-by: Benson Leung <bleung@chromium.org> Signed-off-by: Sean Paul <seanpaul@chromium.org> Tested-by: Stephen Barber <smbarber@chromium.org> Reviewed-by: Benson Leung <bleung@chromium.org> Acked-by: Milo Kim <milo.kim@ti.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/backlight/lp855x_bl.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/drivers/video/backlight/lp855x_bl.c b/drivers/video/backlight/lp855x_bl.c
index a26d3bb25650..88116b493f3b 100644
--- a/drivers/video/backlight/lp855x_bl.c
+++ b/drivers/video/backlight/lp855x_bl.c
@@ -257,21 +257,15 @@ static void lp855x_pwm_ctrl(struct lp855x *lp, int br, int max_br)
static int lp855x_bl_update_status(struct backlight_device *bl)
{
struct lp855x *lp = bl_get_data(bl);
+ int brightness = bl->props.brightness;
if (bl->props.state & (BL_CORE_SUSPENDED | BL_CORE_FBBLANK))
- bl->props.brightness = 0;
+ brightness = 0;
- if (lp->mode == PWM_BASED) {
- int br = bl->props.brightness;
- int max_br = bl->props.max_brightness;
-
- lp855x_pwm_ctrl(lp, br, max_br);
-
- } else if (lp->mode == REGISTER_BASED) {
- u8 val = bl->props.brightness;
-
- lp855x_write_byte(lp, lp->cfg->reg_brightness, val);
- }
+ if (lp->mode == PWM_BASED)
+ lp855x_pwm_ctrl(lp, brightness, bl->props.max_brightness);
+ else if (lp->mode == REGISTER_BASED)
+ lp855x_write_byte(lp, lp->cfg->reg_brightness, (u8)brightness);
return 0;
}