Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 221739
b: refs/heads/master
c: fef7764
h: refs/heads/master
i:
  221737: fb49c34
  221735: dbe3a8d
v: v3
  • Loading branch information
Arun Murthy authored and Linus Torvalds committed Nov 12, 2010
1 parent 53ec876 commit 25520c9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a1025e224c518dceb342d0cc54e5513c6476f60c
refs/heads/master: fef7764f8bca9d603a8a51dcb522db97739a33c2
7 changes: 6 additions & 1 deletion trunk/drivers/video/backlight/pwm_bl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
};
Expand All @@ -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;
Expand Down Expand Up @@ -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");
Expand Down
1 change: 1 addition & 0 deletions trunk/include/linux/pwm_backlight.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 25520c9

Please sign in to comment.