summaryrefslogtreecommitdiffstats
path: root/drivers/video/backlight/pwm_bl.c
diff options
context:
space:
mode:
authorTakashi Iwai2010-12-13 09:29:52 +0100
committerTakashi Iwai2010-12-13 09:29:52 +0100
commit354d14b3f53cc749c5d26d4ba7280d1e931d6bc4 (patch)
tree59b597e44902d8db8bde7deac1e7e707327c6fe6 /drivers/video/backlight/pwm_bl.c
parentALSA: aoa: Remove wrong i2c_set_clientdata in onyx_i2c_remove() (diff)
parentsound: don't use flush_scheduled_work() (diff)
downloadkernel-qcow2-linux-354d14b3f53cc749c5d26d4ba7280d1e931d6bc4.tar.gz
kernel-qcow2-linux-354d14b3f53cc749c5d26d4ba7280d1e931d6bc4.tar.xz
kernel-qcow2-linux-354d14b3f53cc749c5d26d4ba7280d1e931d6bc4.zip
Merge branch 'topic/workq-update' into topic/misc
Diffstat (limited to 'drivers/video/backlight/pwm_bl.c')
-rw-r--r--drivers/video/backlight/pwm_bl.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/video/backlight/pwm_bl.c b/drivers/video/backlight/pwm_bl.c
index 550443518891..21866ec69656 100644
--- a/drivers/video/backlight/pwm_bl.c
+++ b/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");