linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lee Jones <lee.jones@linaro.org>
To: linux-fbdev@vger.kernel.org
Subject: Re: [PATCH] backlight/lp855x: Don't clear level on suspend/blank
Date: Thu, 14 May 2015 07:25:09 +0000	[thread overview]
Message-ID: <20150514072509.GC20358@x1> (raw)
In-Reply-To: <1431376325-25741-1-git-send-email-seanpaul@chromium.org>

On Mon, 11 May 2015, Sean Paul wrote:

> 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>
> Tested-by: Stephen Barber <smbarber@chromium.org>
> Signed-off-by: Sean Paul <seanpaul@chromium.org>
> ---
>  drivers/video/backlight/lp855x_bl.c | 18 ++++++------------
>  1 file changed, 6 insertions(+), 12 deletions(-)

Applied with Acks, thanks.

> diff --git a/drivers/video/backlight/lp855x_bl.c b/drivers/video/backlight/lp855x_bl.c
> index 08ae72f..74daf7c 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;
>  }

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

      parent reply	other threads:[~2015-05-14  7:25 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-11 20:32 [PATCH] backlight/lp855x: Don't clear level on suspend/blank Sean Paul
2015-05-11 22:48 ` Kim, Milo
2015-05-13 23:31 ` Kim, Milo
2015-05-13 23:32 ` Kim, Milo
2015-05-13 23:40 ` Benson Leung
2015-05-14  7:25 ` Lee Jones [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150514072509.GC20358@x1 \
    --to=lee.jones@linaro.org \
    --cc=linux-fbdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).