From 25520c95964e199e358fbf426346e51d0e497b0a Mon Sep 17 00:00:00 2001 From: Arun Murthy Date: Thu, 11 Nov 2010 14:05:28 -0800 Subject: [PATCH] --- yaml --- r: 221739 b: refs/heads/master c: fef7764f8bca9d603a8a51dcb522db97739a33c2 h: refs/heads/master i: 221737: fb49c3419ec2adae4541007ff79715d54a033ba9 221735: dbe3a8d483ad2c0912e3efc8c8896def1282bf6b v: v3 --- [refs] | 2 +- trunk/drivers/video/backlight/pwm_bl.c | 7 ++++++- trunk/include/linux/pwm_backlight.h | 1 + 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index 2aad4fcb34ad..3dd48bd7c69a 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: a1025e224c518dceb342d0cc54e5513c6476f60c +refs/heads/master: fef7764f8bca9d603a8a51dcb522db97739a33c2 diff --git a/trunk/drivers/video/backlight/pwm_bl.c b/trunk/drivers/video/backlight/pwm_bl.c index 550443518891..21866ec69656 100644 --- a/trunk/drivers/video/backlight/pwm_bl.c +++ b/trunk/drivers/video/backlight/pwm_bl.c @@ -25,6 +25,7 @@ struct pwm_bl_data { struct pwm_device *pwm; struct device *dev; unsigned int period; + unsigned int lth_brightness; int (*notify)(struct device *, int brightness); }; @@ -48,7 +49,9 @@ static int pwm_backlight_update_status(struct backlight_device *bl) pwm_config(pb->pwm, 0, pb->period); pwm_disable(pb->pwm); } else { - pwm_config(pb->pwm, brightness * pb->period / max, pb->period); + brightness = pb->lth_brightness + + (brightness * (pb->period - pb->lth_brightness) / max); + pwm_config(pb->pwm, brightness, pb->period); pwm_enable(pb->pwm); } return 0; @@ -92,6 +95,8 @@ static int pwm_backlight_probe(struct platform_device *pdev) pb->period = data->pwm_period_ns; pb->notify = data->notify; + pb->lth_brightness = data->lth_brightness * + (data->pwm_period_ns / data->max_brightness); pb->dev = &pdev->dev; pb->pwm = pwm_request(data->pwm_id, "backlight"); diff --git a/trunk/include/linux/pwm_backlight.h b/trunk/include/linux/pwm_backlight.h index 01b3d759f1fc..e031e1a486d9 100644 --- a/trunk/include/linux/pwm_backlight.h +++ b/trunk/include/linux/pwm_backlight.h @@ -8,6 +8,7 @@ struct platform_pwm_backlight_data { int pwm_id; unsigned int max_brightness; unsigned int dft_brightness; + unsigned int lth_brightness; unsigned int pwm_period_ns; int (*init)(struct device *dev); int (*notify)(struct device *dev, int brightness);